~andreserl/ubuntu/natty/eucalyptus/lp732082

« back to all changes in this revision

Viewing changes to node/handlers.c

  • Committer: Dave Walker (Daviey)
  • Date: 2011-03-01 12:24:55 UTC
  • mfrom: (444.100.2 upstream)
  • Revision ID: davewalker@ubuntu.com-20110301122455-v0o2rbfcb4zn175l
* New upstream snapshot of minor point release, 2.0.1 (r1256).
  - Fixes node controller memory leak. (LP: #523211)
  - Rearrange of linker options for libEucalyptusNC.so. (LP: #724470)

Show diffs side-by-side

added added

removed removed

Lines of Context:
384
384
 
385
385
    snprintf(buf, MAX_PATH, "%s", gen_libvirt_cmd_path);
386
386
    if (strnlen(ramdiskId, CHAR_BUFFER_SIZE)) {
387
 
        strncat(buf, " --ramdisk", MAX_PATH);
 
387
        strncat(buf, " --ramdisk", MAX_PATH - strlen(buf) - 1);
388
388
    }
389
389
    if (use_virtio_net) {
390
 
        strncat(buf, " --virtionet", MAX_PATH);
 
390
        strncat(buf, " --virtionet", MAX_PATH - strlen(buf) - 1);
391
391
    }
392
392
    if (use_virtio_root) {
393
 
        strncat(buf, " --virtioroot", MAX_PATH);
 
393
        strncat(buf, " --virtioroot", MAX_PATH - strlen(buf) - 1);
394
394
    }
395
395
    
396
396
    if (params->disk > 0) { /* TODO: get this info from scMakeImage */
397
 
        strncat (buf, " --ephemeral", MAX_PATH);
 
397
        strncat (buf, " --ephemeral", MAX_PATH - strlen(buf) - 1);
398
398
    }
399
399
    snprintf(buf+strnlen(buf,MAX_PATH), MAX_PATH-strnlen(buf,MAX_PATH),
400
400
             " --basepath='%s'", disk_path);
516
516
{
517
517
    ncInstance * instance = (ncInstance *)arg;
518
518
    virDomainPtr dom = NULL;
519
 
    char * disk_path, * xml=NULL;
 
519
    char *disk_path=NULL, *xml=NULL;
520
520
    char *brname=NULL;
521
521
    int error, i;
522
522
    
547
547
        logprintfl (EUCAFATAL, "Failed to prepare images for instance %s (error=%d)\n", instance->instanceId, error);
548
548
        change_state (instance, SHUTOFF);
549
549
        if (brname) free(brname);
550
 
        return NULL;
551
 
    }
552
 
        if (instance->state==TEARDOWN) { // timed out in STAGING
553
 
                if (brname) free(brname);
554
 
        return NULL;
555
 
        }
 
550
        if (disk_path) free(disk_path);
 
551
        return NULL;
 
552
    }
 
553
    if (instance->state==TEARDOWN) { // timed out in STAGING
 
554
            if (disk_path) free(disk_path);
 
555
            if (brname) free(brname);
 
556
            return NULL;
 
557
    }
556
558
    if (instance->state==CANCELED) {
557
559
        logprintfl (EUCAFATAL, "Startup of instance %s was cancelled\n", instance->instanceId);
558
560
        change_state (instance, SHUTOFF);
559
561
        if (brname) free(brname);
 
562
        if (disk_path) free(disk_path);
560
563
        return NULL;
561
564
    }
562
565
    
573
576
                              &xml);
574
577
 
575
578
    if (brname) free(brname);
 
579
    if (disk_path) free(disk_path);
576
580
    if (xml) logprintfl (EUCADEBUG2, "libvirt XML config:\n%s\n", xml);
577
581
    if (error) {
578
582
        logprintfl (EUCAFATAL, "Failed to create libvirt XML config for instance %s\n", instance->instanceId);