Rebased to version 1.0.1

virt-install/virt-xml: New --memorybacking option (Chen Hanxiao)
virt-install/virt-xml: New --memtune option (Chen Hanxiao)
virt-manager: UI for LXC <idmap> (Chen Hanxiao)
virt-manager: gsettings key to disable keygrab (Kjö Hansi Glaz)
virt-manager: Show domain state reason in the UI (Giuseppe Scrivano)
Fix a number of bugs found since the 1.0.0 release
This commit is contained in:
Cole Robinson 2014-03-22 18:42:17 -04:00
parent 9f61d853b6
commit 1f2d6fbad3
20 changed files with 12 additions and 1424 deletions

View File

@ -1,23 +0,0 @@
From 3aef95607e3462f6f738a1bad24c4ccfb615997c Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Mon, 17 Feb 2014 10:22:24 -0500
Subject: [PATCH] connect: Fix connecting to lxc:/// URI
(cherry picked from commit 0169042c1ee45fed779fc106476fc98265236651)
---
virtManager/connect.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/virtManager/connect.py b/virtManager/connect.py
index 7cd4da7..1247d75 100644
--- a/virtManager/connect.py
+++ b/virtManager/connect.py
@@ -364,7 +364,7 @@ class vmmConnect(vmmGObjectUI):
hvstr = ""
if hv == HV_XEN:
hvstr = "xen"
- elif hv == HV_QEMU or HV_QEMU_SESSION:
+ elif hv == HV_QEMU or hv == HV_QEMU_SESSION:
hvstr = "qemu"
else:
hvstr = "lxc"

View File

@ -1,24 +0,0 @@
From f52e2a1d383121e71791f72a7172b98016bb5884 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Mon, 17 Feb 2014 10:24:41 -0500
Subject: [PATCH] create: Fix non-x86 qemu/kvm guest creation
(cherry picked from commit a37b200f69347922800d58342968307b74ec9ded)
---
virtManager/create.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/virtManager/create.py b/virtManager/create.py
index d8e68c3..f1c57b7 100644
--- a/virtManager/create.py
+++ b/virtManager/create.py
@@ -1376,7 +1376,8 @@ class vmmCreate(vmmGObjectUI):
guest.add_default_devices()
- if self.conn.check_support(self.conn.SUPPORT_CONN_PM_DISABLE):
+ if (guest.os.is_x86() and
+ self.conn.check_support(self.conn.SUPPORT_CONN_PM_DISABLE)):
guest.pm.suspend_to_mem = False
guest.pm.suspend_to_disk = False

View File

@ -1,497 +0,0 @@
From 12c4a54a92f935abceb358a8d7ba8f391597f014 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Mon, 17 Feb 2014 11:43:53 -0500
Subject: [PATCH] caps: Simplify guest lookup routines
Checking for acceleration should always be done, API users can opt out
by requesting a specific domain type.
(cherry picked from commit 63b27ceae1e5a1521b968deb7e04d1a5ebd3de39)
---
.../compare/virt-convert-ovf-compare.xml | 7 +++-
.../compare/virt-convert-vmx-compare.xml | 7 +++-
.../ovf2libvirt_ovf_directory.libvirt | 7 +++-
.../libvirt_output/ovf2libvirt_test1.libvirt | 7 +++-
.../ovf2libvirt_test1.libvirt.disk_qcow2 | 7 +++-
.../libvirt_output/ovf2libvirt_test2.libvirt | 7 +++-
.../vmx2libvirt_test-vmx-zip.libvirt | 7 +++-
.../libvirt_output/vmx2libvirt_test1.libvirt | 7 +++-
.../vmx2libvirt_test1.libvirt.disk_raw | 7 +++-
.../libvirt_output/vmx2libvirt_vmx-dir.libvirt | 7 +++-
virt-install | 3 --
virtManager/create.py | 4 +-
virtinst/capabilities.py | 49 +++++-----------------
virtinst/virtimage.py | 9 +---
14 files changed, 63 insertions(+), 72 deletions(-)
diff --git a/tests/cli-test-xml/compare/virt-convert-ovf-compare.xml b/tests/cli-test-xml/compare/virt-convert-ovf-compare.xml
index c073ffc..a1d2f75 100644
--- a/tests/cli-test-xml/compare/virt-convert-ovf-compare.xml
+++ b/tests/cli-test-xml/compare/virt-convert-ovf-compare.xml
@@ -1,6 +1,6 @@
Copying test.ovf-disk1.vmdk to /tmp/test.ovf-disk1
Copying testfile to /tmp/testfile
-<domain type="qemu">
+<domain type="kvm">
<name>test.ovf</name>
<uuid>00000000-1111-2222-3333-444444444444</uuid>
<description>This is the description, created by RWMJ.</description>
@@ -16,6 +16,9 @@ Copying testfile to /tmp/testfile
<apic/>
<pae/>
</features>
+ <cpu mode="custom" match="exact">
+ <model>core2duo</model>
+ </cpu>
<clock offset="utc">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
@@ -25,7 +28,7 @@ Copying testfile to /tmp/testfile
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
- <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <emulator>/usr/bin/qemu-kvm</emulator>
<disk type="file" device="disk">
<driver name="qemu"/>
<source file="/tmp/test.ovf-disk1"/>
diff --git a/tests/cli-test-xml/compare/virt-convert-vmx-compare.xml b/tests/cli-test-xml/compare/virt-convert-vmx-compare.xml
index 20f046d..ffe7b59 100644
--- a/tests/cli-test-xml/compare/virt-convert-vmx-compare.xml
+++ b/tests/cli-test-xml/compare/virt-convert-vmx-compare.xml
@@ -1,5 +1,5 @@
Running /usr/bin/qemu-img convert -O qcow2 fedora.vmdk /var/lib/libvirt/images/fedora.qcow2
-<domain type="qemu">
+<domain type="kvm">
<name>fedora</name>
<uuid>00000000-1111-2222-3333-444444444444</uuid>
<memory>524288</memory>
@@ -14,6 +14,9 @@ Running /usr/bin/qemu-img convert -O qcow2 fedora.vmdk /var/lib/libvirt/images/f
<apic/>
<pae/>
</features>
+ <cpu mode="custom" match="exact">
+ <model>core2duo</model>
+ </cpu>
<clock offset="utc">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
@@ -23,7 +26,7 @@ Running /usr/bin/qemu-img convert -O qcow2 fedora.vmdk /var/lib/libvirt/images/f
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
- <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <emulator>/usr/bin/qemu-kvm</emulator>
<disk type="file" device="disk">
<driver name="qemu" type="qcow2"/>
<source file="/var/lib/libvirt/images/fedora.qcow2"/>
diff --git a/tests/virtconv-files/libvirt_output/ovf2libvirt_ovf_directory.libvirt b/tests/virtconv-files/libvirt_output/ovf2libvirt_ovf_directory.libvirt
index c88c140..597a0c5 100644
--- a/tests/virtconv-files/libvirt_output/ovf2libvirt_ovf_directory.libvirt
+++ b/tests/virtconv-files/libvirt_output/ovf2libvirt_ovf_directory.libvirt
@@ -1,4 +1,4 @@
-<domain type="qemu">
+<domain type="kvm">
<name>CentOS-6.4-i386-Gnome.ovf</name>
<uuid>00000000-1111-2222-3333-444444444444</uuid>
<memory>524288</memory>
@@ -13,6 +13,9 @@
<apic/>
<pae/>
</features>
+ <cpu mode="custom" match="exact">
+ <model>core2duo</model>
+ </cpu>
<clock offset="utc">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
@@ -22,7 +25,7 @@
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
- <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <emulator>/usr/bin/qemu-kvm</emulator>
<disk type="file" device="disk">
<driver name="qemu"/>
<source file="/var/lib/libvirt/images/CentOS-6.4-i386-Gnome-disk1"/>
diff --git a/tests/virtconv-files/libvirt_output/ovf2libvirt_test1.libvirt b/tests/virtconv-files/libvirt_output/ovf2libvirt_test1.libvirt
index 22978ca..83c3f90 100644
--- a/tests/virtconv-files/libvirt_output/ovf2libvirt_test1.libvirt
+++ b/tests/virtconv-files/libvirt_output/ovf2libvirt_test1.libvirt
@@ -1,4 +1,4 @@
-<domain type="qemu">
+<domain type="kvm">
<name>test.ovf</name>
<uuid>00000000-1111-2222-3333-444444444444</uuid>
<description>This is the description, created by RWMJ.</description>
@@ -14,6 +14,9 @@
<apic/>
<pae/>
</features>
+ <cpu mode="custom" match="exact">
+ <model>core2duo</model>
+ </cpu>
<clock offset="utc">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
@@ -23,7 +26,7 @@
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
- <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <emulator>/usr/bin/qemu-kvm</emulator>
<disk type="file" device="disk">
<driver name="qemu"/>
<source file="/var/lib/libvirt/images/test.ovf-disk1"/>
diff --git a/tests/virtconv-files/libvirt_output/ovf2libvirt_test1.libvirt.disk_qcow2 b/tests/virtconv-files/libvirt_output/ovf2libvirt_test1.libvirt.disk_qcow2
index d86ced0..1b50422 100644
--- a/tests/virtconv-files/libvirt_output/ovf2libvirt_test1.libvirt.disk_qcow2
+++ b/tests/virtconv-files/libvirt_output/ovf2libvirt_test1.libvirt.disk_qcow2
@@ -1,4 +1,4 @@
-<domain type="qemu">
+<domain type="kvm">
<name>test.ovf</name>
<uuid>00000000-1111-2222-3333-444444444444</uuid>
<description>This is the description, created by RWMJ.</description>
@@ -14,6 +14,9 @@
<apic/>
<pae/>
</features>
+ <cpu mode="custom" match="exact">
+ <model>core2duo</model>
+ </cpu>
<clock offset="utc">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
@@ -23,7 +26,7 @@
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
- <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <emulator>/usr/bin/qemu-kvm</emulator>
<disk type="file" device="disk">
<driver name="qemu" type="qcow2"/>
<source file="/var/lib/libvirt/images/test.ovf-disk1.qcow2"/>
diff --git a/tests/virtconv-files/libvirt_output/ovf2libvirt_test2.libvirt b/tests/virtconv-files/libvirt_output/ovf2libvirt_test2.libvirt
index aa0303e..9d28269 100644
--- a/tests/virtconv-files/libvirt_output/ovf2libvirt_test2.libvirt
+++ b/tests/virtconv-files/libvirt_output/ovf2libvirt_test2.libvirt
@@ -1,4 +1,4 @@
-<domain type="qemu">
+<domain type="kvm">
<name>w2k3_32bit</name>
<uuid>00000000-1111-2222-3333-444444444444</uuid>
<description>Description added by RWMJ.</description>
@@ -14,6 +14,9 @@
<apic/>
<pae/>
</features>
+ <cpu mode="custom" match="exact">
+ <model>core2duo</model>
+ </cpu>
<clock offset="utc">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
@@ -23,7 +26,7 @@
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
- <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <emulator>/usr/bin/qemu-kvm</emulator>
<disk type="file" device="disk">
<driver name="qemu"/>
<source file="/var/lib/libvirt/images/w2k3_32bit-disk1"/>
diff --git a/tests/virtconv-files/libvirt_output/vmx2libvirt_test-vmx-zip.libvirt b/tests/virtconv-files/libvirt_output/vmx2libvirt_test-vmx-zip.libvirt
index 179978b..9e2058f 100644
--- a/tests/virtconv-files/libvirt_output/vmx2libvirt_test-vmx-zip.libvirt
+++ b/tests/virtconv-files/libvirt_output/vmx2libvirt_test-vmx-zip.libvirt
@@ -1,4 +1,4 @@
-<domain type="qemu">
+<domain type="kvm">
<name>minix</name>
<uuid>00000000-1111-2222-3333-444444444444</uuid>
<memory>204800</memory>
@@ -14,6 +14,9 @@
<apic/>
<pae/>
</features>
+ <cpu mode="custom" match="exact">
+ <model>core2duo</model>
+ </cpu>
<clock offset="utc">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
@@ -23,7 +26,7 @@
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
- <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <emulator>/usr/bin/qemu-kvm</emulator>
<disk type="block" device="cdrom">
<driver type="raw"/>
<target dev="hda" bus="ide"/>
diff --git a/tests/virtconv-files/libvirt_output/vmx2libvirt_test1.libvirt b/tests/virtconv-files/libvirt_output/vmx2libvirt_test1.libvirt
index 1ff4eec..a6fc259 100644
--- a/tests/virtconv-files/libvirt_output/vmx2libvirt_test1.libvirt
+++ b/tests/virtconv-files/libvirt_output/vmx2libvirt_test1.libvirt
@@ -1,4 +1,4 @@
-<domain type="qemu">
+<domain type="kvm">
<name>fedora</name>
<uuid>00000000-1111-2222-3333-444444444444</uuid>
<memory>524288</memory>
@@ -13,6 +13,9 @@
<apic/>
<pae/>
</features>
+ <cpu mode="custom" match="exact">
+ <model>core2duo</model>
+ </cpu>
<clock offset="utc">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
@@ -22,7 +25,7 @@
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
- <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <emulator>/usr/bin/qemu-kvm</emulator>
<disk type="file" device="disk">
<driver name="qemu"/>
<source file="/var/lib/libvirt/images/fedora"/>
diff --git a/tests/virtconv-files/libvirt_output/vmx2libvirt_test1.libvirt.disk_raw b/tests/virtconv-files/libvirt_output/vmx2libvirt_test1.libvirt.disk_raw
index 2abd1e2..9c3d6e2 100644
--- a/tests/virtconv-files/libvirt_output/vmx2libvirt_test1.libvirt.disk_raw
+++ b/tests/virtconv-files/libvirt_output/vmx2libvirt_test1.libvirt.disk_raw
@@ -1,4 +1,4 @@
-<domain type="qemu">
+<domain type="kvm">
<name>fedora</name>
<uuid>00000000-1111-2222-3333-444444444444</uuid>
<memory>524288</memory>
@@ -13,6 +13,9 @@
<apic/>
<pae/>
</features>
+ <cpu mode="custom" match="exact">
+ <model>core2duo</model>
+ </cpu>
<clock offset="utc">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
@@ -22,7 +25,7 @@
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
- <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <emulator>/usr/bin/qemu-kvm</emulator>
<disk type="file" device="disk">
<driver name="qemu" type="raw"/>
<source file="/var/lib/libvirt/images/fedora.raw"/>
diff --git a/tests/virtconv-files/libvirt_output/vmx2libvirt_vmx-dir.libvirt b/tests/virtconv-files/libvirt_output/vmx2libvirt_vmx-dir.libvirt
index 7887f36..74f3541 100644
--- a/tests/virtconv-files/libvirt_output/vmx2libvirt_vmx-dir.libvirt
+++ b/tests/virtconv-files/libvirt_output/vmx2libvirt_vmx-dir.libvirt
@@ -1,4 +1,4 @@
-<domain type="qemu">
+<domain type="kvm">
<name>esx4.0-rhel4.8-i386</name>
<uuid>00000000-1111-2222-3333-444444444444</uuid>
<memory>524288</memory>
@@ -14,6 +14,9 @@
<apic/>
<pae/>
</features>
+ <cpu mode="custom" match="exact">
+ <model>core2duo</model>
+ </cpu>
<clock offset="utc">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
@@ -23,7 +26,7 @@
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
- <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <emulator>/usr/bin/qemu-kvm</emulator>
<disk type="block" device="cdrom">
<target dev="hda" bus="ide"/>
<readonly/>
diff --git a/virt-install b/virt-install
index 6453f77..a801952 100755
--- a/virt-install
+++ b/virt-install
@@ -177,7 +177,6 @@ def get_guest(conn, options):
options.container]]) > 1:
fail(_("Can't do more than one of --hvm, --paravirt, or --container"))
- req_accel = True
req_hv_type = options.hv_type and options.hv_type.lower() or None
if options.fullvirt:
req_virt_type = "hvm"
@@ -203,7 +202,6 @@ def get_guest(conn, options):
os_type=req_virt_type,
arch=arch,
typ=req_hv_type,
- accelerated=req_accel,
machine=options.machine)
guest = conn.caps.build_virtinst_guest(conn, capsguest, capsdomain)
guest.os.machine = options.machine
@@ -212,7 +210,6 @@ def get_guest(conn, options):
if (not req_virt_type and
not req_hv_type and
- req_accel and
conn.is_qemu() and
capsguest.arch in ["i686", "x86_64"] and
not capsdomain.is_accelerated()):
diff --git a/virtManager/create.py b/virtManager/create.py
index f1c57b7..2af62c4 100644
--- a/virtManager/create.py
+++ b/virtManager/create.py
@@ -858,9 +858,7 @@ class vmmCreate(vmmGObjectUI):
gtype = "hvm"
break
- (newg, newdom) = self.caps.guest_lookup(os_type=gtype,
- accelerated=True,
- arch=arch)
+ (newg, newdom) = self.caps.guest_lookup(os_type=gtype, arch=arch)
if (self.capsguest and self.capsdomain and
(newg.arch == self.capsguest.arch and
diff --git a/virtinst/capabilities.py b/virtinst/capabilities.py
index c55f67d..b8d3330 100644
--- a/virtinst/capabilities.py
+++ b/virtinst/capabilities.py
@@ -345,18 +345,15 @@ class Guest(object):
child = child.next
- def _favoredDomain(self, accelerated, domains):
+ def _favoredDomain(self, domains):
"""
Return the recommended domain for use if the user does not explicitly
request one.
"""
- if accelerated is None:
- # Picking last in list so we favour KVM/KQEMU over QEMU
- return domains[-1]
+ if not domains:
+ return None
priority = ["kvm", "xen", "kqemu", "qemu"]
- if not accelerated:
- priority.reverse()
for t in priority:
for d in domains:
@@ -366,7 +363,7 @@ class Guest(object):
# Fallback, just return last item in list
return domains[-1]
- def bestDomainType(self, accelerated=None, dtype=None, machine=None):
+ def bestDomainType(self, dtype=None, machine=None):
domains = []
for d in self.domains:
if dtype and d.hypervisor_type != dtype.lower():
@@ -375,22 +372,7 @@ class Guest(object):
continue
domains.append(d)
- if len(domains) == 0:
- domainerr = ""
- machineerr = ""
- if dtype:
- domainerr = _(", domain type '%s'") % dtype
- if machine:
- machineerr = _(", machine type '%s'") % machine
-
- error = (_("No domains available for virt type '%(type)s', "
- "arch '%(arch)s'") %
- {'type': self.os_type, 'arch': self.arch})
- error += domainerr
- error += machineerr
- raise RuntimeError(error)
-
- return self._favoredDomain(accelerated, domains)
+ return self._favoredDomain(domains)
class Domain(object):
@@ -621,7 +603,7 @@ class Capabilities(object):
return True
return False
- def guestForOSType(self, typ=None, arch=None):
+ def _guestForOSType(self, typ=None, arch=None):
if self.host is None:
return None
@@ -652,8 +634,7 @@ class Capabilities(object):
return self._cpu_values.get_arch(arch)
- def guest_lookup(self, os_type=None, arch=None, typ=None,
- accelerated=False, machine=None):
+ def guest_lookup(self, os_type=None, arch=None, typ=None, machine=None):
"""
Simple virtualization availability lookup
@@ -671,20 +652,13 @@ class Capabilities(object):
not found.
@param typ: Virtualization type ('hvm', 'xen', ...)
- @type typ: C{str}
@param arch: Guest architecture ('x86_64', 'i686' ...)
- @type arch: C{str}
@param os_type: Hypervisor name ('qemu', 'kvm', 'xen', ...)
- @type os_type: C{str}
- @param accelerated: Whether to look for accelerated domain if none is
- specifically requested
- @type accelerated: C{bool}
@param machine: Optional machine type to emulate
- @type machine: C{str}
@returns: A (Capabilities Guest, Capabilities Domain) tuple
"""
- guest = self.guestForOSType(os_type, arch)
+ guest = self._guestForOSType(os_type, arch)
if not guest:
archstr = _("for arch '%s'") % arch
if not arch:
@@ -697,12 +671,9 @@ class Capabilities(object):
raise ValueError(_("Host does not support %(virttype)s %(arch)s") %
{'virttype' : osstr, 'arch' : archstr})
- domain = guest.bestDomainType(accelerated=accelerated,
- dtype=typ,
- machine=machine)
-
+ domain = guest.bestDomainType(dtype=typ, machine=machine)
if domain is None:
- machinestr = "with machine '%s'" % machine
+ machinestr = " with machine '%s'" % machine
if not machine:
machinestr = ""
raise ValueError(_("Host does not support domain type %(domain)s"
diff --git a/virtinst/virtimage.py b/virtinst/virtimage.py
index 44c5640..c09428b 100644
--- a/virtinst/virtimage.py
+++ b/virtinst/virtimage.py
@@ -348,13 +348,8 @@ class ImageInstaller(Installer):
self._boot_caps = image.domain.boots[boot_index]
# Set up internal caps.guest object
- self._guest = self.conn.caps.guestForOSType(self.boot_caps.type,
- self.boot_caps.arch)
- if self._guest is None:
- raise RuntimeError(_("Unsupported virtualization type: %s %s" %
- (self.boot_caps.type, self.boot_caps.arch)))
- self._domain = self._guest.bestDomainType()
-
+ self._guest, self._domain = self.conn.caps.guest_lookup(
+ os_type=self.boot_caps.type, arch=self.boot_caps.arch)
# Custom ImageInstaller methods

View File

@ -1,23 +0,0 @@
From 5cfcaad802ec9ab0024297b1e94ce1058e5b629b Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Mon, 17 Feb 2014 11:56:54 -0500
Subject: [PATCH] create: Don't alter caps machine list
(cherry picked from commit 7c516b382cbb94c2ecafb07baedae19b8d1a2b67)
---
virtManager/create.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/virtManager/create.py b/virtManager/create.py
index 2af62c4..b4b1dfe 100644
--- a/virtManager/create.py
+++ b/virtManager/create.py
@@ -689,7 +689,7 @@ class vmmCreate(vmmGObjectUI):
model = lst.get_model()
model.clear()
- machines = self.capsdomain.machines
+ machines = self.capsdomain.machines[:]
if self.capsguest.arch in ["i686", "x86_64"]:
machines = []
machines.sort()

View File

@ -1,44 +0,0 @@
From c7312ce1f5f13d77daf922924cef2f4f7b550e42 Mon Sep 17 00:00:00 2001
From: Martin Kletzander <mkletzan@redhat.com>
Date: Tue, 18 Feb 2014 11:38:56 +0100
Subject: [PATCH] addhardware: generate target only if not customizing
Commit 078e1a4d0503d98884b5b61df83021941bf32e8d changed the fact that
disk target was generated only when adding new disk, not when current
disk is being customized, so fix that back.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
(cherry picked from commit bc5d84b0407257b1e257e7cabaf619430a7e8f83)
---
virtManager/addhardware.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index ecb5fc8..b1f6251 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -1471,20 +1471,22 @@ class vmmAddHardware(vmmGObjectUI):
return disk
try:
+ used = []
disk.bus = bus
if cache:
disk.driver_cache = cache
# Generate target
if not self.is_customize_dialog:
- used = []
disks = (self.vm.get_disk_devices() +
self.vm.get_disk_devices(inactive=True))
for d in disks:
used.append(d.target)
prefer_ctrl = self._set_disk_controller(disk, controller_model, disks)
- disk.generate_target(used, prefer_ctrl)
+
+ if not self.is_customize_dialog:
+ disk.generate_target(used, prefer_ctrl)
except Exception, e:
return self.err.val_err(_("Storage parameter error."), e)

View File

@ -1,29 +0,0 @@
From f6756e8367757301d095dc35fbe477f234ba20d1 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Tue, 25 Feb 2014 14:54:06 -0500
Subject: [PATCH] Don't forbid object names that are only all numbers (bz
1067127)
Just let libvirt error, since in the case of things like storage pools
this is totally legitimate.
(cherry picked from commit 3efbefe91a1ec23cbcf3d4f5a72a02fab87daa83)
---
virtinst/util.py | 4 ----
1 file changed, 4 deletions(-)
diff --git a/virtinst/util.py b/virtinst/util.py
index 31ccd38..2fe00d3 100644
--- a/virtinst/util.py
+++ b/virtinst/util.py
@@ -140,10 +140,6 @@ def validate_uuid(val):
def validate_name(name_type, val):
- if re.match("^[0-9]+$", val):
- raise ValueError(_("%s name can not be only numeric characters") %
- name_type)
-
# Rather than try and match libvirt's regex, just forbid things we
# know don't work
forbid = [" "]

View File

@ -1,69 +0,0 @@
From 74e0b06cb64009b5253e8ed54b1e56f1343cb85c Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Tue, 25 Feb 2014 15:17:34 -0500
Subject: [PATCH] engine: Fix closing connection when tick() fails (bz 1069351)
(cherry picked from commit ce64d037bff56db994fedd065a9a34b8e827dda2)
---
virtManager/engine.py | 39 ++++++++++++++++++++++++---------------
1 file changed, 24 insertions(+), 15 deletions(-)
diff --git a/virtManager/engine.py b/virtManager/engine.py
index cef3d20..0e5e15d 100644
--- a/virtManager/engine.py
+++ b/virtManager/engine.py
@@ -344,30 +344,39 @@ class vmmEngine(vmmGObject):
return 1
def _tick_single_conn(self, conn, kwargs):
+ e = None
try:
conn.tick(**kwargs)
except KeyboardInterrupt:
raise
- except libvirt.libvirtError, e:
- from_remote = getattr(libvirt, "VIR_FROM_REMOTE", None)
- from_rpc = getattr(libvirt, "VIR_FROM_RPC", None)
- sys_error = getattr(libvirt, "VIR_ERR_SYSTEM_ERROR", None)
+ except Exception, e:
+ pass
+
+ if e is None:
+ return
+ from_remote = getattr(libvirt, "VIR_FROM_REMOTE", None)
+ from_rpc = getattr(libvirt, "VIR_FROM_RPC", None)
+ sys_error = getattr(libvirt, "VIR_ERR_SYSTEM_ERROR", None)
+
+ dom = -1
+ code = -1
+ if isinstance(e, libvirt.libvirtError):
dom = e.get_error_domain()
code = e.get_error_code()
- if (dom in [from_remote, from_rpc] and
- code in [sys_error]):
- logging.exception("Could not refresh connection %s",
- conn.get_uri())
- logging.debug("Closing connection since libvirtd "
- "appears to have stopped")
- else:
- error_msg = _("Error polling connection '%s': %s") \
- % (conn.get_uri(), e)
- self.idle_add(lambda: self.err.show_err(error_msg))
+ if (dom in [from_remote, from_rpc] and
+ code in [sys_error]):
+ logging.exception("Could not refresh connection %s",
+ conn.get_uri())
+ logging.debug("Closing connection since libvirtd "
+ "appears to have stopped")
+ else:
+ error_msg = _("Error polling connection '%s': %s") \
+ % (conn.get_uri(), e)
+ self.idle_add(lambda: self.err.show_err(error_msg))
- self.idle_add(conn.close)
+ self.idle_add(conn.close)
def increment_window_counter(self, src):

View File

@ -1,39 +0,0 @@
From 84c1bd12297b366a7187592ca29cc03cb1daf3c5 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Thu, 27 Feb 2014 13:16:21 -0500
Subject: [PATCH] vmm connection: Handle missing storage volumes (bz 1070883)
Similar to what was done in a808bd669293ac66047a716b2e84a5a64c99667b
for the virtinst connection wrapper.
(cherry picked from commit f67df117017e6de855a8c0e900e47fe920dfaa48)
---
virtManager/connection.py | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/virtManager/connection.py b/virtManager/connection.py
index 6f6c838..96dfa1c 100644
--- a/virtManager/connection.py
+++ b/virtManager/connection.py
@@ -172,10 +172,17 @@ class vmmConnection(vmmGObject):
self._backend.cb_fetch_all_pools = (
lambda: [obj.get_xmlobj(refresh_if_nec=False)
for obj in self.pools.values()])
- self._backend.cb_fetch_all_vols = (
- lambda: [obj.get_xmlobj(refresh_if_nec=False)
- for pool in self.pools.values()
- for obj in pool.get_volumes(refresh=False).values()])
+
+ def fetch_all_vols():
+ ret = []
+ for pool in self.pools.values():
+ for vol in pool.get_volumes(refresh=False).values():
+ try:
+ ret.append(vol.get_xmlobj(refresh_if_nec=False))
+ except libvirt.libvirtError, e:
+ logging.debug("Fetching volume XML failed: %s", e)
+ return ret
+ self._backend.cb_fetch_all_vols = fetch_all_vols
def clear_cache(pools=False):
if not pools:

View File

@ -1,25 +0,0 @@
From 4daa270c84825f41583e313b5b64bb10e6eae639 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Fri, 28 Feb 2014 11:46:05 -0500
Subject: [PATCH] console: Fix unsetting 'resize-guest' property from UI
Reported in the followup of bz 754559
(cherry picked from commit 4a2493f1e4bede671eac713081f61965f036d6ed)
---
virtManager/console.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/virtManager/console.py b/virtManager/console.py
index 6ac8abc..5199f5a 100644
--- a/virtManager/console.py
+++ b/virtManager/console.py
@@ -1092,7 +1092,7 @@ class vmmConsolePages(vmmGObjectUI):
def resizeguest_ui_changed_cb(self, src):
# Called from details.py
- if not src.get_active():
+ if not src.get_sensitive():
return
val = int(self.widget("details-menu-view-resizeguest").get_active())

View File

@ -1,40 +0,0 @@
From 732b00a33ef5a3f26b2842fe28dbcea855c1870b Mon Sep 17 00:00:00 2001
From: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
Date: Wed, 5 Mar 2014 10:31:59 +0800
Subject: [PATCH] formats: make sure 'unar' is existed
Commit 0b4a72fd77f74e5a9f6885179febe601156df617
need unar command to do something.
But if we haven't installed it, the error message
told us nothing valuable as:
"OSError: [Errno 2] No such file or directory"
This patch will impove the error message.
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
(cherry picked from commit 98a27fc7fd5622eb498ce9746275a0ecd04ad139)
---
virtconv/formats.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/virtconv/formats.py b/virtconv/formats.py
index 5eb4356..0663190 100644
--- a/virtconv/formats.py
+++ b/virtconv/formats.py
@@ -132,6 +132,15 @@ def _find_input(input_file, parser, print_cb):
prefix="virt-convert-tmp", dir=basedir)
base = os.path.basename(input_file)
+
+ # check if 'unar' command existed.
+ if not find_executable("unar"):
+ raise RuntimeError(_("%s appears to be an archive, "
+ "but 'unar' is not installed. "
+ "Please either install 'unar', or extract the archive "
+ "yourself and point virt-convert at "
+ "the extracted directory.") % base)
+
cmd = ["unar", "-o", tempdir, base]
print_cb(_("%s appears to be an archive, running: %s") %
(base, " ".join(cmd)))

View File

@ -1,35 +0,0 @@
From 71de6fb1d9ae2894b644006135237e8502f68e47 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Thu, 6 Mar 2014 11:31:09 -0500
Subject: [PATCH] details: Fix fallback if fetching CPU models fails (bz
1072704)
(cherry picked from commit b078ba8c3d69b62fe748d9182babef8971914277)
---
virtManager/details.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/virtManager/details.py b/virtManager/details.py
index 72e79da..aa66bdb 100644
--- a/virtManager/details.py
+++ b/virtManager/details.py
@@ -965,8 +965,9 @@ class vmmDetails(vmmGObjectUI):
no_default = not self.is_customize_dialog
try:
- cpu_values = caps.get_cpu_values(self.vm.get_arch())
+ cpu_names = caps.get_cpu_values(self.vm.get_arch()).cpus
except:
+ cpu_names = []
logging.exception("Error populating CPU model list")
# CPU model combo
@@ -987,7 +988,7 @@ class vmmDetails(vmmGObjectUI):
model.append([_("Clear CPU configuration"), "3",
virtinst.CPU.SPECIAL_MODE_CLEAR, False])
model.append([None, None, None, True])
- for name in [c.model for c in cpu_values.cpus]:
+ for name in [c.model for c in cpu_names]:
model.append([name, name, name, False])
# Disk cache combo

View File

@ -1,26 +0,0 @@
From f64c0b37e9cf986b912f6a87b5fa575cd5e616dd Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Thu, 6 Mar 2014 11:45:26 -0500
Subject: [PATCH] fsdetails: Fix adding a filesystem device (bz 1073067)
(cherry picked from commit 9074fc6c6080cf650cf97457dda799700ee2b635)
---
virtManager/fsdetails.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/virtManager/fsdetails.py b/virtManager/fsdetails.py
index b4d991a..cc9fa19 100644
--- a/virtManager/fsdetails.py
+++ b/virtManager/fsdetails.py
@@ -158,8 +158,9 @@ class vmmFSDetails(vmmGObjectUI):
rowindex=0, check_visible=True)
def get_config_fs_readonly(self):
- return uiutil.get_list_selection(self.widget("fs-readonly"),
- rowindex=0, check_visible=True)
+ if not self.widget("fs-readonly").is_visible():
+ return None
+ return self.widget("fs-readonly").get_active()
def get_config_fs_driver(self):
return uiutil.get_list_selection(self.widget("fs-driver-combo"),

View File

@ -1,303 +0,0 @@
From 0e71d70efaa1de17cca2ff7eae8c0d1a6ca99929 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Thu, 6 Mar 2014 12:35:01 -0500
Subject: [PATCH] virt-install: Fix --location iso again, and test it (bz
1071513)
(cherry picked from commit 797afb3b273d08a74119c878b689730f0b36a252)
---
tests/__init__.py | 2 +
.../compare/virt-install-location-iso.xml | 129 +++++++++++++++++++++
tests/cli-test-xml/fake.iso | 0
tests/clitest.py | 1 +
virtinst/distroinstaller.py | 20 ++--
virtinst/urlfetcher.py | 35 +++---
6 files changed, 167 insertions(+), 20 deletions(-)
create mode 100644 tests/cli-test-xml/compare/virt-install-location-iso.xml
create mode 100644 tests/cli-test-xml/fake.iso
diff --git a/tests/__init__.py b/tests/__init__.py
index 1b1c902..8b26f5b 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -21,6 +21,8 @@ import logging
import os
os.environ["VIRTINST_TEST_SUITE"] = "1"
+os.environ["VIRTINST_TEST_URL_DIR"] = os.path.abspath(
+ "tests/cli-test-xml/fakefedoratree/")
import virtinst
virtinst.stable_defaults = False
diff --git a/tests/cli-test-xml/compare/virt-install-location-iso.xml b/tests/cli-test-xml/compare/virt-install-location-iso.xml
new file mode 100644
index 0000000..64ce9e6
--- /dev/null
+++ b/tests/cli-test-xml/compare/virt-install-location-iso.xml
@@ -0,0 +1,129 @@
+<domain type="kvm">
+ <name>foobar</name>
+ <uuid>00000000-1111-2222-3333-444444444444</uuid>
+ <memory>65536</memory>
+ <currentMemory>65536</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch="x86_64">hvm</type>
+ <kernel>./virtinst-vmlinuz.</kernel>
+ <initrd>./virtinst-initrd.img.</initrd>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <cpu mode="custom" match="exact">
+ <model>core2duo</model>
+ </cpu>
+ <clock offset="utc">
+ <timer name="rtc" tickpolicy="catchup"/>
+ <timer name="pit" tickpolicy="delay"/>
+ <timer name="hpet" present="no"/>
+ </clock>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>destroy</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-kvm</emulator>
+ <disk type="file" device="cdrom">
+ <driver name="qemu"/>
+ <source file="/home/crobinso/src/virt-manager/tests/cli-test-xml/fake.iso"/>
+ <target dev="hda" bus="ide"/>
+ <readonly/>
+ </disk>
+ <controller type="usb" index="0" model="ich9-ehci1"/>
+ <controller type="usb" index="0" model="ich9-uhci1">
+ <master startport="0"/>
+ </controller>
+ <controller type="usb" index="0" model="ich9-uhci2">
+ <master startport="2"/>
+ </controller>
+ <controller type="usb" index="0" model="ich9-uhci3">
+ <master startport="4"/>
+ </controller>
+ <interface type="bridge">
+ <source bridge="eth0"/>
+ <mac address="00:11:22:33:44:55"/>
+ <model type="virtio"/>
+ </interface>
+ <input type="tablet" bus="usb"/>
+ <graphics type="spice" port="-1" tlsPort="-1" autoport="yes"/>
+ <console type="pty"/>
+ <channel type="spicevmc">
+ <target type="virtio" name="com.redhat.spice.0"/>
+ </channel>
+ <sound model="ich6"/>
+ <video>
+ <model type="qxl"/>
+ </video>
+ <redirdev bus="usb" type="spicevmc"/>
+ <redirdev bus="usb" type="spicevmc"/>
+ <redirdev bus="usb" type="spicevmc"/>
+ <redirdev bus="usb" type="spicevmc"/>
+ </devices>
+</domain>
+<domain type="kvm">
+ <name>foobar</name>
+ <uuid>00000000-1111-2222-3333-444444444444</uuid>
+ <memory>65536</memory>
+ <currentMemory>65536</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch="x86_64">hvm</type>
+ <boot dev="hd"/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <cpu mode="custom" match="exact">
+ <model>core2duo</model>
+ </cpu>
+ <clock offset="utc">
+ <timer name="rtc" tickpolicy="catchup"/>
+ <timer name="pit" tickpolicy="delay"/>
+ <timer name="hpet" present="no"/>
+ </clock>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-kvm</emulator>
+ <disk type="block" device="cdrom">
+ <target dev="hda" bus="ide"/>
+ <readonly/>
+ </disk>
+ <controller type="usb" index="0" model="ich9-ehci1"/>
+ <controller type="usb" index="0" model="ich9-uhci1">
+ <master startport="0"/>
+ </controller>
+ <controller type="usb" index="0" model="ich9-uhci2">
+ <master startport="2"/>
+ </controller>
+ <controller type="usb" index="0" model="ich9-uhci3">
+ <master startport="4"/>
+ </controller>
+ <interface type="bridge">
+ <source bridge="eth0"/>
+ <mac address="00:11:22:33:44:55"/>
+ <model type="virtio"/>
+ </interface>
+ <input type="tablet" bus="usb"/>
+ <graphics type="spice" port="-1" tlsPort="-1" autoport="yes"/>
+ <console type="pty"/>
+ <channel type="spicevmc">
+ <target type="virtio" name="com.redhat.spice.0"/>
+ </channel>
+ <sound model="ich6"/>
+ <video>
+ <model type="qxl"/>
+ </video>
+ <redirdev bus="usb" type="spicevmc"/>
+ <redirdev bus="usb" type="spicevmc"/>
+ <redirdev bus="usb" type="spicevmc"/>
+ <redirdev bus="usb" type="spicevmc"/>
+ </devices>
+</domain>
diff --git a/tests/cli-test-xml/fake.iso b/tests/cli-test-xml/fake.iso
new file mode 100644
index 0000000..e69de29
diff --git a/tests/clitest.py b/tests/clitest.py
index dd94bd3..32c29c7 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -528,6 +528,7 @@ c.add_compare("--os-variant fedora20 --nodisks --boot fd --graphics sdl --arch s
c.add_compare("--arch armv7l --machine vexpress-a9 --boot kernel=/f19-arm.kernel,initrd=/f19-arm.initrd,dtb=/f19-arm.dtb,extra_args=\"console=ttyAMA0 rw root=/dev/mmcblk0p3\" --disk %(EXISTIMG1)s --nographics", "arm-vexpress-plain", skip_check=support.SUPPORT_CONN_DISK_SD)
c.add_compare("--arch armv7l --machine vexpress-a15 --boot kernel=/f19-arm.kernel,initrd=/f19-arm.initrd,dtb=/f19-arm.dtb,kernel_args=\"console=ttyAMA0 rw root=/dev/vda3\",extra_args=foo --disk %(EXISTIMG1)s --nographics --os-variant fedora19", "arm-vexpress-f19", skip_check=support.SUPPORT_CONN_VIRTIO_MMIO)
c.add_compare("--arch ppc64 --machine pseries --boot network --disk %(EXISTIMG1)s --os-variant fedora20", "ppc64-pseries-f20")
+c.add_compare("--nodisks --location tests/cli-test-xml/fake.iso", "location-iso") # Using --location iso mounting
c.add_valid("--cdrom %(EXISTIMG2)s --file %(EXISTIMG1)s --os-variant win2k3 --wait 0 --sound") # HVM windows install with disk
c.add_valid("--os-variant fedora20 --file %(EXISTIMG1)s --location %(TREEDIR)s --extra-args console=ttyS0 --sound") # F14 Directory tree URL install with extra-args
c.add_invalid("--nodisks --boot network --machine foobar") # Unknown machine type
diff --git a/virtinst/distroinstaller.py b/virtinst/distroinstaller.py
index 13ceb6b..ec63ec3 100644
--- a/virtinst/distroinstaller.py
+++ b/virtinst/distroinstaller.py
@@ -299,11 +299,12 @@ def _upload_media(conn, scratchdir, system_scratchdir,
# Enum of the various install media types we can have
-(MEDIA_LOCATION_PATH,
+(MEDIA_LOCATION_DIR,
+ MEDIA_LOCATION_CDROM,
MEDIA_LOCATION_URL,
MEDIA_CDROM_PATH,
MEDIA_CDROM_URL,
- MEDIA_CDROM_IMPLIED) = range(1, 6)
+ MEDIA_CDROM_IMPLIED) = range(1, 7)
class DistroInstaller(Installer):
@@ -324,7 +325,11 @@ class DistroInstaller(Installer):
if self.location and _is_url(self.conn, self.location):
return self.cdrom and MEDIA_CDROM_URL or MEDIA_LOCATION_URL
- return self.cdrom and MEDIA_CDROM_PATH or MEDIA_LOCATION_PATH
+ if self.cdrom:
+ return MEDIA_CDROM_PATH
+ if self.location and os.path.isdir(self.location):
+ return MEDIA_LOCATION_DIR
+ return MEDIA_LOCATION_CDROM
def _prepare_local(self):
transient = True
@@ -374,7 +379,7 @@ class DistroInstaller(Installer):
def _get_bootdev(self, isinstall, guest):
mediatype = self._get_media_type()
local = mediatype in [MEDIA_CDROM_PATH, MEDIA_CDROM_IMPLIED,
- MEDIA_LOCATION_PATH]
+ MEDIA_LOCATION_DIR, MEDIA_LOCATION_CDROM]
persistent_cd = (local and
self.cdrom and
self.livecd)
@@ -420,9 +425,10 @@ class DistroInstaller(Installer):
return
dev = None
- if mediatype == MEDIA_CDROM_PATH:
+ if mediatype == MEDIA_CDROM_PATH or mediatype == MEDIA_LOCATION_CDROM:
dev = self._prepare_local()
- else:
+
+ if mediatype != MEDIA_CDROM_PATH:
fetcher = urlfetcher.fetcherForURI(self.location,
scratchdir, meter)
try:
@@ -454,7 +460,7 @@ class DistroInstaller(Installer):
mediatype = self._get_media_type()
return mediatype in [MEDIA_CDROM_URL, MEDIA_LOCATION_URL,
- MEDIA_LOCATION_PATH]
+ MEDIA_LOCATION_DIR, MEDIA_LOCATION_CDROM]
def check_location(self, guest):
mediatype = self._get_media_type()
diff --git a/virtinst/urlfetcher.py b/virtinst/urlfetcher.py
index 3c273e3..0d9a066 100644
--- a/virtinst/urlfetcher.py
+++ b/virtinst/urlfetcher.py
@@ -189,10 +189,16 @@ class _MountedImageFetcher(_LocalImageFetcher):
Fetcher capable of extracting files from a NFS server
or loopback mounted file, or local CDROM device
"""
+ _in_test_suite = bool("VIRTINST_TEST_SUITE" in os.environ)
+
def prepareLocation(self):
cmd = None
- self.srcdir = tempfile.mkdtemp(prefix="virtinstmnt.",
- dir=self.scratchdir)
+
+ if self._in_test_suite:
+ self.srcdir = os.environ["VIRTINST_TEST_URL_DIR"]
+ else:
+ self.srcdir = tempfile.mkdtemp(prefix="virtinstmnt.",
+ dir=self.scratchdir)
mountcmd = "/bin/mount"
logging.debug("Preparing mount at " + self.srcdir)
@@ -207,21 +213,24 @@ class _MountedImageFetcher(_LocalImageFetcher):
logging.debug("mount cmd: %s", cmd)
- ret = subprocess.call(cmd)
- if ret != 0:
- self.cleanupLocation()
- raise ValueError(_("Mounting location '%s' failed") %
- (self.location))
+ if not self._in_test_suite:
+ ret = subprocess.call(cmd)
+ if ret != 0:
+ self.cleanupLocation()
+ raise ValueError(_("Mounting location '%s' failed") %
+ (self.location))
return True
def cleanupLocation(self):
logging.debug("Cleaning up mount at " + self.srcdir)
- cmd = ["/bin/umount", self.srcdir]
- subprocess.call(cmd)
- try:
- os.rmdir(self.srcdir)
- except:
- pass
+
+ if not self._in_test_suite:
+ cmd = ["/bin/umount", self.srcdir]
+ subprocess.call(cmd)
+ try:
+ os.rmdir(self.srcdir)
+ except:
+ pass
class _DirectImageFetcher(_LocalImageFetcher):

View File

@ -1,37 +0,0 @@
From 02ad309daaedc409d8ecd5e493a19b06529e5f10 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Thu, 6 Mar 2014 12:04:08 -0500
Subject: [PATCH] Handle libvirt generating invalid volume XML (bz 1072770)
(cherry picked from commit df7012a68b6a13a676e2019523f6863617a110d8)
---
virtManager/connection.py | 2 +-
virtinst/connection.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/virtManager/connection.py b/virtManager/connection.py
index 96dfa1c..57e143d 100644
--- a/virtManager/connection.py
+++ b/virtManager/connection.py
@@ -179,7 +179,7 @@ class vmmConnection(vmmGObject):
for vol in pool.get_volumes(refresh=False).values():
try:
ret.append(vol.get_xmlobj(refresh_if_nec=False))
- except libvirt.libvirtError, e:
+ except Exception, e:
logging.debug("Fetching volume XML failed: %s", e)
return ret
self._backend.cb_fetch_all_vols = fetch_all_vols
diff --git a/virtinst/connection.py b/virtinst/connection.py
index a915f25..3cc5b79 100644
--- a/virtinst/connection.py
+++ b/virtinst/connection.py
@@ -222,7 +222,7 @@ class VirtualConnection(object):
try:
xml = vol.XMLDesc(0)
ret.append(StorageVolume(weakref.ref(self), parsexml=xml))
- except libvirt.libvirtError, e:
+ except Exception, e:
logging.debug("Fetching volume XML failed: %s", e)
if self.cache_object_fetch:

View File

@ -1,31 +0,0 @@
From f65c9dd2d1baccb66e1ac985e50d8cd021e59509 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Tue, 25 Feb 2014 12:45:15 -0500
Subject: [PATCH] xmlbuilder: Log broken XML if we can't parse it
Related to https://bugzilla.redhat.com/show_bug.cgi?id=1066564
(cherry picked from commit 87c2ff1a14f3a78648c8a17cfa72e83098763ec8)
---
virtinst/xmlbuilder.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/virtinst/xmlbuilder.py b/virtinst/xmlbuilder.py
index d46738c..328f6f2 100644
--- a/virtinst/xmlbuilder.py
+++ b/virtinst/xmlbuilder.py
@@ -686,7 +686,13 @@ class _XMLState(object):
else:
if not xml:
xml = self.make_xml_stub()
- doc = libxml2.parseDoc(xml)
+
+ try:
+ doc = libxml2.parseDoc(xml)
+ except:
+ logging.debug("Error parsing xml=\n%s", xml)
+ raise
+
self.xml_root_doc = _DocCleanupWrapper(doc)
self.xml_node = doc.children
self.xml_node.virtinst_is_build = self.is_build

View File

@ -1,22 +0,0 @@
From 8bac5c2dc1b66fb78b82cbd41d385a166073c7c4 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Tue, 25 Feb 2014 14:56:54 -0500
Subject: [PATCH] xmlbuilder: Actually import logging
(cherry picked from commit 0b94c83beb361712c7a6af4dd5da4f6ff1658967)
---
virtinst/xmlbuilder.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/virtinst/xmlbuilder.py b/virtinst/xmlbuilder.py
index 328f6f2..1be1cf9 100644
--- a/virtinst/xmlbuilder.py
+++ b/virtinst/xmlbuilder.py
@@ -20,6 +20,7 @@
# MA 02110-1301 USA.
import copy
+import logging
import os
import re

View File

@ -1,32 +0,0 @@
From d07fba2758c57897c3cb2e39681894090534f04f Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Fri, 7 Mar 2014 09:37:08 -0500
Subject: [PATCH] addhardware: Fix adding disk through 'customize' dialog (bz
1073808)
(cherry picked from commit 7ef9d7fbfc4173b6a6e88b6fb74e895293ffda55)
---
virtManager/addhardware.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index b1f6251..aba6f89 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -1477,13 +1477,15 @@ class vmmAddHardware(vmmGObjectUI):
disk.driver_cache = cache
# Generate target
+ disks = []
if not self.is_customize_dialog:
disks = (self.vm.get_disk_devices() +
self.vm.get_disk_devices(inactive=True))
for d in disks:
used.append(d.target)
- prefer_ctrl = self._set_disk_controller(disk, controller_model, disks)
+ prefer_ctrl = self._set_disk_controller(
+ disk, controller_model, disks)
if not self.is_customize_dialog:
disk.generate_target(used, prefer_ctrl)

View File

@ -1,54 +0,0 @@
From daeba426032fa48dec96ecbc5106113152504eb0 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Mon, 10 Mar 2014 09:33:04 -0400
Subject: [PATCH] connection: Handle errors when deregistering events on close
(bz 1069351)
Otherwise this interrupts the close/cleanup routine, and the connection
never appears to disconnect in the UI. This causes error dialog spamming
when libvirtd goes down.
(cherry picked from commit 081e34715ffa5a210e1e0c8670fe3a1a3ec5180b)
---
virtManager/connection.py | 27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/virtManager/connection.py b/virtManager/connection.py
index 57e143d..4c034b8 100644
--- a/virtManager/connection.py
+++ b/virtManager/connection.py
@@ -929,16 +929,25 @@ class vmmConnection(vmmGObject):
def close(self):
def cleanup(devs):
for dev in devs.values():
- dev.cleanup()
-
- if not self._backend.is_closed():
- if self._domain_cb_id is not None:
- self._backend.domainEventDeregisterAny(self._domain_cb_id)
- self._domain_cb_id = None
+ try:
+ dev.cleanup()
+ except:
+ logging.debug("Failed to cleanup %s", exc_info=True)
- if self._network_cb_id is not None:
- self._backend.networkEventDeregisterAny(self._network_cb_id)
- self._network_cb_id = None
+ try:
+ if not self._backend.is_closed():
+ if self._domain_cb_id is not None:
+ self._backend.domainEventDeregisterAny(
+ self._domain_cb_id)
+ self._domain_cb_id = None
+
+ if self._network_cb_id is not None:
+ self._backend.networkEventDeregisterAny(
+ self._network_cb_id)
+ self._network_cb_id = None
+ except:
+ logging.debug("Failed to deregister events in conn cleanup",
+ exc_info=True)
self._backend.close()
self.record = []

View File

@ -1 +1 @@
8a0585de48d8060a5394aae912342c95 virt-manager-1.0.0.tar.gz 4741c0d93d69cef5f936b2ea2d8348c5 virt-manager-1.0.1.tar.gz

View File

@ -19,8 +19,8 @@
# End local config # End local config
%define _version 1.0.0 %define _version 1.0.1
%define _release 6 %define _release 1
# This macro is used for the continuous automated builds. It just # This macro is used for the continuous automated builds. It just
@ -39,40 +39,6 @@ Group: Applications/Emulators
License: GPLv2+ License: GPLv2+
URL: http://virt-manager.org/ URL: http://virt-manager.org/
Source0: http://virt-manager.org/download/sources/%{name}/%{name}-%{version}.tar.gz Source0: http://virt-manager.org/download/sources/%{name}/%{name}-%{version}.tar.gz
# Fix open connection->lxc
Patch0001: 0001-connect-Fix-connecting-to-lxc-URI.patch
# Fix issues creating ppc64 guests
Patch0002: 0002-create-Fix-non-x86-qemu-kvm-guest-creation.patch
Patch0003: 0003-caps-Simplify-guest-lookup-routines.patch
Patch0004: 0004-create-Don-t-alter-caps-machine-list.patch
# Fix generating disk targets from customize->addhw
Patch0005: 0005-addhardware-generate-target-only-if-not-customizing.patch
# Fix creating storage paths if directory is all digits (bz #1069351)
Patch0006: 0006-Don-t-forbid-object-names-that-are-only-all-numbers-.patch
# Properly close connection if tick fails (bz #1069351)
Patch0007: 0007-engine-Fix-closing-connection-when-tick-fails-bz-106.patch
# virt-manager: Handle unrefreshed storage pools (bz #1070883)
Patch0008: 0008-vmm-connection-Handle-missing-storage-volumes-bz-107.patch
# Fix unsetting 'auto resize' console property
Patch0009: 0009-console-Fix-unsetting-resize-guest-property-from-UI.patch
# virt-convert: better error if unar is not installed
Patch0010: 0010-formats-make-sure-unar-is-existed.patch
# details: Fix fallback if fetching CPU models fails (bz #1072704)
Patch0011: 0011-details-Fix-fallback-if-fetching-CPU-models-fails-bz.patch
# fsdetails: Fix adding a filesystem device (bz #1073067)
Patch0012: 0012-fsdetails-Fix-adding-a-filesystem-device-bz-1073067.patch
# virt-install: Fix --location iso again, and test it (bz #1071513)
Patch0013: 0013-virt-install-Fix-location-iso-again-and-test-it-bz-1.patch
# Handle libvirt generating invalid volume XML (bz #1072770)
Patch0014: 0014-Handle-libvirt-generating-invalid-volume-XML-bz-1072.patch
Patch0015: 0015-xmlbuilder-Log-broken-XML-if-we-can-t-parse-it.patch
Patch0016: 0016-xmlbuilder-Actually-import-logging.patch
# addhardware: Fix adding disk through 'customize' dialog (bz #1073808)
Patch0017: 0017-addhardware-Fix-adding-disk-through-customize-dialog.patch
# connection: Handle errors when deregistering events on close (bz
# #1069351)
Patch0018: 0018-connection-Handle-errors-when-deregistering-events-o.patch
BuildArch: noarch BuildArch: noarch
@ -139,40 +105,6 @@ machine).
%prep %prep
%setup -q %setup -q
# Fix open connection->lxc
%patch0001 -p1
# Fix issues creating ppc64 guests
%patch0002 -p1
%patch0003 -p1
%patch0004 -p1
# Fix generating disk targets from customize->addhw
%patch0005 -p1
# Fix creating storage paths if directory is all digits (bz #1069351)
%patch0006 -p1
# Properly close connection if tick fails (bz #1069351)
%patch0007 -p1
# virt-manager: Handle unrefreshed storage pools (bz #1070883)
%patch0008 -p1
# Fix unsetting 'auto resize' console property
%patch0009 -p1
# virt-convert: better error if unar is not installed
%patch0010 -p1
# details: Fix fallback if fetching CPU models fails (bz #1072704)
%patch0011 -p1
# fsdetails: Fix adding a filesystem device (bz #1073067)
%patch0012 -p1
# virt-install: Fix --location iso again, and test it (bz #1071513)
%patch0013 -p1
# Handle libvirt generating invalid volume XML (bz #1072770)
%patch0014 -p1
%patch0015 -p1
%patch0016 -p1
# addhardware: Fix adding disk through 'customize' dialog (bz #1073808)
%patch0017 -p1
# connection: Handle errors when deregistering events on close (bz
# #1069351)
%patch0018 -p1
%build %build
%if %{qemu_user} %if %{qemu_user}
%define _qemu_user --qemu-user=%{qemu_user} %define _qemu_user --qemu-user=%{qemu_user}
@ -281,6 +213,15 @@ fi
%changelog %changelog
* Sat Mar 22 2014 Cole Robinson <crobinso@redhat.com> - 1.0.1-1
- Rebased to version 1.0.1
- virt-install/virt-xml: New --memorybacking option (Chen Hanxiao)
- virt-install/virt-xml: New --memtune option (Chen Hanxiao)
- virt-manager: UI for LXC <idmap> (Chen Hanxiao)
- virt-manager: gsettings key to disable keygrab (Kjö Hansi Glaz)
- virt-manager: Show domain state reason in the UI (Giuseppe Scrivano)
- Fix a number of bugs found since the 1.0.0 release
* Mon Mar 10 2014 Cole Robinson <crobinso@redhat.com> - 1.0.0-6 * Mon Mar 10 2014 Cole Robinson <crobinso@redhat.com> - 1.0.0-6
- connection: Handle errors when deregistering events on close (bz #1069351) - connection: Handle errors when deregistering events on close (bz #1069351)