~ubuntu-core-dev/ubuntu/maverick/eucalyptus/devel

« back to all changes in this revision

Viewing changes to node/handlers_kvm.c

  • Committer: Dustin Kirkland
  • Date: 2010-07-22 08:41:57 UTC
  • mfrom: (1050.1.19 ubuntu)
  • Revision ID: kirkland@x200-20100722084157-zh2p8dkawznvxxpn
Approving Dave Walker's merge of new upstream Eucalyptus 2.0 release.

Dustin Kirkland <kirkland@canonical.com>

* New major upstream version merge, 2.0 (r1211).
  - 01-wsdl-stubs.patch, debian/wsdl.md5sums: wsdl stubs updated.
  - 11-state-cleanup-memleakfix.patch: Removed, fixed upstream.
  - 21-eucalyptus-1.7-with-gwt-1.6.4.patch: New patch, allows 
    eucalyptus-1.7 to be built against gwt 1.6.4. Based on patch courtesy 
    of Dmitrii Zagorodnov, upstream. (LP: #597330)
* debian/eucalyptus-java-common.links: 
  - Changed symlink for groovy, point to groovy.all.jar, making compatiable 
    with groovy versions >1.7. (LP: #595421)
  - Added ant.jar & jetty-rewrite-handler.jar as they are now required.
* debian/control
  - & debian/build-jars: Added libjavassist-java and libjetty-extra-java as 
    build dependencies.
  - Added libjetty-extra-java as a dependency of eucalyptus-java-common
* The binary resulting jar's have been renamed from eucalyptus-*-1.6.2.jar
  to eucalyptus-*-main.jar:    
  - debian/eucalyptus-cc.upstart
  - debian/eucalyptus-cloud.install
  - debian/eucalyptus-common.eucalyptus.upstart
  - debian/eucalyptus-java-common.install
  - debian/eucalyptus-network.upstart
  - debian/eucalyptus-sc.install
  - debian/eucalyptus-walrus.install
* debian/eucalyptus-java-common.install: New upstream jars that have been
  installed:
  - eucalyptus-db-hsqldb-ext-main.jar
  - eucalyptus-component-main.jar
* debian/control:
  - Updated Standards Version to 3.8.4 (no change)
  - Updated the upstream Homepage to: http://open.eucalyptus.com/
  - Changed Vcs-Bzr to reflect new location of Ubuntu hosted development branch.
  - Made the Build Dependency of groovy and the binary eucalyptus-java-common
    package depend on version >=1.7.

Show diffs side-by-side

added added

removed removed

Lines of Context:
263
263
    dom = virDomainCreateLinux (*conn, xml, 0);
264
264
    sem_v (hyp_sem);
265
265
    free (xml);
266
 
    
 
266
 
 
267
    //generate xml for each attached vol and attach them
 
268
    int i;
 
269
    for (i=0 ; i < instance->volumesSize; ++i) {
 
270
        char attach_xml[1024];
 
271
        int err = 0;
 
272
        ncVolume *volume = &instance->volumes[i];
 
273
        snprintf (attach_xml, 1024, "<disk type='block'><driver name='phy'/><source dev='%s'/><target dev='%s'/></disk>", volume->remoteDev, volume->localDevReal);
 
274
        sem_p (hyp_sem);
 
275
        err = virDomainAttachDevice (dom, attach_xml);
 
276
        sem_v (hyp_sem);      
 
277
        if (err) {
 
278
            logprintfl (EUCAERROR, "virDomainAttachDevice() failed (err=%d) XML=%s\n", err, attach_xml);
 
279
        } else {
 
280
            logprintfl (EUCAINFO, "reattached %s to %s in domain %s\n", volume->remoteDev, volume->localDevReal, instance->instanceId);
 
281
        }
 
282
    }
267
283
    if (dom==NULL) {
268
284
        logprintfl (EUCAFATAL, "Failed to restart instance %s\n", instance->instanceId);
269
285
        change_state (instance, SHUTOFF);
414
430
            char xml [1024];
415
431
            int is_iscsi_target = 0;
416
432
            char *local_iscsi_dev;
 
433
            int virtio_dev = 0;
417
434
            rc = 0;
 
435
            /* only attach using virtio when the device is /dev/vdXX */
 
436
            if (localDevReal[5] == 'v' && localDevReal[6] == 'd') {
 
437
                virtio_dev = 1;
 
438
            }
418
439
            if(check_iscsi(remoteDev)) {
419
440
                is_iscsi_target = 1;
420
441
                /*get credentials, decrypt them*/
425
446
                  logprintfl(EUCAERROR, "AttachVolume(): failed to connect to iscsi target\n");
426
447
                  rc = 1;
427
448
                } else {
428
 
                  snprintf (xml, 1024, "<disk type='block'><driver name='phy'/><source dev='%s'/><target dev='%s'/></disk>", local_iscsi_dev, localDevReal);
 
449
                  if (nc->config_use_virtio_disk && virtio_dev) {
 
450
                      snprintf (xml, 1024, "<disk type='block'><driver name='phy'/><source dev='%s'/><target dev='%s' bus='virtio'/></disk>", local_iscsi_dev, localDevReal);
 
451
                  } else {
 
452
                      snprintf (xml, 1024, "<disk type='block'><driver name='phy'/><source dev='%s'/><target dev='%s'/></disk>", local_iscsi_dev, localDevReal);
 
453
                  }
429
454
                }
430
455
            } else {
431
 
                snprintf (xml, 1024, "<disk type='block'><driver name='phy'/><source dev='%s'/><target dev='%s'/></disk>", remoteDev, localDevReal);
 
456
                if (nc->config_use_virtio_disk && virtio_dev) {
 
457
                    snprintf (xml, 1024, "<disk type='block'><driver name='phy'/><source dev='%s'/><target dev='%s' bus='virtio'/></disk>", remoteDev, localDevReal);
 
458
                } else {
 
459
                    snprintf (xml, 1024, "<disk type='block'><driver name='phy'/><source dev='%s'/><target dev='%s'/></disk>", remoteDev, localDevReal);
 
460
                }
432
461
                rc = stat(remoteDev, &statbuf);
433
462
                if (rc) {
434
463
                   logprintfl(EUCAERROR, "AttachVolume(): cannot locate local block device file '%s'\n", remoteDev);
467
496
        ncVolume * volume;
468
497
 
469
498
        sem_p (inst_sem);
470
 
        volume = add_volume (instance, volumeId, remoteDev, localDevTag, "attached");
 
499
        volume = add_volume (instance, volumeId, remoteDev, localDevTag, localDevReal, "attached");
471
500
        scSaveInstanceInfo(instance); /* to enable NC recovery */
472
501
        sem_v (inst_sem);
473
502
        if ( volume == NULL ) {
519
548
            char xml [1024];
520
549
            int is_iscsi_target = 0;
521
550
            char *local_iscsi_dev;
 
551
            int virtio_dev = 0;
 
552
            /* only attach using virtio when the device is /dev/vdXX */
 
553
            if (localDevReal[5] == 'v' && localDevReal[6] == 'd') {
 
554
                virtio_dev = 1;
 
555
            }
522
556
            if(check_iscsi(remoteDev)) {
523
557
                is_iscsi_target = 1;
524
558
                /*get credentials, decrypt them*/
526
560
                /*logout from target*/
527
561
                if((local_iscsi_dev = get_iscsi_target(nc->get_storage_cmd_path, remoteDev)) == NULL)
528
562
                    return ERROR;
529
 
                snprintf (xml, 1024, "<disk type='block'><driver name='phy'/><source dev='%s'/><target dev='%s'/></disk>", local_iscsi_dev, localDevReal);
 
563
                if (nc->config_use_virtio_disk && virtio_dev) {
 
564
                    snprintf (xml, 1024, "<disk type='block'><driver name='phy'/><source dev='%s'/><target dev='%s' bus='virtio'/></disk>", local_iscsi_dev, localDevReal);
 
565
                } else {
 
566
                    snprintf (xml, 1024, "<disk type='block'><driver name='phy'/><source dev='%s'/><target dev='%s'/></disk>", local_iscsi_dev, localDevReal);
 
567
                }
530
568
            } else {
531
 
                snprintf (xml, 1024, "<disk type='block'><driver name='phy'/><source dev='%s'/><target dev='%s'/></disk>", remoteDev, localDevReal);
 
569
                if (nc->config_use_virtio_disk && virtio_dev) {
 
570
                    snprintf (xml, 1024, "<disk type='block'><driver name='phy'/><source dev='%s'/><target dev='%s' bus='virtio'/></disk>", remoteDev, localDevReal);
 
571
                } else {
 
572
                    snprintf (xml, 1024, "<disk type='block'><driver name='phy'/><source dev='%s'/><target dev='%s'/></disk>", remoteDev, localDevReal);
 
573
                }
532
574
            }
533
575
            /* protect KVM calls, just in case */
534
576
            sem_p (hyp_sem);