~ubuntu-branches/ubuntu/quantal/virtinst/quantal-proposed

« back to all changes in this revision

Viewing changes to virtinst/Guest.py

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-07-24 08:52:01 UTC
  • mfrom: (1.6.8 sid)
  • Revision ID: package-import@ubuntu.com-20120724085201-q3h0cbabg4t46gfm
Tags: 0.600.2-1ubuntu1
* Merge from debian unstable. Remaining changes:
  - debian/patches/9003-fix-path-to-hvmloader-in-testsuite.patch: adjust
    testsuite for 0001-fix-path-to-hvmloader.patch and
    0002-Fix-path-to-pygrub.patch.
  - debian/patches/9004_ubuntu_fix_tree_support.patch: Fix tree detection
    for all ISO/HTTP source, to not longer fail with cobbler/koan.
  - debian/patches/0004-Fix-path-to-qemu-dm.patch: fix the path to the
    qemu-dm binary.
  - debian/{control,rules,pyversions}: Build using dh_python2, use
    debhelper v8 instead of cdbs; for some reason the package build an
    empty binary package when using dh_python2.
  - debian/control: added acl package to depends.
  - debian/control: added libvirt-bin to recommends
* Dropped patches:
  - debian/patches/9005_ubuntu_releases.patch: Upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
782
782
            "controller": virtinst.VirtualController,
783
783
            "filesystem": virtinst.VirtualFilesystem,
784
784
            "smartcard" : virtinst.VirtualSmartCardDevice,
785
 
            "redirdev"   : virtinst.VirtualRedirDevice,
 
785
            "redirdev"  : virtinst.VirtualRedirDevice,
 
786
            "memballoon": virtinst.VirtualMemballoon,
786
787
        }
787
788
 
788
789
        # Hand off all child element parsing to relevant classes
870
871
            finally:
871
872
                if origpath:
872
873
                    dev.path = origpath
 
874
        def get_vscsi_ctrl_xml():
 
875
            vscsi_class = virtinst.VirtualController.get_class_for_type(
 
876
                          virtinst.VirtualController.CONTROLLER_TYPE_SCSI)
 
877
            ctrl = vscsi_class(self.conn)
 
878
            ctrl.set_address("spapr-vio")
 
879
            return ctrl.get_xml_config()
873
880
 
874
881
        xml = self._get_emulator_xml()
875
882
        # Build XML
876
883
        for dev in devs:
877
884
            xml = _util.xml_append(xml, get_dev_xml(dev))
 
885
            if (dev.address.type == "spapr-vio" and
 
886
                  dev.virtual_device_type == virtinst.VirtualDevice.VIRTUAL_DEV_DISK):
 
887
                xml = _util.xml_append(xml, get_vscsi_ctrl_xml())
878
888
 
879
889
        return xml
880
890
 
1490
1500
                    disk.bus = "fdc"
1491
1501
                else:
1492
1502
                    if self.installer.is_hvm():
1493
 
                        disk.bus = "ide"
 
1503
                        if (self.installer.type == "kvm" and
 
1504
                            self.installer.machine == "pseries"):
 
1505
                            disk.bus = "scsi"
 
1506
                        else:
 
1507
                            disk.bus = "ide"
1494
1508
                    elif self.installer.is_xenpv():
1495
1509
                        disk.bus = "xen"
1496
1510
            used_targets.append(disk.generate_target(used_targets))
1533
1547
 
1534
1548
        # Generate UUID
1535
1549
        if self.uuid is None:
1536
 
            found = False
1537
 
            for ignore in range(256):
1538
 
                self.uuid = _util.uuidToString(_util.randomUUID())
1539
 
                if _util.vm_uuid_collision(self.conn, self.uuid):
1540
 
                    continue
1541
 
                found = True
1542
 
                break
1543
 
 
1544
 
            if not found:
1545
 
                logging.debug("Failed to generate non-conflicting UUID")
 
1550
            self.uuid = _util.generate_uuid(self.conn)
1546
1551
 
1547
1552
 
1548
1553
    ###################################