- bsc#1140211 - VUL-1: CVE-2019-10183: virt-manager: unattended

option leaks password via command line argument
  58c68764-unattended-Read-the-passwords-from-a-file.patch
  51d28f04-unattended-Dont-log-user-admin-passwords.patch
- Upstream bug fix (bsc#1027942)
  5312a961-virt-install-Revive-wait-0-as-alias-for-noautoconsole.patch

- Update to virt-manager 2.2.0 (fate#326786)
  virt-manager-2.2.0.tar.bz2
  *  libvirt XML viewing and editing UI for new and existing domain, pools, volumes, networks
  *  virt-install: libosinfo –unattended support (Fabiano Fidêncio, Cole Robinson)
  *  Improve CPU model security defaults (Pavel Hrdina)
  *  virt-install: new –install option. Ex: virt-install –install fedora29
  *  virt-install: new –install kernel=,initrd=
  *  virt-install: –disk, –memory, –name defaults from libosinfo (Fabiano Fidêncio, Cole Robinson)
  *  virt-install: add device suboption aliases which consistently match libvirt XML naming
  *  virt-xml: new –start, –no-define options (Marc Hartmayer)
  *  virt-install: Add driver_queues argument to –controller (Vasudeva Kamath)
  *  RISC-V support (Andrea Bolognani)
  *  Device default improvements for non-x86 KVM (Andrea Bolognani)
  *  Redesigned ‘New Network’ wizard
  *  libguestfs inspection improvements (Pino Toscano)
  *  virt-install: Add support for xenbus controller (Jim Fehlig)
  *  cli: Add –disk wwn=,rawio= (Athina Plaskasoviti)
  *  cli: Add –memballoon autodeflate=,stats.period= (Athina Plaskasoviti)
  *  cli: Add –iothreads (Athina Plaskasoviti)
  *  cli: Add –numatune memory.placement (Athina Plaskasoviti)
  *  cli: Add –launchSecurity option (Erik Skultety)
  *  cli: Fill in –memorybacking options
  *  cli: –smartcard: support database= and certificate[0-9]*=

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=476
This commit is contained in:
Charles Arnold 2019-07-03 18:19:42 +00:00 committed by Git OBS Bridge
parent efa2a99cfa
commit 1a980429d2
78 changed files with 818 additions and 2536 deletions

View File

@ -1,67 +0,0 @@
References: jsc#SLE-6262, fate#327048: KVM: Boot Configuration Override (virt-manager)
Subject: cli: refactor get_prop
From: Marc Hartmayer mhartmay@linux.ibm.com Tue Feb 26 10:56:31 2019 +0100
Date: Wed Mar 6 13:13:13 2019 -0500:
Git: adf30349c3a0cb07674bc00a4aa2f8e278c584a6
Refactor get_prop since it will be used in the next patches at other
places as well.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Index: virt-manager-2.1.0/virtinst/cli.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/cli.py
+++ virt-manager-2.1.0/virtinst/cli.py
@@ -22,7 +22,7 @@ import libvirt
from virtcli import CLIConfig
-from . import util
+from . import util, xmlapi
from .devices import (Device, DeviceController, DeviceDisk, DeviceGraphics,
DeviceInterface, DevicePanic)
from .domain import DomainClock, DomainOs
@@ -1223,12 +1223,7 @@ class VirtCLIParser(metaclass=InitClass)
"""
if not cls.propname:
return None
- parent = obj
- pieces = cls.propname.split(".")
- for piece in pieces[:-1]:
- parent = getattr(parent, piece)
-
- return getattr(parent, pieces[-1])
+ return xmlapi.get_prop(obj, cls.propname)
@classmethod
def prop_is_list(cls, obj):
Index: virt-manager-2.1.0/virtinst/xmlapi.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/xmlapi.py
+++ virt-manager-2.1.0/virtinst/xmlapi.py
@@ -11,6 +11,22 @@ from . import util
# pylint: disable=protected-access
+def get_prop(obj, prop_path):
+ """Return value of attribute identified by `prop_path`
+
+ Look up the attribute of `obj` identified by `prop_path`
+ (separated by "."). If any component along the path is missing an
+ `AttributeError` is raised.
+
+ """
+ parent = obj
+ pieces = prop_path.split(".")
+ for piece in pieces[:-1]:
+ parent = getattr(parent, piece)
+
+ return getattr(parent, pieces[-1])
+
+
class _XPathSegment(object):
"""
Class representing a single 'segment' of an xpath string. For example,

View File

@ -1,39 +0,0 @@
References: jsc#SLE-6262, fate#327048: KVM: Boot Configuration Override (virt-manager)
Subject: xmlapi: add set_prop
From: Marc Hartmayer mhartmay@linux.ibm.com Tue Feb 26 10:56:32 2019 +0100
Date: Wed Mar 6 13:13:13 2019 -0500:
Git: 60c7e778e306c66af2690cafea076aba15a2b233
Introduce set_prop helper function. It will be used in the next patch.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
diff --git a/virtinst/xmlapi.py b/virtinst/xmlapi.py
index 569e47f7..49ca0fa3 100644
--- a/virtinst/xmlapi.py
+++ b/virtinst/xmlapi.py
@@ -27,6 +27,22 @@ def get_prop(obj, prop_path):
return getattr(parent, pieces[-1])
+def set_prop(obj, prop_path, value):
+ """Set value of attribute identified by `prop_path`
+
+ Set the attribute of `obj` identified by `prop_path` (separated by
+ ".") to `value`. If any component along the path is missing an
+ `AttributeError` is raised.
+
+ """
+ parent = obj
+ pieces = prop_path.split(".")
+ for piece in pieces[:-1]:
+ parent = getattr(parent, piece)
+
+ return setattr(parent, pieces[-1], value)
+
+
class _XPathSegment(object):
"""
Class representing a single 'segment' of an xpath string. For example,

View File

@ -1,30 +0,0 @@
References: jsc#SLE-6262, fate#327048: KVM: Boot Configuration Override (virt-manager)
Subject: tests: Use (get|set)_prop
From: Marc Hartmayer mhartmay@linux.ibm.com Tue Feb 26 10:56:33 2019 +0100
Date: Wed Mar 6 13:13:13 2019 -0500:
Git: 5bad22e8375f60bb838f7f5e0bbf58d78ffd91ee
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
diff --git a/tests/xmlparse.py b/tests/xmlparse.py
index 709bc48f..df6f022e 100644
--- a/tests/xmlparse.py
+++ b/tests/xmlparse.py
@@ -68,12 +68,12 @@ class XMLParseTest(unittest.TestCase):
Check expected initial value obj.param == initval, then
set newval, and make sure it is returned properly
"""
- curval = getattr(obj, param)
+ curval = virtinst.xmlapi.get_prop(obj, param)
self.assertEqual(initval, curval)
for newval in args:
- setattr(obj, param, newval)
- curval = getattr(obj, param)
+ virtinst.xmlapi.set_prop(obj, param, newval)
+ curval = virtinst.xmlapi.get_prop(obj, param)
self.assertEqual(newval, curval)
def _make_checker(self, obj):

View File

@ -1,45 +0,0 @@
References: jsc#SLE-6262, fate#327048: KVM: Boot Configuration Override (virt-manager)
Subject: support: Add SUPPORT_CONN_DEVICE_BOOT_ORDER
From: Marc Hartmayer mhartmay@linux.ibm.com Tue Feb 26 10:56:34 2019 +0100
Date: Wed Mar 6 13:15:34 2019 -0500:
Git: ee5f3eab4b52e09ae5d0e65ba42c508084f9b6d9
...and use it in domain.py.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Index: virt-manager-2.1.0/virtManager/domain.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/domain.py
+++ virt-manager-2.1.0/virtManager/domain.py
@@ -17,6 +17,7 @@ from virtinst import Guest
from virtinst import util
from virtinst import DeviceController
from virtinst import DeviceDisk
+from virtinst import support
from .libvirtobject import vmmLibvirtObject
from .libvirtenummap import LibvirtEnumMap
@@ -1364,7 +1365,7 @@ class vmmDomain(vmmLibvirtObject):
def can_use_device_boot_order(self):
# Return 'True' if guest can use new style boot device ordering
- return self.conn.is_qemu() or self.conn.is_test()
+ return self.conn.check_support(support.SUPPORT_CONN_DEVICE_BOOT_ORDER)
def get_bootable_devices(self):
# redirdev can also be marked bootable, but it should be rarely
Index: virt-manager-2.1.0/virtinst/support.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/support.py
+++ virt-manager-2.1.0/virtinst/support.py
@@ -266,6 +266,7 @@ SUPPORT_CONN_USB3_PORTS = _make(version=
SUPPORT_CONN_MACHVIRT_PCI_DEFAULT = _make(version="3.0.0")
SUPPORT_CONN_QEMU_XHCI = _make(version="3.3.0", hv_version={"qemu": "2.9.0"})
SUPPORT_CONN_VNC_NONE_AUTH = _make(hv_version={"qemu": "2.9.0"})
+SUPPORT_CONN_DEVICE_BOOT_ORDER = _make(hv_version={"qemu": 0, "test": 0})
# We choose qemu 2.11.0 as the first version to target for q35 default.
# That's not really based on anything except reasonably modern at the

View File

@ -1,80 +0,0 @@
References: jsc#SLE-6262, fate#327048: KVM: Boot Configuration Override (virt-manager)
Subject: cli: Add check if device boot order is supported
From: Marc Hartmayer mhartmay@linux.ibm.com Tue Feb 26 10:56:35 2019 +0100
Date: Wed Mar 6 13:15:38 2019 -0500:
Git: 7768eb17d98352a29f2e5b62035630483d1f3b63
Add a check if device boot order is supported to
Parser(Network|Disk|Redirdev|...) and throw an exception if not.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Index: virt-manager-2.1.0/virtinst/cli.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/cli.py
+++ virt-manager-2.1.0/virtinst/cli.py
@@ -20,6 +20,7 @@ import types
import libvirt
+from virtinst import support
from virtcli import CLIConfig
from . import util, xmlapi
@@ -2154,6 +2155,18 @@ def _add_device_address_args(cls):
cls.add_arg("address.base", "address.base")
+def _add_device_boot_order_arg(cls):
+ def set_boot_order_cb(self, inst, val, virtarg):
+ val = int(val)
+ guest = self.guest
+ if not guest.conn.check_support(support.SUPPORT_CONN_DEVICE_BOOT_ORDER):
+ raise NotImplementedError('Device boot order isn\'t supported by the connection')
+
+ inst.boot.order = val
+ cls.set_boot_order_cb = set_boot_order_cb
+ cls.add_arg("boot.order", "boot_order", cb=cls.set_boot_order_cb)
+
+
##################
# --disk parsing #
##################
@@ -2323,7 +2336,7 @@ class ParserDisk(VirtCLIParser):
cls.add_arg("startup_policy", "startup_policy")
cls.add_arg("read_only", "readonly", is_onoff=True)
cls.add_arg("shareable", "shareable", is_onoff=True)
- cls.add_arg("boot.order", "boot_order")
+ _add_device_boot_order_arg(cls)
cls.add_arg("iotune_rbs", "read_bytes_sec")
cls.add_arg("iotune_wbs", "write_bytes_sec")
@@ -2419,7 +2432,7 @@ class ParserNetwork(VirtCLIParser):
cls.add_arg("model", "model")
cls.add_arg("macaddr", "mac", cb=cls.set_mac_cb)
cls.add_arg("filterref", "filterref")
- cls.add_arg("boot.order", "boot_order")
+ _add_device_boot_order_arg(cls)
cls.add_arg("link_state", "link_state",
cb=cls.set_link_state)
@@ -2637,7 +2650,7 @@ class ParserRedir(VirtCLIParser):
_add_device_address_args(cls)
cls.add_arg("bus", "bus", ignore_default=True)
cls.add_arg("type", "type", ignore_default=True)
- cls.add_arg("boot.order", "boot_order")
+ _add_device_boot_order_arg(cls)
cls.add_arg(None, "server", cb=cls.set_server_cb)
@@ -3048,7 +3061,7 @@ class ParserHostdev(VirtCLIParser):
cb=cls.set_name_cb,
lookup_cb=cls.name_lookup_cb)
cls.add_arg("driver_name", "driver_name")
- cls.add_arg("boot.order", "boot_order")
+ _add_device_boot_order_arg(cls)
cls.add_arg("rom_bar", "rom_bar", is_onoff=True)

View File

@ -1,36 +0,0 @@
References: jsc#SLE-6262, fate#327048: KVM: Boot Configuration Override (virt-manager)
Subject: tests: xmlparse: refactor method for generating out file path
From: Marc Hartmayer mhartmay@linux.ibm.com Tue Feb 26 10:56:36 2019 +0100
Date: Wed Mar 6 13:15:38 2019 -0500:
Git: ecc0861c891263eacba8f63e9aa74797a1e7cba2
Refactor method for generating out file path. It will be used in a
upcoming patch.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
diff --git a/tests/xmlparse.py b/tests/xmlparse.py
index df6f022e..2dbaf24c 100644
--- a/tests/xmlparse.py
+++ b/tests/xmlparse.py
@@ -81,9 +81,17 @@ class XMLParseTest(unittest.TestCase):
return self._set_and_check(obj, name, initval, *args)
return check
+ def _gen_outfile_path(self, basename):
+ """
+ Returns relative path to the file containing the expected XML
+ output
+
+ """
+ return "tests/xmlparse-xml/{!s}-out.xml".format(basename)
+
def _get_test_content(self, basename, kvm=False):
infile = "tests/xmlparse-xml/%s-in.xml" % basename
- outfile = "tests/xmlparse-xml/%s-out.xml" % basename
+ outfile = self._gen_outfile_path(basename)
guest = virtinst.Guest(kvm and self.kvmconn or self.conn,
parsexml=open(infile).read())
return guest, outfile

View File

@ -1,59 +0,0 @@
References: jsc#SLE-6262, fate#327048: KVM: Boot Configuration Override (virt-manager)
Subject: guest: Add reorder_boot_order method
From: Marc Hartmayer mhartmay@linux.ibm.com Tue Feb 26 10:56:37 2019 +0100
Date: Wed Mar 6 13:15:38 2019 -0500:
Git: c9d070da4c3d31c3c504f52dbff775483ebf5e35
Add `reorder_boot_order` method to Guest class. It sets the boot order
of the passed `dev` to `boot_index` and adapts all other boot indices
of the guest accordingly.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Index: virt-manager-2.1.0/virtinst/guest.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/guest.py
+++ virt-manager-2.1.0/virtinst/guest.py
@@ -257,6 +257,40 @@ class Guest(XMLBuilder):
return self.__osinfo
osinfo = property(_get_osinfo)
+ def reorder_boot_order(self, dev, boot_index):
+ """Sets boot order of `dev` to `boot_index`
+
+ Sets the boot order for device `dev` to value `boot_index` and
+ adjusts all other boot indices accordingly. Additionally the
+ boot order defined in the 'os' node of a domain definition is
+ disabled since they are mutually exclusive in libvirt.
+
+ """
+ # unset legacy boot order
+ self.os.bootorder = []
+
+ # Sort the bootable devices by boot order
+ devs_sorted = sorted([device for device in self.get_bootable_devices()
+ if device.boot.order is not None],
+ key=lambda device: device.boot.order)
+
+ # set new boot order
+ dev.boot.order = boot_index
+
+ next_boot_index = None
+ for device in devs_sorted:
+ if device is dev:
+ continue
+
+ if device.boot.order in [next_boot_index, boot_index]:
+ next_boot_index = device.boot.order + 1
+ device.boot.order = next_boot_index
+ continue
+
+ if next_boot_index is not None:
+ # we found a hole so we can stop here
+ break
+
def set_os_name(self, name):
obj = OSDB.lookup_os(name)
if obj is None:

View File

@ -1,305 +0,0 @@
References: jsc#SLE-6262, fate#327048: KVM: Boot Configuration Override (virt-manager)
Subject: tests: Add test case for reorder_boot_order method
From: Marc Hartmayer mhartmay@linux.ibm.com Tue Feb 26 10:56:38 2019 +0100
Date: Wed Mar 6 13:15:38 2019 -0500:
Git: 1b535940028dda1c63e9c1d98a40aa11223a05b2
Add a test case for `reorder_boot_order`. It verifies that the OS boot
order is removed and that all other boot order indices are adjusted
accordingly.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
diff --git a/tests/xmlparse-xml/change-devices-bootorder-fixed-out.xml b/tests/xmlparse-xml/change-devices-bootorder-fixed-out.xml
new file mode 100644
index 00000000..e8fa6975
--- /dev/null
+++ b/tests/xmlparse-xml/change-devices-bootorder-fixed-out.xml
@@ -0,0 +1,71 @@
+<domain type="kvm">
+ <name>TestGuest</name>
+ <metadata>
+ <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
+ <libosinfo:os id="http://fedoraproject.org/fedora/17"/>
+ </libosinfo:libosinfo>
+ </metadata>
+ <currentMemory>204800</currentMemory>
+ <memory>409600</memory>
+ <uuid>12345678-1234-1234-1234-123456789012</uuid>
+ <os>
+ <type arch="i686" machine="foobar">hvm</type>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <hyperv>
+ <vapic state="off"/>
+ <spinlocks state="on" retries="12287"/>
+ </hyperv>
+ <vmport state="off"/>
+ </features>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <on_lockfailure>poweroff</on_lockfailure>
+ <devices>
+ <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
+ <disk type="file" device="floppy">
+ <driver name="qemu" type="qcow2"/>
+ <source file="/dev/default-pool/testvol1.img"/>
+ <target dev="fda" bus="fdc"/>
+ <boot order="1"/>
+ </disk>
+ <disk type="file" device="disk">
+ <driver name="qemu" type="raw"/>
+ <source file="/tmp/test.img"/>
+ <target dev="vda" bus="virtio"/>
+ <boot order="10"/>
+ </disk>
+ <disk type="block" device="disk">
+ <driver name="qemu"/>
+ <source dev="/dev/null"/>
+ <target dev="vdb" bus="virtio"/>
+ <boot order="11"/>
+ </disk>
+ <disk type="block" device="cdrom">
+ <target dev="hdc" bus="ide"/>
+ <readonly/>
+ <boot order="2"/>
+ </disk>
+ <interface type="network">
+ <source network="default"/>
+ <mac address="22:22:33:44:55:66"/>
+ <model type="virtio"/>
+ <boot order="3"/>
+ </interface>
+ <interface type="network">
+ <source network="default"/>
+ <model type="virtio"/>
+ </interface>
+ <controller type="usb" index="0"/>
+ <redirdev bus="usb" type="tcp">
+ <source mode="connect" host="localhost" service="4000"/>
+ <boot order="4"/>
+ </redirdev>
+ <graphics type="vnc" display=":3.4" xauth="/tmp/.Xauthority"/>
+ <console type="pty"/>
+ <memballoon model="virtio"/>
+ </devices>
+</domain>
diff --git a/tests/xmlparse-xml/change-devices-bootorder-in.xml b/tests/xmlparse-xml/change-devices-bootorder-in.xml
new file mode 100644
index 00000000..66dd57a8
--- /dev/null
+++ b/tests/xmlparse-xml/change-devices-bootorder-in.xml
@@ -0,0 +1,71 @@
+<domain type="kvm">
+ <name>TestGuest</name>
+ <metadata>
+ <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
+ <libosinfo:os id="http://fedoraproject.org/fedora/17"/>
+ </libosinfo:libosinfo>
+ </metadata>
+ <currentMemory>204800</currentMemory>
+ <memory>409600</memory>
+ <uuid>12345678-1234-1234-1234-123456789012</uuid>
+ <os>
+ <type arch="i686" machine="foobar">hvm</type>
+ <boot dev="hd"/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <hyperv>
+ <vapic state="off"/>
+ <spinlocks state="on" retries="12287"/>
+ </hyperv>
+ <vmport state="off"/>
+ </features>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <on_lockfailure>poweroff</on_lockfailure>
+ <devices>
+ <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
+ <disk type="file" device="floppy">
+ <driver name="qemu" type="qcow2"/>
+ <source file="/dev/default-pool/testvol1.img"/>
+ <target dev="fda" bus="fdc"/>
+ </disk>
+ <disk type="file" device="disk">
+ <driver name="qemu" type="raw"/>
+ <source file="/tmp/test.img"/>
+ <target dev="vda" bus="virtio"/>
+ <boot order="10"/>
+ </disk>
+ <disk type="block" device="disk">
+ <driver name="qemu"/>
+ <source dev="/dev/null"/>
+ <target dev="vdb" bus="virtio"/>
+ <boot order="10"/>
+ </disk>
+ <disk type="block" device="cdrom">
+ <target dev="hdc" bus="ide"/>
+ <readonly/>
+ <boot order="1"/>
+ </disk>
+ <interface type="network">
+ <source network="default"/>
+ <mac address="22:22:33:44:55:66"/>
+ <model type="virtio"/>
+ <boot order="2"/>
+ </interface>
+ <interface type="network">
+ <source network="default"/>
+ <model type="virtio"/>
+ </interface>
+ <controller type="usb" index="0"/>
+ <redirdev bus="usb" type="tcp">
+ <source mode="connect" host="localhost" service="4000"/>
+ <boot order="3"/>
+ </redirdev>
+ <graphics type="vnc" display=":3.4" xauth="/tmp/.Xauthority"/>
+ <console type="pty"/>
+ <memballoon model="virtio"/>
+ </devices>
+</domain>
diff --git a/tests/xmlparse-xml/change-devices-bootorder-out.xml b/tests/xmlparse-xml/change-devices-bootorder-out.xml
new file mode 100644
index 00000000..f03bc591
--- /dev/null
+++ b/tests/xmlparse-xml/change-devices-bootorder-out.xml
@@ -0,0 +1,71 @@
+<domain type="kvm">
+ <name>TestGuest</name>
+ <metadata>
+ <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
+ <libosinfo:os id="http://fedoraproject.org/fedora/17"/>
+ </libosinfo:libosinfo>
+ </metadata>
+ <currentMemory>204800</currentMemory>
+ <memory>409600</memory>
+ <uuid>12345678-1234-1234-1234-123456789012</uuid>
+ <os>
+ <type arch="i686" machine="foobar">hvm</type>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <hyperv>
+ <vapic state="off"/>
+ <spinlocks state="on" retries="12287"/>
+ </hyperv>
+ <vmport state="off"/>
+ </features>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <on_lockfailure>poweroff</on_lockfailure>
+ <devices>
+ <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
+ <disk type="file" device="floppy">
+ <driver name="qemu" type="qcow2"/>
+ <source file="/dev/default-pool/testvol1.img"/>
+ <target dev="fda" bus="fdc"/>
+ <boot order="1"/>
+ </disk>
+ <disk type="file" device="disk">
+ <driver name="qemu" type="raw"/>
+ <source file="/tmp/test.img"/>
+ <target dev="vda" bus="virtio"/>
+ <boot order="10"/>
+ </disk>
+ <disk type="block" device="disk">
+ <driver name="qemu"/>
+ <source dev="/dev/null"/>
+ <target dev="vdb" bus="virtio"/>
+ <boot order="10"/>
+ </disk>
+ <disk type="block" device="cdrom">
+ <target dev="hdc" bus="ide"/>
+ <readonly/>
+ <boot order="2"/>
+ </disk>
+ <interface type="network">
+ <source network="default"/>
+ <mac address="22:22:33:44:55:66"/>
+ <model type="virtio"/>
+ <boot order="3"/>
+ </interface>
+ <interface type="network">
+ <source network="default"/>
+ <model type="virtio"/>
+ </interface>
+ <controller type="usb" index="0"/>
+ <redirdev bus="usb" type="tcp">
+ <source mode="connect" host="localhost" service="4000"/>
+ <boot order="4"/>
+ </redirdev>
+ <graphics type="vnc" display=":3.4" xauth="/tmp/.Xauthority"/>
+ <console type="pty"/>
+ <memballoon model="virtio"/>
+ </devices>
+</domain>
diff --git a/tests/xmlparse.py b/tests/xmlparse.py
index 2dbaf24c..d12522ab 100644
--- a/tests/xmlparse.py
+++ b/tests/xmlparse.py
@@ -436,6 +436,55 @@ class XMLParseTest(unittest.TestCase):
self._alter_compare(guest.get_xml(), outfile)
+ def testAlterDevicesBootorder(self):
+ basename = "change-devices-bootorder"
+ guest, outfile = self._get_test_content(basename)
+ disk_1 = guest.devices.disk[0]
+ disk_2 = guest.devices.disk[1]
+ disk_3 = guest.devices.disk[2]
+ disk_4 = guest.devices.disk[3]
+ iface_1 = guest.devices.interface[0]
+ iface_2 = guest.devices.interface[1]
+ redirdev_1 = guest.devices.redirdev[0]
+
+ self.assertEqual(guest.os.bootorder, ['hd'])
+ self.assertEqual(disk_1.boot.order, None)
+ self.assertEqual(disk_2.boot.order, 10)
+ self.assertEqual(disk_3.boot.order, 10)
+ self.assertEqual(disk_4.boot.order, 1)
+ self.assertEqual(iface_1.boot.order, 2)
+ self.assertEqual(iface_2.boot.order, None)
+ self.assertEqual(redirdev_1.boot.order, 3)
+
+ guest.reorder_boot_order(disk_1, 1)
+
+ self.assertEqual(guest.os.bootorder, [])
+ self.assertEqual(disk_1.boot.order, 1)
+ self.assertEqual(disk_2.boot.order, 10)
+ self.assertEqual(disk_3.boot.order, 10)
+ # verify that the used algorithm preserves the order of
+ # records with equal boot indices
+ self.assertIs(disk_2, guest.devices.disk[1])
+ self.assertIs(disk_3, guest.devices.disk[2])
+ self.assertEqual(disk_4.boot.order, 2)
+ self.assertEqual(iface_1.boot.order, 3)
+ self.assertEqual(iface_2.boot.order, None)
+ self.assertEqual(redirdev_1.boot.order, 4)
+
+ try:
+ self._alter_compare(guest.get_xml(), outfile)
+ except RuntimeError as error:
+ self.assertIn("unsupported configuration", str(error))
+
+ guest.reorder_boot_order(disk_2, 10)
+ self.assertEqual(disk_2.boot.order, 10)
+ self.assertEqual(disk_3.boot.order, 11)
+ self.assertIs(disk_2, guest.devices.disk[1])
+ self.assertIs(disk_3, guest.devices.disk[2])
+
+ outfile = self._gen_outfile_path("change-devices-bootorder-fixed")
+ self._alter_compare(guest.get_xml(), outfile)
+
def testSingleDisk(self):
xml = ("""<disk type="file" device="disk"><source file="/a.img"/>\n"""
"""<target dev="hda" bus="ide"/></disk>\n""")

View File

@ -1,27 +0,0 @@
References: jsc#SLE-6262, fate#327048: KVM: Boot Configuration Override (virt-manager)
Subject: cli: Use reorder_boot_order for setting the boot order
From: Marc Hartmayer mhartmay@linux.ibm.com Tue Feb 26 10:56:39 2019 +0100
Date: Wed Mar 6 13:15:38 2019 -0500:
Git: b83a0a61a0da867048b232054a41c4c98edbb9d8
Use the newly introduced method `reorder_boot_order` for setting
the boot index of a device. This ensures that all other boot order
values of domain guest definition are adjusted accordingly.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Index: virt-manager-2.1.0/virtinst/cli.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/cli.py
+++ virt-manager-2.1.0/virtinst/cli.py
@@ -2162,7 +2162,7 @@ def _add_device_boot_order_arg(cls):
if not guest.conn.check_support(support.SUPPORT_CONN_DEVICE_BOOT_ORDER):
raise NotImplementedError('Device boot order isn\'t supported by the connection')
- inst.boot.order = val
+ guest.reorder_boot_order(inst, val)
cls.set_boot_order_cb = set_boot_order_cb
cls.add_arg("boot.order", "boot_order", cb=cls.set_boot_order_cb)

View File

@ -1,76 +0,0 @@
References: jsc#SLE-6262, fate#327048: KVM: Boot Configuration Override (virt-manager)
Subject: tests: cli: Add boot.order tests
From: Marc Hartmayer mhartmay@linux.ibm.com Tue Feb 26 10:56:40 2019 +0100
Date: Wed Mar 6 13:15:38 2019 -0500:
Git: c896d19d7645a2728b064d2026610178358220c5
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
diff --git a/tests/cli-test-xml/compare/virt-xml-edit-select-disk-bootorder.xml b/tests/cli-test-xml/compare/virt-xml-edit-select-disk-bootorder.xml
new file mode 100644
index 00000000..60114b99
--- /dev/null
+++ b/tests/cli-test-xml/compare/virt-xml-edit-select-disk-bootorder.xml
@@ -0,0 +1,19 @@
+ <total_iops_sec>50</total_iops_sec>
+ </iotune>
+ <address type="drive" controller="0" bus="0" target="0" unit="0"/>
++ <boot order="1"/>
+ </disk>
+ <disk type="file" device="disk">
+ <driver name="qemu" type="qcow2" cache="none"/>
+@@
+ </source>
+ <target dev="sda" bus="scsi"/>
+ <shareable/>
+- <boot order="1"/>
++ <boot order="2"/>
+ <address type="drive" controller="9" bus="0" target="0" unit="0"/>
+ </disk>
+ <controller type="scsi" index="0"/>
+
+Domain 'test-for-virtxml' defined successfully.
+Changes will take effect after the domain is fully powered off.
\ No newline at end of file
diff --git a/tests/cli-test-xml/compare/virt-xml-edit-select-disk-bootorder2.xml b/tests/cli-test-xml/compare/virt-xml-edit-select-disk-bootorder2.xml
new file mode 100644
index 00000000..0c35cd14
--- /dev/null
+++ b/tests/cli-test-xml/compare/virt-xml-edit-select-disk-bootorder2.xml
@@ -0,0 +1,18 @@
+ <os>
+ <type arch="i686">hvm</type>
+ <loader type="rom">/usr/lib/xen/boot/hvmloader</loader>
+- <boot dev="hd"/>
+ </os>
+ <features>
+ <acpi/>
+@@
+ <source file="/dev/default-pool/collidevol1.img"/>
+ <target dev="hda" bus="ide"/>
+ <address type="drive" controller="0" bus="0" target="0" unit="0"/>
++ <boot order="1"/>
+ </disk>
+ <controller type="ide" index="0"/>
+ <interface type="user">
+
+Domain 'test-collide' defined successfully.
+Changes will take effect after the domain is fully powered off.
\ No newline at end of file
diff --git a/tests/clitest.py b/tests/clitest.py
index a86c15cc..fff4b99f 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -965,6 +965,10 @@ c.add_compare("--edit ich6 --sound pcspk", "edit-select-sound-model", check_vers
c.add_compare("--edit target=hda --disk /dev/null", "edit-select-disk-target")
c.add_compare("--edit /tmp/foobar2 --disk shareable=off,readonly=on", "edit-select-disk-path")
c.add_compare("--edit mac=00:11:7f:33:44:55 --network target=nic55", "edit-select-network-mac")
+c.add_compare("--edit target=hda --disk boot_order=1", "edit-select-disk-bootorder")
+
+c = vixml.add_category("edit selection 2", "test-collide --print-diff --define")
+c.add_compare("--edit target=hda --disk boot_order=1", "edit-select-disk-bootorder2")
c = vixml.add_category("edit clear", "test-for-virtxml --print-diff --define")
c.add_invalid("--edit --memory 200,clearxml=yes") # clear isn't wired up for memory

View File

@ -1,45 +0,0 @@
References: jsc#SLE-6262, fate#327048: KVM: Boot Configuration Override (virt-manager)
Subject: virt-xml: Add --no-define argument
From: Marc Hartmayer mhartmay@linux.ibm.com Tue Feb 26 10:56:41 2019 +0100
Date: Wed Mar 6 13:15:38 2019 -0500:
Git: 29f9f2ac9c168b29043e8a443d354f2b7802c9f9
Add `--no-define` argument. It's mutually exclusive to the `--define`
argument and later on it allows the user to start a domain
transiently.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Index: virt-manager-2.1.0/virt-xml
===================================================================
--- virt-manager-2.1.0.orig/virt-xml
+++ virt-manager-2.1.0/virt-xml
@@ -363,9 +363,13 @@ def parse_args():
"With --add-device, this is a hotplug operation.\n"
"With --remove-device, this is a hotunplug operation.\n"
"With --edit, this is an update device operation."))
- outg.add_argument("--define", action="store_true",
- help=_("Force defining the domain. Only required if a --print "
- "option was specified."))
+ define_g = outg.add_mutually_exclusive_group()
+ define_g.add_argument("--define", action="store_true",
+ help=_("Force defining the domain. Only required if a --print "
+ "option was specified."))
+ define_g.add_argument("--no-define", dest='define', action="store_false",
+ help=_("Force not defining the domain."))
+ define_g.set_defaults(define=None)
outg.add_argument("--print-diff", action="store_true",
help=_("Only print the requested change, in diff format"))
outg.add_argument("--print-xml", action="store_true",
@@ -426,7 +430,8 @@ def main(conn=None):
if not options.define:
options.print_xml = True
else:
- options.define = True
+ if options.define is None:
+ options.define = True
if options.confirm and not options.print_xml:
options.print_diff = True

View File

@ -1,25 +0,0 @@
References: jsc#SLE-6262, fate#327048: KVM: Boot Configuration Override (virt-manager)
Subject: tests: cli: Add test case for --no-define argument
From: Marc Hartmayer mhartmay@linux.ibm.com Tue Feb 26 10:56:42 2019 +0100
Date: Wed Mar 6 13:15:38 2019 -0500:
Git: c2bff50977b83bb1b4bddbfe579735c2fc9d9c65
Add a test case validating mutual exclusivity of `--no-define` and
'--define' arguments.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
diff --git a/tests/clitest.py b/tests/clitest.py
index fff4b99f..b4f41b79 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -902,6 +902,7 @@ c.add_invalid("test-for-virtxml --add-device --host-device 0x04b3:0x4485 --updat
c.add_invalid("test-for-virtxml --remove-device --host-device 1 --update") # test driver doesn't support detachdevice...
c.add_invalid("test-for-virtxml --edit --graphics password=foo --update") # test driver doesn't support updatdevice...
c.add_invalid("--build-xml --memory 10,maxmemory=20") # building XML for option that doesn't support it
+c.add_invalid("test --edit --boot network,cdrom --define --no-define")
c.add_compare("test --print-xml --edit --vcpus 7", "print-xml") # test --print-xml
c.add_compare("--edit --cpu host-passthrough", "stdin-edit", input_file=(XMLDIR + "/virtxml-stdin-edit.xml")) # stdin test
c.add_compare("--build-xml --cpu pentium3,+x2apic", "build-cpu")

View File

@ -1,103 +0,0 @@
References: jsc#SLE-6262, fate#327048: KVM: Boot Configuration Override (virt-manager)
Subject: virt-xml: Add support for starting the domain
From: Marc Hartmayer mhartmay@linux.ibm.com Tue Feb 26 10:56:43 2019 +0100
Date: Wed Mar 6 13:15:38 2019 -0500:
Git: 90b1a3ab7d9cb9c84e7dda7093ae2c97217fa591
Add support for starting the domain. By default, first the domain is
defined and then started. If the `--start` is used in combination with
`--no-define` a transient domain is created without persisting the
changes in the persistent domain definition.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Index: virt-manager-2.1.0/virt-xml
===================================================================
--- virt-manager-2.1.0.orig/virt-xml
+++ virt-manager-2.1.0/virt-xml
@@ -257,9 +257,28 @@ def define_changes(conn, inactive_xmlobj
for dev in devs:
setup_device(dev)
- conn.defineXML(inactive_xmlobj.get_xml())
+ dom = conn.defineXML(inactive_xmlobj.get_xml())
print_stdout(_("Domain '%s' defined successfully.") % inactive_xmlobj.name)
- return True
+ return dom
+
+
+def start_domain_transient(conn, xmlobj, devs, action, confirm):
+ if confirm:
+ if not prompt_yes_or_no(
+ _("Start '%s' with the changed XML?") % xmlobj.name):
+ return False
+
+ if action == "hotplug":
+ for dev in devs:
+ setup_device(dev)
+
+ try:
+ dom = conn.createXML(xmlobj.get_xml())
+ except libvirt.libvirtError as e:
+ fail(_("Failed starting domain '%s': %s") % (xmlobj.name, e))
+ else:
+ print_stdout(_("Domain '%s' started successfully.") % xmlobj.name)
+ return dom
def update_changes(domain, devs, action, confirm):
@@ -370,6 +389,8 @@ def parse_args():
define_g.add_argument("--no-define", dest='define', action="store_false",
help=_("Force not defining the domain."))
define_g.set_defaults(define=None)
+ outg.add_argument("--start", action="store_true",
+ help=_("Start the domain."))
outg.add_argument("--print-diff", action="store_true",
help=_("Only print the requested change, in diff format"))
outg.add_argument("--print-xml", action="store_true",
@@ -411,6 +432,9 @@ def main(conn=None):
options.quiet = False
cli.setupLogging("virt-xml", options.debug, options.quiet)
+ if options.update and options.start:
+ fail(_("Either update or start a domain"))
+
if cli.check_option_introspection(options):
return 0
@@ -468,14 +492,27 @@ def main(conn=None):
else:
logging.warning(
_("The VM is not running, --update is inapplicable."))
- if options.define:
+
+ if options.define or options.start:
devs, action = prepare_changes(inactive_xmlobj, options, parserclass)
- applied = define_changes(conn, inactive_xmlobj,
+ if options.define:
+ dom = define_changes(conn, inactive_xmlobj,
devs, action, options.confirm)
- if not options.update and active_xmlobj and applied:
- print_stdout(
- _("Changes will take effect after the domain is fully powered off."))
- if not options.update and not options.define:
+ if dom and options.start:
+ try:
+ dom.create()
+ except libvirt.libvirtError as e:
+ fail(_("Failed starting domain '%s': %s") % (inactive_xmlobj.name, e))
+ print_stdout(_("Domain '%s' started successfully.") %
+ inactive_xmlobj.name)
+ elif not options.update and active_xmlobj and dom:
+ print_stdout(
+ _("Changes will take effect after the domain is fully powered off."))
+ else:
+ dom = start_domain_transient(conn, inactive_xmlobj, devs,
+ action, options.confirm)
+
+ if not options.update and not options.define and not options.start:
prepare_changes(inactive_xmlobj, options, parserclass)
return 0

View File

@ -1,293 +0,0 @@
References: jsc#SLE-6262, fate#327048: KVM: Boot Configuration Override (virt-manager)
Subject: tests: virt-xml: Add test cases for --start option
From: Marc Hartmayer mhartmay@linux.ibm.com Tue Feb 26 10:56:44 2019 +0100
Date: Wed Mar 6 13:15:38 2019 -0500:
Git: 908b8e8d7c3663ca791b068f2f03234e31281bbc
The test cases verify that:
+ --start works
+ --define --start works
+ --no-define --start works
+ --start works in combination with --add and --remove
+ combination of --start --update isn't valid
+ combination of --define --no-define --start isn't valid
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
diff --git a/tests/cli-test-xml/compare/virt-xml-add-disk-basic-start.xml b/tests/cli-test-xml/compare/virt-xml-add-disk-basic-start.xml
new file mode 100644
index 00000000..0071d9e7
--- /dev/null
+++ b/tests/cli-test-xml/compare/virt-xml-add-disk-basic-start.xml
@@ -0,0 +1,11 @@
+ <model type="cirrus" vram="16384" heads="1" primary="yes"/>
+ </video>
+ <memballoon model="virtio"/>
++ <disk type="file" device="disk">
++ <source file="/dev/default-pool/testvol1.img"/>
++ <target dev="vdf" bus="virtio"/>
++ </disk>
+ </devices>
+ </domain>
+
+Domain 'test-state-shutoff' started successfully.
\ No newline at end of file
diff --git a/tests/cli-test-xml/compare/virt-xml-add-disk-create-storage-start.xml b/tests/cli-test-xml/compare/virt-xml-add-disk-create-storage-start.xml
new file mode 100644
index 00000000..6a02dcc3
--- /dev/null
+++ b/tests/cli-test-xml/compare/virt-xml-add-disk-create-storage-start.xml
@@ -0,0 +1,11 @@
+ <model type="cirrus" vram="16384" heads="1" primary="yes"/>
+ </video>
+ <memballoon model="virtio"/>
++ <disk type="file" device="disk">
++ <source file="/dev/default-pool/new1.img"/>
++ <target dev="hdd" bus="ide"/>
++ </disk>
+ </devices>
+ </domain>
+
+Domain 'test-state-shutoff' started successfully.
\ No newline at end of file
diff --git a/tests/cli-test-xml/compare/virt-xml-add-host-device-start.xml b/tests/cli-test-xml/compare/virt-xml-add-host-device-start.xml
new file mode 100644
index 00000000..b3db5279
--- /dev/null
+++ b/tests/cli-test-xml/compare/virt-xml-add-host-device-start.xml
@@ -0,0 +1,14 @@
+ <model type="cirrus" vram="16384" heads="1" primary="yes"/>
+ </video>
+ <memballoon model="virtio"/>
++ <hostdev mode="subsystem" type="usb" managed="yes">
++ <source>
++ <vendor id="0x04b3"/>
++ <product id="0x4485"/>
++ </source>
++ </hostdev>
+ </devices>
+ </domain>
+
+Domain 'test-state-shutoff' defined successfully.
+Domain 'test-state-shutoff' started successfully.
\ No newline at end of file
diff --git a/tests/cli-test-xml/compare/virt-xml-remove-disk-path-start.xml b/tests/cli-test-xml/compare/virt-xml-remove-disk-path-start.xml
new file mode 100644
index 00000000..e04db8fb
--- /dev/null
+++ b/tests/cli-test-xml/compare/virt-xml-remove-disk-path-start.xml
@@ -0,0 +1,20 @@
+ <on_lockfailure>poweroff</on_lockfailure>
+ <devices>
+ <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
+- <disk type="block" device="disk">
+- <driver name="qemu"/>
+- <source dev="/dev/null"/>
+- <target dev="vda" bus="virtio"/>
+- <boot order="10"/>
+- </disk>
+- <disk type="block" device="disk">
+- <driver name="qemu"/>
+- <source dev="/dev/null"/>
+- <target dev="vdb" bus="virtio"/>
+- <boot order="3"/>
+- </disk>
+ <disk type="block" device="cdrom">
+ <target dev="hdc" bus="ide"/>
+ <readonly/>
+
+Domain 'test-state-shutoff' started successfully.
\ No newline at end of file
diff --git a/tests/cli-test-xml/compare/virt-xml-start-select-disk-bootorder.xml b/tests/cli-test-xml/compare/virt-xml-start-select-disk-bootorder.xml
new file mode 100644
index 00000000..280d9fc5
--- /dev/null
+++ b/tests/cli-test-xml/compare/virt-xml-start-select-disk-bootorder.xml
@@ -0,0 +1,33 @@
+ <driver name="qemu"/>
+ <source dev="/dev/null"/>
+ <target dev="vda" bus="virtio"/>
+- <boot order="10"/>
++ <boot order="1"/>
+ </disk>
+ <disk type="block" device="disk">
+ <driver name="qemu"/>
+ <source dev="/dev/null"/>
+ <target dev="vdb" bus="virtio"/>
+- <boot order="3"/>
++ <boot order="4"/>
+ </disk>
+ <disk type="block" device="cdrom">
+ <target dev="hdc" bus="ide"/>
+ <readonly/>
+- <boot order="1"/>
++ <boot order="2"/>
+ <address type="drive" controller="0" bus="1" target="0" unit="0"/>
+ </disk>
+ <controller type="ide" index="0"/>
+@@
+ <source network="default"/>
+ <target dev="testnet0"/>
+ <model type="virtio"/>
+- <boot order="2"/>
++ <boot order="3"/>
+ </interface>
+ <interface type="network">
+ <mac address="52:54:00:11:fa:28"/>
+
+Domain 'test-state-shutoff' defined successfully.
+Domain 'test-state-shutoff' started successfully.
\ No newline at end of file
diff --git a/tests/cli-test-xml/compare/virt-xml-start-select-disk-bootorder2.xml b/tests/cli-test-xml/compare/virt-xml-start-select-disk-bootorder2.xml
new file mode 100644
index 00000000..1144f4c5
--- /dev/null
+++ b/tests/cli-test-xml/compare/virt-xml-start-select-disk-bootorder2.xml
@@ -0,0 +1,32 @@
+ <driver name="qemu"/>
+ <source dev="/dev/null"/>
+ <target dev="vda" bus="virtio"/>
+- <boot order="10"/>
++ <boot order="1"/>
+ </disk>
+ <disk type="block" device="disk">
+ <driver name="qemu"/>
+ <source dev="/dev/null"/>
+ <target dev="vdb" bus="virtio"/>
+- <boot order="3"/>
++ <boot order="4"/>
+ </disk>
+ <disk type="block" device="cdrom">
+ <target dev="hdc" bus="ide"/>
+ <readonly/>
+- <boot order="1"/>
++ <boot order="2"/>
+ <address type="drive" controller="0" bus="1" target="0" unit="0"/>
+ </disk>
+ <controller type="ide" index="0"/>
+@@
+ <source network="default"/>
+ <target dev="testnet0"/>
+ <model type="virtio"/>
+- <boot order="2"/>
++ <boot order="3"/>
+ </interface>
+ <interface type="network">
+ <mac address="52:54:00:11:fa:28"/>
+
+Domain 'test-state-shutoff' started successfully.
\ No newline at end of file
diff --git a/tests/clitest.py b/tests/clitest.py
index b4f41b79..1c3cd5a5 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -893,6 +893,7 @@ c = vixml.add_category("misc", "")
c.add_valid("--help") # basic --help test
c.add_valid("--sound=? --tpm=?") # basic introspection test
c.add_valid("test-state-shutoff --edit --update --boot menu=on") # --update with inactive VM, should work but warn
+c.add_invalid("test-state-shutoff --edit --update --boot menu=on --start")
c.add_invalid("test --edit --hostdev driver_name=vfio") # Guest has no hostdev to edit
c.add_invalid("test --edit --cpu host-passthrough --boot hd,network") # Specified more than 1 option
c.add_invalid("test --edit") # specified no edit option
@@ -968,6 +969,12 @@ c.add_compare("--edit /tmp/foobar2 --disk shareable=off,readonly=on", "edit-sele
c.add_compare("--edit mac=00:11:7f:33:44:55 --network target=nic55", "edit-select-network-mac")
c.add_compare("--edit target=hda --disk boot_order=1", "edit-select-disk-bootorder")
+c = vixml.add_category("edit and start selection", "test-state-shutoff --print-diff --start")
+c.add_compare("--define --edit target=vda --disk boot_order=1", "start-select-disk-bootorder")
+c.add_invalid("--define --no-define --edit target=vda --disk boot_order=1")
+c.add_compare("--edit target=vda --disk boot_order=1", "start-select-disk-bootorder2")
+c.add_compare("--no-define --edit target=vda --disk boot_order=1", "start-select-disk-bootorder2")
+
c = vixml.add_category("edit selection 2", "test-collide --print-diff --define")
c.add_compare("--edit target=hda --disk boot_order=1", "edit-select-disk-bootorder2")
@@ -995,6 +1002,16 @@ c.add_compare("--remove-device --disk /dev/null", "remove-disk-path")
c.add_compare("--remove-device --video all", "remove-video-all", check_version="1.3.3") # check_version=video primary= attribute
c.add_compare("--remove-device --host-device 0x04b3:0x4485", "remove-hostdev-name", check_version="1.2.11") # check_version=video ram output change
+c = vixml.add_category("add/rm devices and start", "test-state-shutoff --print-diff --start")
+c.add_invalid("--add-device --pm suspend_to_disk=yes") # --add-device without a device
+c.add_invalid("--remove-device --clock utc") # --remove-device without a dev
+# one test in combination with --define
+c.add_compare("--define --add-device --host-device usb_device_4b3_4485_noserial", "add-host-device-start")
+# all other test cases without
+c.add_compare("--add-device --disk %(EXISTIMG1)s,bus=virtio,target=vdf", "add-disk-basic-start")
+c.add_compare("--add-device --disk %(NEWIMG1)s,size=.01", "add-disk-create-storage-start")
+c.add_compare("--remove-device --disk /dev/null", "remove-disk-path-start")
+
c = vixml.add_category("add/rm devices OS KVM", "--connect %(URI-KVM)s test --print-diff --define")
c.add_compare("--add-device --disk %(EXISTIMG1)s", "kvm-add-disk-os-from-xml") # Guest OS (none) from XML
c.add_compare("--add-device --disk %(EXISTIMG1)s --os-variant fedora28", "kvm-add-disk-os-from-cmdline") # Guest OS (fedora) provided on command line
diff --git a/tests/testsuite.xml b/tests/testsuite.xml
index fa0a077f..2e6f0fd6 100644
--- a/tests/testsuite.xml
+++ b/tests/testsuite.xml
@@ -289,6 +289,64 @@
<memory>1048576</memory>
<bootloader>/tmp/bootfoo</bootloader>
<test:runstate>5</test:runstate>
+ <metadata>
+ <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
+ <libosinfo:os id="http://fedoraproject.org/fedora/17"/>
+ </libosinfo:libosinfo>
+ </metadata>
+ <currentMemory>204800</currentMemory>
+ <memory>409600</memory>
+ <uuid>12345678-1234-1234-1234-123456789012</uuid>
+ <os>
+ <type arch="i686" machine="foobar">hvm</type>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <hyperv>
+ <vapic state="off"/>
+ <spinlocks state="on" retries="12287"/>
+ </hyperv>
+ <vmport state="off"/>
+ </features>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <on_lockfailure>poweroff</on_lockfailure>
+ <devices>
+ <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
+ <disk type="block" device="disk">
+ <driver name="qemu"/>
+ <source dev="/dev/null"/>
+ <target dev="vda" bus="virtio"/>
+ <boot order="10"/>
+ </disk>
+ <disk type="block" device="disk">
+ <driver name="qemu"/>
+ <source dev="/dev/null"/>
+ <target dev="vdb" bus="virtio"/>
+ <boot order="3"/>
+ </disk>
+ <disk type="block" device="cdrom">
+ <target dev="hdc" bus="ide"/>
+ <readonly/>
+ <boot order="1"/>
+ </disk>
+ <interface type="network">
+ <source network="default"/>
+ <mac address="22:22:33:44:55:66"/>
+ <model type="virtio"/>
+ <boot order="2"/>
+ </interface>
+ <interface type="network">
+ <source network="default"/>
+ <mac address="52:54:00:11:fa:28"/>
+ <model type="virtio"/>
+ </interface>
+ <graphics type="vnc" display=":3.4" xauth="/tmp/.Xauthority"/>
+ <console type="pty"/>
+ <memballoon model="virtio"/>
+ </devices>
</domain>

View File

@ -0,0 +1,36 @@
Subject: xmleditor: Handle gtksourceview3 as well as gtksourceview4
From: Cole Robinson crobinso@redhat.com Tue Jun 18 09:46:05 2019 -0400
Date: Tue Jun 18 09:54:58 2019 -0400:
Git: 033e97021e6654c9859776dedd9cd0504973f1d6
API differences don't seem to affect our usage
Subject: xmleditor: Fix the gtksource version checking
From: Cole Robinson crobinso@redhat.com Tue Jun 18 10:39:15 2019 -0400
Date: Tue Jun 18 10:50:49 2019 -0400:
Git: 267f226134afb9dfef9091e3da5647441aebabbf
Previous commit was incomplete
--- virt-manager-2.2.0/virtManager/xmleditor.py.orig 2019-06-18 15:40:59.439412915 -0600
+++ virt-manager-2.2.0/virtManager/xmleditor.py 2019-06-18 15:41:15.374797732 -0600
@@ -1,9 +1,18 @@
# This work is licensed under the GNU GPLv2 or later.
# See the COPYING file in the top-level directory.
+# pylint: disable=wrong-import-order,ungrouped-imports
import gi
-gi.require_version('GtkSource', '4')
+from virtinst import log
+
+# We can use either gtksourceview3 or gtksourceview4
+try:
+ gi.require_version("GtkSource", "4")
+ log.debug("Using GtkSource 4")
+except ValueError:
+ gi.require_version("GtkSource", "3.0")
+ log.debug("Using GtkSource 3.0")
from gi.repository import GtkSource
from .lib import uiutil

View File

@ -1,32 +0,0 @@
Subject: inspection: handle failures in application listing
From: Pino Toscano ptoscano@redhat.com Tue Feb 5 18:17:42 2019 +0100
Date: Thu Feb 7 09:59:28 2019 -0500:
Git: 1018ab448484f2e5836fb540d253e813bd8cf6d6
The Python binding of libguestfs errors out in case any of the details
(e.g. summary, description) of an application are not proper UTF-8.
This seems a rare situation, which nevertheless causes the failure of
the inspection of a guest, making the rest of the metadata not used.
While these encoding issues are tackled, and fixed in python-libguestfs
(or libguestfs itself), gracefully handle the failure of
inspect_list_applications(), so at least the rest of the details of a
guest are used/shown.
diff --git a/virtManager/inspection.py b/virtManager/inspection.py
index fde48474..9923dde2 100644
--- a/virtManager/inspection.py
+++ b/virtManager/inspection.py
@@ -275,7 +275,11 @@ class vmmInspection(vmmGObject):
icon = None
# Inspection applications.
- apps = g.inspect_list_applications(root)
+ try:
+ apps = g.inspect_list_applications(root)
+ except Exception:
+ logging.exception("%s: exception while listing apps (ignored)",
+ prettyvm)
# Force the libguestfs handle to close right now.
del g

View File

@ -1,34 +0,0 @@
Subject: support: Fix minimum version check
From: Cole Robinson crobinso@redhat.com Wed Mar 6 13:05:47 2019 -0500
Date: Wed Mar 6 13:06:54 2019 -0500:
Git: 1856c1fa6501c7d37d360377937a82cfa2d1cd20
The original code for this was about version 0.7.3, but a refactor
accidentally changed it to 0.7.9 which is a libvirt version that
doesn't exist. Fix it
diff --git a/virtinst/support.py b/virtinst/support.py
index 0f0f6104..fabcfe7d 100644
--- a/virtinst/support.py
+++ b/virtinst/support.py
@@ -131,7 +131,7 @@ class _SupportCheck(object):
for an 'unsupported' error from libvirt.
@flag: A flag to check exists. This will be appended to the argument
- list if run_args are provided, otherwise we will only check against
+ :list if run_args are provided, otherwise we will only check against
that the flag is present in the python bindings.
@hv_version: A dictionary with hypervisor names for keys, and
@@ -157,9 +157,9 @@ class _SupportCheck(object):
versions = ([self.version] + list(self.hv_libvirt_version.values()))
for vstr in versions:
v = _version_str_to_int(vstr)
- if vstr is not None and v != 0 and v < 7009:
+ if vstr is not None and v != 0 and v < 7003:
raise RuntimeError("programming error: Cannot enforce "
- "support checks for libvirt versions less than 0.7.9, "
+ "support checks for libvirt versions less than 0.7.3, "
"since required APIs were not available. ver=%s" % vstr)
def check_support(self, conn, data):

View File

@ -1,96 +0,0 @@
Subject: virtManager: clone: check which storage pools supports volume cloning
From: Pavel Hrdina phrdina@redhat.com Thu Feb 28 11:47:40 2019 +0100
Date: Mon Mar 4 13:23:45 2019 +0100:
Git: 26a433fc421b7c23e02deb8fe84cdedc21fd8f95
When cloning a guest in virt-manager the GUI shows a list of disks and
select default cloning policy for every disk. For storage pools where
we know that cloning is not possible we should not select that option
as default one.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1463066
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
diff --git a/virtManager/clone.py b/virtManager/clone.py
index 895d258a..4148fca0 100644
--- a/virtManager/clone.py
+++ b/virtManager/clone.py
@@ -64,6 +64,11 @@ def can_we_clone(conn, vol, path):
elif not os.path.exists(path):
msg = _("Path does not exist.")
+ else:
+ pool = vol.get_parent_pool()
+ if not pool.supports_volume_creation(clone=True):
+ msg = _("Cannot clone %s storage pool.") % pool.get_type()
+
if msg:
ret = False
@@ -94,12 +99,8 @@ def do_we_default(conn, vol, path, ro, shared, devtype):
if vol:
pool_type = vol.get_parent_pool().get_type()
- if pool_type == virtinst.StoragePool.TYPE_SCSI:
- info = append_str(info, _("SCSI device"))
- elif pool_type == virtinst.StoragePool.TYPE_DISK:
+ if pool_type == virtinst.StoragePool.TYPE_DISK:
info = append_str(info, _("Disk device"))
- elif pool_type == virtinst.StoragePool.TYPE_ISCSI:
- info = append_str(info, _("iSCSI share"))
if shared:
info = append_str(info, _("Shareable"))
diff --git a/virtManager/storagepool.py b/virtManager/storagepool.py
index bf79b161..d0d26cc2 100644
--- a/virtManager/storagepool.py
+++ b/virtManager/storagepool.py
@@ -238,8 +238,8 @@ class vmmStoragePool(vmmLibvirtObject):
def can_change_alloc(self):
typ = self.get_type()
return (typ in [StoragePool.TYPE_LOGICAL, StoragePool.TYPE_ZFS])
- def supports_volume_creation(self):
- return self.get_xmlobj().supports_volume_creation()
+ def supports_volume_creation(self, clone=False):
+ return self.get_xmlobj().supports_volume_creation(clone=clone)
def get_type(self):
return self.get_xmlobj().type
diff --git a/virtinst/storage.py b/virtinst/storage.py
index 5781e4a7..3249c454 100644
--- a/virtinst/storage.py
+++ b/virtinst/storage.py
@@ -395,13 +395,25 @@ class StoragePool(_StorageObject):
return self.type in users[propname]
return hasattr(self, propname)
- def supports_volume_creation(self):
- return self.type in [
- StoragePool.TYPE_DIR, StoragePool.TYPE_FS,
- StoragePool.TYPE_NETFS, StoragePool.TYPE_LOGICAL,
+ def supports_volume_creation(self, clone=False):
+ """
+ Returns if pool supports volume creation. If @clone is set to True
+ returns if pool supports volume cloning (virVolCreateXMLFrom).
+ """
+ supported = [
+ StoragePool.TYPE_DIR,
+ StoragePool.TYPE_FS,
+ StoragePool.TYPE_NETFS,
StoragePool.TYPE_DISK,
- StoragePool.TYPE_RBD, StoragePool.TYPE_SHEEPDOG,
- StoragePool.TYPE_ZFS]
+ StoragePool.TYPE_LOGICAL,
+ StoragePool.TYPE_RBD,
+ ]
+ if not clone:
+ supported.extend([
+ StoragePool.TYPE_SHEEPDOG,
+ StoragePool.TYPE_ZFS,
+ ])
+ return self.type in supported
def get_disk_type(self):
if (self.type == StoragePool.TYPE_DISK or

View File

@ -1,57 +0,0 @@
Subject: cloner: Handle --nonsparse for qcow2 images (bz 1675743)
From: Cole Robinson crobinso@redhat.com Mon Mar 4 13:20:51 2019 -0500
Date: Mon Mar 4 14:04:34 2019 -0500:
Git: 4f66c423f7833e270b61536d53a0772ce1242abc
https://bugzilla.redhat.com/show_bug.cgi?id=1675743
diff --git a/tests/clone-xml/cross-pool-disks-out.xml b/tests/clone-xml/cross-pool-disks-out.xml
index 260f321c..6093e240 100644
--- a/tests/clone-xml/cross-pool-disks-out.xml
+++ b/tests/clone-xml/cross-pool-disks-out.xml
@@ -1,7 +1,7 @@
<volume>
<name>new1.img</name>
<capacity>1000000</capacity>
- <allocation>50000</allocation>
+ <allocation>1000000</allocation>
<target>
<format type="qcow2"/>
<features>
@@ -12,7 +12,7 @@
<volume>
<name>new2.img</name>
<capacity>1000000</capacity>
- <allocation>50000</allocation>
+ <allocation>1000000</allocation>
<target>
<format type="qcow2"/>
<features>
diff --git a/virtinst/cloner.py b/virtinst/cloner.py
index ba89a26f..b29027e3 100644
--- a/virtinst/cloner.py
+++ b/virtinst/cloner.py
@@ -330,6 +330,8 @@ class Cloner(object):
vol_install.input_vol = orig_disk.get_vol_object()
vol_install.sync_input_vol(only_format=True)
+ if self.clone_sparse:
+ vol_install.allocation = vol_install.capacity
vol_install.reflink = self.reflink
clone_disk.set_vol_install(vol_install)
elif orig_disk.path:
diff --git a/virtinst/storage.py b/virtinst/storage.py
index 3249c454..2e92c5d6 100644
--- a/virtinst/storage.py
+++ b/virtinst/storage.py
@@ -744,6 +744,10 @@ class StorageVolume(_StorageObject):
self.conn.check_support(
self.conn.SUPPORT_POOL_METADATA_PREALLOC, self.pool)):
createflags |= libvirt.VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA
+ if self.capacity == self.allocation:
+ # For cloning, this flag will make libvirt+qemu-img preallocate
+ # the new disk image
+ cloneflags |= libvirt.VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA
if self.reflink:
cloneflags |= getattr(libvirt,

View File

@ -0,0 +1,70 @@
Subject: unattended: Don't log user & admin passwords
From: Fabiano Fidêncio fidencio@redhat.com Wed Jul 3 16:01:29 2019 +0200
Date: Wed Jul 3 13:25:26 2019 -0400:
Git: 51d28f042bcc746444ff017349c1f4cb1301bea5
Logging user & admin passwords in the command-line is a security issue,
let's avoid doing so by:
- Not printing the values set by the user when setting up the
install-script config file;
- Removing the values used in the install-scripts, when printing their
content;
'CVE-2019-10183' has been assigned to the virt-install --unattended
admin-password=xxx disclosure issue.
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
diff --git a/virtinst/install/unattended.py b/virtinst/install/unattended.py
index b01c4d6c..d7ff59a2 100644
--- a/virtinst/install/unattended.py
+++ b/virtinst/install/unattended.py
@@ -97,8 +97,6 @@ def _make_installconfig(script, osobj, unattended_data, arch, hostname, url):
log.debug("InstallScriptConfig created with the following params:")
log.debug("username: %s", config.get_user_login())
log.debug("realname: %s", config.get_user_realname())
- log.debug("user password: %s", config.get_user_password())
- log.debug("admin password: %s", config.get_admin_password())
log.debug("target disk: %s", config.get_target_disk())
log.debug("hardware arch: %s", config.get_hardware_arch())
log.debug("hostname: %s", config.get_hostname())
@@ -187,6 +185,26 @@ class OSInstallScript:
return self._script.generate_command_line(
self._osobj.get_handle(), self._config)
+ def _generate_debug(self):
+ config = Libosinfo.InstallConfig()
+
+ config.set_user_login(self._config.get_user_login())
+ config.set_user_realname(self._config.get_user_realname())
+ config.set_user_password("[SCRUBBLED]")
+ config.set_admin_password("[SCRUBBLED]")
+ config.set_target_disk(self._config.get_target_disk())
+ config.set_hardware_arch(self._config.get_hardware_arch())
+ config.set_hostname(self._config.get_hostname())
+ config.set_l10n_timezone(self._config.get_l10n_timezone())
+ config.set_l10n_language(self._config.get_l10n_language())
+ config.set_l10n_keyboard(self._config.get_l10n_keyboard())
+ if self._config.get_installation_url(): # pylint: disable=no-member
+ config.set_installation_url(self._config.get_installation_url()) # pylint: disable=no-member
+ if self._config.get_reg_product_key():
+ config.set_reg_product_key(self._config.get_reg_product_key())
+
+ return self._script.generate(self._osobj.get_handle(), config)
+
def write(self):
fileobj = tempfile.NamedTemporaryFile(
prefix="virtinst-unattended-script", delete=False)
@@ -195,8 +213,10 @@ class OSInstallScript:
content = self.generate()
open(scriptpath, "w").write(content)
+ debug_content = self._generate_debug()
+
log.debug("Generated unattended script: %s", scriptpath)
- log.debug("Generated script contents:\n%s", content)
+ log.debug("Generated script contents:\n%s", debug_content)
return scriptpath

View File

@ -0,0 +1,54 @@
Subject: virt-install: Revive --wait 0 as alias for --noautoconsole
From: Cole Robinson crobinso@redhat.com Tue Jul 2 15:39:51 2019 -0400
Date: Wed Jul 3 13:12:19 2019 -0400:
Git: 5312a9611b61801d4a62d1959e65cf8d50c38eb1
This was the behavior prior to last release, and we received
a bug report about it. Revive it, but warn about the recommended way
to do it
https://bugzilla.redhat.com/show_bug.cgi?id=1724287
Index: virt-manager-2.2.0/tests/clitest.py
===================================================================
--- virt-manager-2.2.0.orig/tests/clitest.py
+++ virt-manager-2.2.0/tests/clitest.py
@@ -841,10 +841,10 @@ c.add_valid("--hvm --install no_install=
c.add_valid("--hvm --import --prompt --force") # Working scenario w/ prompt shouldn't ask anything
c.add_valid("--paravirt --import") # PV Import install
c.add_valid("--paravirt --print-xml 1") # print single XML, implied import install
+c.add_valid("--hvm --import --wait 0", grep="Treating --wait 0 as --noautoconsole") # --wait 0 is the same as --noautoconsole
c.add_compare("-c %(EXISTIMG2)s --os-variant win2k3 --vcpus cores=4 --controller usb,model=none", "w2k3-cdrom") # HVM windows install with disk
c.add_compare("--connect %(URI-KVM)s --install fedora26 --disk size=20", "osinfo-url-with-disk") # filling in defaults, but with disk specified
c.add_invalid("--hvm --import --wait 2", grep="exceeded specified time limit") # --wait positive number, but test suite hack
-c.add_invalid("--hvm --import --wait 0", grep="exceeded specified time limit") # --wait 0, but test suite hack
c.add_invalid("--hvm --import --wait -1", grep="exceeded specified time limit") # --wait -1, but test suite hack
c.add_invalid("--hvm --import --wait", grep="exceeded specified time limit") # --wait aka --wait -1, but test suite hack
c.add_invalid("--connect test:///default --name foo --ram 64 --disk none --sdl --hvm --import", use_default_args=False, grep="exceeded specified time limit") # --sdl doesn't have a console callback, triggers implicit --wait -1
Index: virt-manager-2.2.0/virt-install
===================================================================
--- virt-manager-2.2.0.orig/virt-install
+++ virt-manager-2.2.0/virt-install
@@ -258,6 +258,14 @@ def convert_old_features(options):
options.features = [",".join(opts)]
+def convert_wait_zero(options):
+ # Historical back compat, --wait 0 is identical to --noautoconsole
+ if options.wait == 0:
+ log.warning("Treating --wait 0 as --noautoconsole")
+ options.autoconsole = False
+ options.wait = None
+
+
##################################
# Install media setup/validation #
##################################
@@ -972,6 +980,7 @@ def main(conn=None):
convert_old_features(options)
convert_old_cpuset(options)
convert_old_init(options)
+ convert_wait_zero(options)
set_test_stub_options(options)
convert_old_os_options(options)

View File

@ -1,24 +0,0 @@
Subject: urldetect: Don't run regex against None SUSE product name
From: Cole Robinson crobinso@redhat.com Mon Jun 10 08:42:39 2019 -0400
Date: Mon Jun 10 08:44:20 2019 -0400:
Git: 578451fe721f8df0cf81c7d510a51af8fbe8179d
We are implicitly depending on random dict ordering for what
order we process Distro matching. Our test suite mocking and
different debian ordering revealed a case we could be trying to
run a regex against None. Fix it. The dict ordering issue will
be fixed separately
Index: virt-manager-2.1.0/virtinst/urldetect.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/urldetect.py
+++ virt-manager-2.1.0/virtinst/urldetect.py
@@ -499,7 +499,7 @@ class _SuseDistro(_RHELDistro):
if not cache.suse_content:
return False
for regex in cls._suse_regex:
- if re.match(regex, cache.suse_content.product_name):
+ if re.match(regex, cache.suse_content.product_name or ""):
return True
return False

View File

@ -1,41 +0,0 @@
Subject: virt-clone: fix force-copy of empty cdrom or floppy disk
From: Pavel Hrdina phrdina@redhat.com Thu Feb 28 17:53:58 2019 +0100
Date: Thu Feb 28 18:05:31 2019 +0100:
Git: 57db41854c86704af331d283810db0d86786825a
There is nothing to copy so don't try to generate new path.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1564863
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Index: virt-manager-2.1.0/tests/clitest.py
===================================================================
--- virt-manager-2.1.0.orig/tests/clitest.py
+++ virt-manager-2.1.0/tests/clitest.py
@@ -1047,6 +1047,7 @@ c.add_invalid("--original-xml " + _CLONE
c.add_invalid("--original-xml " + _CLONE_UNMANAGED + " --file %(NEWCLONEIMG1)s --file %(NEWCLONEIMG2)s --force-copy=hdc") # XML w/ disks, force copy but not enough disks passed
c.add_invalid("--original-xml " + _CLONE_MANAGED + " --file /tmp/clonevol") # XML w/ managed storage, specify unmanaged path (should fail)
c.add_invalid("--original-xml " + _CLONE_NOEXIST + " --file %(EXISTIMG1)s") # XML w/ non-existent storage, WITHOUT --preserve
+c.add_valid("--original-xml " + _CLONE_MANAGED + " --auto-clone --force-copy fda") # force copy empty floppy drive
Index: virt-manager-2.1.0/virt-clone
===================================================================
--- virt-manager-2.1.0.orig/virt-clone
+++ virt-manager-2.1.0/virt-clone
@@ -67,11 +67,10 @@ def get_clone_diskfile(new_diskfiles, de
new_diskfiles.append(None)
newpath = new_diskfiles[newidx]
- if newpath is None and auto_clone:
- newpath = design.generate_clone_disk_path(origpath)
-
if origpath is None:
newpath = None
+ elif newpath is None and auto_clone:
+ newpath = design.generate_clone_disk_path(origpath)
clonepaths.append(newpath)
newidx += 1

View File

@ -0,0 +1,187 @@
Subject: unattended: Read the passwords from a file
From: Fabiano Fidêncio fidencio@redhat.com Wed Jul 3 16:01:28 2019 +0200
Date: Wed Jul 3 13:25:26 2019 -0400:
Git: 58c68764505acd3eedae6d72e6a15493a18029db
Let's not expose the user/root password in the CLI and, instead, let's
rely on a file passed by the admin and read the password from there.
'CVE-2019-10183' has been assigned to the virt-install --unattended
admin-password=xxx disclosure issue.
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Index: virt-manager-2.2.0/man/virt-install.pod
===================================================================
--- virt-manager-2.2.0.orig/man/virt-install.pod
+++ virt-manager-2.2.0/man/virt-install.pod
@@ -612,13 +612,23 @@ Choose which libosinfo unattended profil
a 'desktop' and a 'jeos' profile. virt-install will default to 'desktop'
if this is unspecified.
-=item B<admin-password=>
+=item B<admin-password-file=>
-Set the VM OS admin/root password
-
-=item B<user-password=>
-
-Set the VM user password. The username is your current host username
+A file used to set the VM OS admin/root password from. This option can
+be used either as "admin-password-file=/path/to/password-file" or as
+"admin-password-file=/dev/fd/n", being n the file descriptor of the
+password-file.
+Note that only the first line of the file will be considered, including
+any whitespace characters and excluding new-line.
+
+=item B<user-password-file=>
+
+A file used to set the VM user password. This option can be used either as
+"user-password-file=/path/to/password-file" or as
+"user-password-file=/dev/fd/n", being n the file descriptor of the
+password-file. The username is your current host username.
+Note that only the first line of the file will be considered, including
+any whitespace characters and excluding new-line.
=item B<product-key=>
Index: virt-manager-2.2.0/tests/cli-test-xml/admin-password.txt
===================================================================
--- /dev/null
+++ virt-manager-2.2.0/tests/cli-test-xml/admin-password.txt
@@ -0,0 +1 @@
+foobar
Index: virt-manager-2.2.0/tests/cli-test-xml/user-password.txt
===================================================================
--- /dev/null
+++ virt-manager-2.2.0/tests/cli-test-xml/user-password.txt
@@ -0,0 +1,3 @@
+blah
+
+
Index: virt-manager-2.2.0/tests/clitest.py
===================================================================
--- virt-manager-2.2.0.orig/tests/clitest.py
+++ virt-manager-2.2.0/tests/clitest.py
@@ -89,6 +89,8 @@ test_files = {
'ISO-F29-LIVE': iso_links[5],
'TREEDIR': "%s/fakefedoratree" % XMLDIR,
'COLLIDE': "/dev/default-pool/collidevol1.img",
+ 'ADMIN-PASSWORD-FILE': "%s/admin-password.txt" % XMLDIR,
+ 'USER-PASSWORD-FILE': "%s/user-password.txt" % XMLDIR,
}
@@ -871,22 +873,21 @@ c.add_valid("--connect %s --pxe --disk s
####################
c = vinst.add_category("unattended-install", "--connect %(URI-KVM)s --nographics --noautoconsole --disk none", prerun_check=no_osinfo_unattend_cb)
-c.add_compare("--install fedora26 --unattended profile=desktop,admin-password=foobar,user-password=blah,product-key=1234", "osinfo-url-unattended") # unattended install for fedora, using initrd injection
-c.add_compare("--cdrom %(ISO-WIN7)s --unattended profile=desktop,admin-password=foobar", "osinfo-win7-unattended") # unattended install for win7
-c.add_compare("--os-variant fedora26 --unattended profile=jeos,admin-password=123456 --location %(ISO-F26-NETINST)s", "osinfo-netinst-unattended") # triggering the special netinst checking code
+c.add_compare("--install fedora26 --unattended profile=desktop,admin-password-file=%(ADMIN-PASSWORD-FILE)s,user-password-file=%(USER-PASSWORD-FILE)s,product-key=1234", "osinfo-url-unattended") # unattended install for fedora, using initrd injection
+c.add_compare("--cdrom %(ISO-WIN7)s --unattended profile=desktop,admin-password-file=%(ADMIN-PASSWORD-FILE)s", "osinfo-win7-unattended") # unattended install for win7
+c.add_compare("--os-variant fedora26 --unattended profile=jeos,admin-password-file=%(ADMIN-PASSWORD-FILE)s --location %(ISO-F26-NETINST)s", "osinfo-netinst-unattended") # triggering the special netinst checking code
c.add_compare("--os-variant silverblue29 --location http://example.com", "network-install-resources") # triggering network-install resources override
c.add_valid("--pxe --os-variant fedora26 --unattended", grep="Using unattended profile 'desktop'") # filling in default 'desktop' profile
c.add_invalid("--os-variant fedora26 --unattended profile=jeos --location http://example.foo", grep="admin-password") # will trigger admin-password required error
c.add_invalid("--os-variant fedora26 --unattended profile=jeos --location http://example.foo", grep="admin-password") # will trigger admin-password required error
-c.add_invalid("--os-variant debian9 --unattended profile=desktop,admin-password=foobar --location http://example.foo", grep="user-password") # will trigger user-password required error
-c.add_invalid("--os-variant debian9 --unattended profile=FRIBBER,admin-password=foobar --location http://example.foo", grep="Available profiles") # will trigger unknown profile error
-c.add_invalid("--os-variant fedora29 --unattended profile=desktop,admin-password=foobar --cdrom %(ISO-F29-LIVE)s", grep="media does not support") # live media doesn't support installscript
+c.add_invalid("--os-variant debian9 --unattended profile=desktop,admin-password-file=%(ADMIN-PASSWORD-FILE)s --location http://example.foo", grep="user-password") # will trigger user-password required error
+c.add_invalid("--os-variant debian9 --unattended profile=FRIBBER,admin-password-file=%(ADMIN-PASSWORD-FILE)s --location http://example.foo", grep="Available profiles") # will trigger unknown profile error
+c.add_invalid("--os-variant fedora29 --unattended profile=desktop,admin-password-file=%(ADMIN-PASSWORD-FILE)s --cdrom %(ISO-F29-LIVE)s", grep="media does not support") # live media doesn't support installscript
c.add_invalid("--os-variant msdos --unattended profile=desktop --location http://example.com") # msdos doesn't support unattended install
c.add_invalid("--os-variant winxp --unattended profile=desktop --cdrom %(ISO-WIN7)s") # winxp doesn't support expected injection method 'cdrom'
c.add_invalid("--connect %(URI-TEST-REMOTE)s --os-variant win7 --cdrom %(EXISTIMG1)s --unattended") # --unattended method=cdrom rejected for remote connections
-
#############################
# Remote URI specific tests #
#############################
@@ -1353,7 +1354,7 @@ _add_argcomplete_cmd("virt-install --ins
_add_argcomplete_cmd("virt-install --test-stub", None,
nogrep="--test-stub-command")
_add_argcomplete_cmd("virt-install --unattended ", "profile=") # will list all --unattended subprops
-_add_argcomplete_cmd("virt-install --unattended a", "admin-password=")
+_add_argcomplete_cmd("virt-install --unattended a", "admin-password-file=")
_add_argcomplete_cmd("virt-clone --preserve", "--preserve-data")
_add_argcomplete_cmd("virt-xml --sound mode", "model")
_add_argcomplete_cmd("virt-convert --dest", "--destination")
Index: virt-manager-2.2.0/virtinst/cli.py
===================================================================
--- virt-manager-2.2.0.orig/virtinst/cli.py
+++ virt-manager-2.2.0/virtinst/cli.py
@@ -1508,8 +1508,8 @@ class ParserUnattended(VirtCLIParser):
def _init_class(cls, **kwargs):
VirtCLIParser._init_class(**kwargs)
cls.add_arg("profile", "profile")
- cls.add_arg("admin-password", "admin_password")
- cls.add_arg("user-password", "user_password")
+ cls.add_arg("admin-password-file", "admin_password_file")
+ cls.add_arg("user-password-file", "user_password_file")
cls.add_arg("product-key", "product_key")
Index: virt-manager-2.2.0/virtinst/install/unattended.py
===================================================================
--- virt-manager-2.2.0.orig/virtinst/install/unattended.py
+++ virt-manager-2.2.0/virtinst/install/unattended.py
@@ -39,23 +39,21 @@ def _make_installconfig(script, osobj, u
# Set user-password.
# In case it's required and not passed, just raise a RuntimeError.
- if script.requires_user_password() and not unattended_data.user_password:
+ if (script.requires_user_password() and
+ not unattended_data.get_user_password()):
raise RuntimeError(
_("%s requires the user-password to be set.") %
osobj.name)
- config.set_user_password(
- unattended_data.user_password if unattended_data.user_password
- else "")
+ config.set_user_password(unattended_data.get_user_password() or "")
# Set the admin-password:
# In case it's required and not passed, just raise a RuntimeError.
- if script.requires_admin_password() and not unattended_data.admin_password:
+ if (script.requires_admin_password() and
+ not unattended_data.get_admin_password()):
raise RuntimeError(
_("%s requires the admin-password to be set.") %
osobj.name)
- config.set_admin_password(
- unattended_data.admin_password if unattended_data.admin_password
- else "")
+ config.set_admin_password(unattended_data.get_admin_password() or "")
# Set the target disk.
# virtiodisk is the preferred way, in case it's supported, otherwise
@@ -205,10 +203,22 @@ class OSInstallScript:
class UnattendedData():
profile = None
- admin_password = None
- user_password = None
+ admin_password_file = None
+ user_password_file = None
product_key = None
+ def _get_password(self, pwdfile):
+ with open(pwdfile, "r") as fobj:
+ return fobj.readline().rstrip("\n\r")
+
+ def get_user_password(self):
+ if self.user_password_file:
+ return self._get_password(self.user_password_file)
+
+ def get_admin_password(self):
+ if self.admin_password_file:
+ return self._get_password(self.admin_password_file)
+
def _make_scriptmap(script_list):
"""

View File

@ -1,30 +0,0 @@
Subject: virt-install: Do not warn about consoles on s390x
From: Christian Borntraeger borntraeger@de.ibm.com Thu Mar 14 09:50:11 2019 +0100
Date: Thu Mar 14 18:21:51 2019 +0100:
Git: 5bc847ebb032864bb20859c98660e85b5a0b50f2
s390x guests usually detect the sclp or virtio console. The current
warning might actually break setups. Let us disable the warning.
Reported-by: Andre Wild <wild1@linux.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Index: virt-manager-2.1.0/virt-install
===================================================================
--- virt-manager-2.1.0.orig/virt-install
+++ virt-manager-2.1.0/virt-install
@@ -432,9 +432,9 @@ def _show_nographics_warnings(options, g
console_type = serial_arm_arg
if guest.devices.console[0].target_type in ["virtio", "xen"]:
console_type = hvc_arg
- if guest.os.is_ppc64() or guest.os.is_arm_machvirt():
- # Later arm/ppc kernels figure out console= automatically, so don't
- # warn about it.
+ if guest.os.is_ppc64() or guest.os.is_arm_machvirt() or guest.os.is_s390x():
+ # Later arm/ppc/s390x kernels figure out console= automatically, so
+ # don't warn about it.
return
for args in (options.extra_args or []):

View File

@ -1,27 +0,0 @@
Subject: osdict: Add supports_virtioinput()
From: Andrea Bolognani abologna@redhat.com Wed Mar 20 16:52:34 2019 +0100
Date: Thu Mar 21 15:31:20 2019 +0100:
Git: 708af01c145dcaf5146901d18e22d1da61e09444
We can use this function to figure out whether the guest OS
supports VirtIO input devices (virtio-tablet, virtio-keyboard
and virtio-mouse).
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Index: virt-manager-2.1.0/virtinst/osdict.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/osdict.py
+++ virt-manager-2.1.0/virtinst/osdict.py
@@ -390,6 +390,11 @@ class _OsVariant(object):
# Remove this hack after 6 months or so
return self._is_related_to("rhel6.0")
+ def supports_virtioinput(self):
+ # virtio1.0-input
+ devids = ["http://pcisig.com/pci/1af4/1052"]
+ return bool(self._device_filter(devids=devids))
+
def supports_usb3(self):
# qemu-xhci
devids = ["http://pcisig.com/pci/1b36/0004"]

View File

@ -1,37 +0,0 @@
Subject: urldetect: Check also for 'treeinfo' (bz 1689252)
From: Cole Robinson crobinso@redhat.com Mon Mar 18 14:22:25 2019 -0400
Date: Mon Mar 18 14:24:07 2019 -0400:
Git: 74bbc3db15d5e9a1b4d21c276f7d3f435b83d2fd
Trees published to akamai CDN via Red Hat Satellite can't have .dotfiles
in them. More details here:
https://bugzilla.redhat.com/show_bug.cgi?id=635065
So we also need to check for .treeinfo. Anaconda does this too so it's
a long known issue.
https://bugzilla.redhat.com/show_bug.cgi?id=1689252
diff --git a/virtinst/urldetect.py b/virtinst/urldetect.py
index 3033e6ea..4d301ef3 100644
--- a/virtinst/urldetect.py
+++ b/virtinst/urldetect.py
@@ -48,7 +48,16 @@ class _DistroCache(object):
if self._treeinfo:
return self._treeinfo
- treeinfostr = self.acquire_file_content(".treeinfo")
+ # Vast majority of trees here use .treeinfo. However, trees via
+ # Red Hat satellite on akamai CDN will use treeinfo, because akamai
+ # doesn't do dotfiles apparently:
+ #
+ # https://bugzilla.redhat.com/show_bug.cgi?id=635065
+ #
+ # Anaconda is the canonical treeinfo consumer and they check for both
+ # locations, so we need to do the same
+ treeinfostr = (self.acquire_file_content(".treeinfo") or
+ self.acquire_file_content("treeinfo"))
if treeinfostr is None:
return None

View File

@ -1,53 +0,0 @@
Subject: virt-xml: Handle VM names that look like id/uuid (bz 1679025)
From: Cole Robinson crobinso@redhat.com Thu Mar 21 13:34:52 2019 -0400
Date: Thu Mar 21 13:45:58 2019 -0400:
Git: 7afbb90b4ddfa449e4efc2d57e726d477f96637b
Previously we assume they are id/uuid, so if it's actually the VM
name then the command fails. Now we always check for a name first,
https://bugzilla.redhat.com/show_bug.cgi?id=1679025
Index: virt-manager-2.1.0/tests/clitest.py
===================================================================
--- virt-manager-2.1.0.orig/tests/clitest.py
+++ virt-manager-2.1.0/tests/clitest.py
@@ -910,8 +910,8 @@ c.add_compare("--build-xml --cpu pentium
c.add_compare("--build-xml --tpm /dev/tpm", "build-tpm")
c.add_compare("--build-xml --blkiotune weight=100,device_path=/dev/sdf,device_weight=200", "build-blkiotune")
c.add_compare("--build-xml --idmap uid_start=0,uid_target=1000,uid_count=10,gid_start=0,gid_target=1000,gid_count=10", "build-idmap")
-c.add_compare("test --edit --boot network,cdrom", "edit-bootorder")
-c.add_compare("--confirm test --edit --cpu host-passthrough", "prompt-response")
+c.add_compare("4a64cc71-19c4-2fd0-2323-3050941ea3c3 --edit --boot network,cdrom", "edit-bootorder") # basic bootorder test, also using UUID lookup
+c.add_compare("--confirm 1 --edit --cpu host-passthrough", "prompt-response") # prompt response, also using domid lookup
c.add_compare("--edit --print-diff --qemu-commandline clearxml=yes", "edit-clearxml-qemu-commandline", input_file=(XMLDIR + "/virtxml-qemu-commandline-clear.xml"))
c.add_compare("--connect %(URI-KVM)s test-hyperv-uefi --edit --boot uefi", "hyperv-uefi-collision")
Index: virt-manager-2.1.0/virt-xml
===================================================================
--- virt-manager-2.1.0.orig/virt-xml
+++ virt-manager-2.1.0/virt-xml
@@ -73,12 +73,18 @@ def get_domain_and_guest(conn, domstr):
isuuid = bool(re.match(uuidre, domstr))
try:
- if isint:
- domain = conn.lookupByID(int(domstr))
- elif isuuid:
- domain = conn.lookupByUUIDString(domstr)
- else:
+ domain = None
+ try:
domain = conn.lookupByName(domstr)
+ except Exception:
+ # Incase the VM has a UUID or ID for a name
+ logging.debug("Error looking up domain by name", exc_info=True)
+ if isint:
+ domain = conn.lookupByID(int(domstr))
+ elif isuuid:
+ domain = conn.lookupByUUIDString(domstr)
+ else:
+ raise
except libvirt.libvirtError as e:
fail(_("Could not find domain '%s': %s") % (domstr, e))

View File

@ -1,113 +0,0 @@
Subject: virt-install: Add support for xenbus controller
From: Jim Fehlig jfehlig@suse.com Wed Mar 20 14:24:41 2019 -0600
Date: Thu Mar 21 14:15:40 2019 -0400:
Git: 8d9743d69f5a197d959995552bda380a44e583b4
libvirt commit 09eb1ae0 added support for a new 'xenbus' controller
type. Add support for the controller in virtinst, including support
for the maxGrantFrames attribute.
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Index: virt-manager-2.1.0/tests/cli-test-xml/compare/virt-install-many-devices.xml
===================================================================
--- virt-manager-2.1.0.orig/tests/cli-test-xml/compare/virt-install-many-devices.xml
+++ virt-manager-2.1.0/tests/cli-test-xml/compare/virt-install-many-devices.xml
@@ -184,6 +184,7 @@
<master startport="4"/>
<address type="pci" domain="0" bus="0" slot="4" function="2"/>
</controller>
+ <controller type="xenbus" index="0" maxGrantFrames="64"/>
<filesystem type="mount" accessmode="mapped">
<source dir="/source"/>
<target dir="/target"/>
Index: virt-manager-2.1.0/tests/cli-test-xml/compare/virt-install-xen-pv.xml
===================================================================
--- virt-manager-2.1.0.orig/tests/cli-test-xml/compare/virt-install-xen-pv.xml
+++ virt-manager-2.1.0/tests/cli-test-xml/compare/virt-install-xen-pv.xml
@@ -22,6 +22,7 @@
<source file="/dev/default-pool/testvol1.img"/>
<target dev="xvda" bus="xen"/>
</disk>
+ <controller type="xenbus" index="0" maxGrantFrames="64"/>
<interface type="bridge">
<source bridge="eth0"/>
<mac address="00:11:22:33:44:55"/>
@@ -51,6 +52,7 @@
<source file="/dev/default-pool/testvol1.img"/>
<target dev="xvda" bus="xen"/>
</disk>
+ <controller type="xenbus" index="0" maxGrantFrames="64"/>
<interface type="bridge">
<source bridge="eth0"/>
<mac address="00:11:22:33:44:55"/>
Index: virt-manager-2.1.0/tests/clitest.py
===================================================================
--- virt-manager-2.1.0.orig/tests/clitest.py
+++ virt-manager-2.1.0/tests/clitest.py
@@ -509,6 +509,7 @@ c.add_compare(""" \
--controller usb,model=ich9-uhci1,address=0:0:4.0,index=0,master=0,address.multifunction=on \
--controller usb,model=ich9-uhci2,address=0:0:4.1,index=0,master=2 \
--controller usb,model=ich9-uhci3,address=0:0:4.2,index=0,master=4 \
+--controller xenbus,maxGrantFrames=64 \
\
--input type=keyboard,bus=usb \
--input tablet \
@@ -824,7 +825,7 @@ c.add_compare("--init /usr/bin/httpd", "
c = vinst.add_category("xen", "--noautoconsole --connect " + utils.URIs.xen)
c.add_valid("--disk %(EXISTIMG1)s --location %(TREEDIR)s --paravirt --graphics none") # Xen PV install headless
c.add_compare("--disk %(EXISTIMG1)s --import", "xen-default") # Xen default
-c.add_compare("--disk %(EXISTIMG1)s --location %(TREEDIR)s --paravirt", "xen-pv") # Xen PV
+c.add_compare("--disk %(EXISTIMG1)s --location %(TREEDIR)s --paravirt --controller xenbus,maxGrantFrames=64", "xen-pv") # Xen PV
c.add_compare("--disk /iscsi-pool/diskvol1 --cdrom %(EXISTIMG1)s --livecd --hvm", "xen-hvm") # Xen HVM
Index: virt-manager-2.1.0/virtinst/cli.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/cli.py
+++ virt-manager-2.1.0/virtinst/cli.py
@@ -2438,6 +2438,7 @@ class ParserNetwork(VirtCLIParser):
cls.add_arg("driver_name", "driver_name")
cls.add_arg("driver_queues", "driver_queues")
+ cls.add_arg("maxGrantFrames", "maxGrantFrames")
cls.add_arg("rom_file", "rom_file")
cls.add_arg("rom_bar", "rom_bar", is_onoff=True)
Index: virt-manager-2.1.0/virtinst/devices/controller.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/devices/controller.py
+++ virt-manager-2.1.0/virtinst/devices/controller.py
@@ -19,6 +19,7 @@ class DeviceController(Device):
TYPE_USB = "usb"
TYPE_PCI = "pci"
TYPE_CCID = "ccid"
+ TYPE_XENBUS = "xenbus"
@staticmethod
def get_recommended_types(_guest):
@@ -38,6 +39,7 @@ class DeviceController(Device):
DeviceController.TYPE_USB: "USB",
DeviceController.TYPE_PCI: "PCI",
DeviceController.TYPE_CCID: "CCID",
+ DeviceController.TYPE_XENBUS: "xenbus",
}
if ctype not in pretty_mappings:
@@ -86,13 +88,14 @@ class DeviceController(Device):
return ctrl
- _XML_PROP_ORDER = ["type", "index", "model", "master_startport"]
+ _XML_PROP_ORDER = ["type", "index", "model", "master_startport", "maxGrantFrames"]
type = XMLProperty("./@type")
model = XMLProperty("./@model")
vectors = XMLProperty("./@vectors", is_int=True)
ports = XMLProperty("./@ports", is_int=True)
master_startport = XMLProperty("./master/@startport", is_int=True)
+ maxGrantFrames = XMLProperty("./@maxGrantFrames", is_int=True)
index = XMLProperty("./@index", is_int=True)

View File

@ -1,63 +0,0 @@
Subject: virtManager: clone: build default clone path if we know how
From: Pavel Hrdina phrdina@redhat.com Tue Mar 5 10:16:06 2019 +0100
Date: Wed Mar 6 17:19:00 2019 +0100:
Git: a02fc0d02272ade8aea851be4e0f7c7ec38de2fe
Function do_we_default returns only if we want to default to clone disk
even if we know how to create default clone path. Only in case that the
storage pool is TYPE_DISK we don't know how to create default path and
we cannot default to clone that disk. In all other cases as ReadOnly
disk or Shareable and so on we can prepare the default path for user if
they decide to clone it.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1565106
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
diff --git a/virtManager/clone.py b/virtManager/clone.py
index 4148fca0..1adc59c9 100644
--- a/virtManager/clone.py
+++ b/virtManager/clone.py
@@ -79,6 +79,7 @@ def do_we_default(conn, vol, path, ro, shared, devtype):
""" Returns (do we clone by default?, info string if not)"""
ignore = conn
info = ""
+ can_default = True
def append_str(str1, str2, delim=", "):
if not str2:
@@ -101,11 +102,12 @@ def do_we_default(conn, vol, path, ro, shared, devtype):
pool_type = vol.get_parent_pool().get_type()
if pool_type == virtinst.StoragePool.TYPE_DISK:
info = append_str(info, _("Disk device"))
+ can_default = False
if shared:
info = append_str(info, _("Shareable"))
- return (not info, info)
+ return (not info, info, can_default)
class vmmCloneVM(vmmGObjectUI):
@@ -390,8 +392,8 @@ class vmmCloneVM(vmmGObjectUI):
skip_targets.remove(force_target)
vol = self.conn.get_vol_by_path(path)
- default, definfo = do_we_default(self.conn, vol, path, ro, shared,
- devtype)
+ default, definfo, can_default = do_we_default(self.conn, vol, path,
+ ro, shared, devtype)
def storage_add(failinfo=None):
# pylint: disable=cell-var-from-loop
@@ -426,7 +428,7 @@ class vmmCloneVM(vmmGObjectUI):
storage_row[STORAGE_INFO_CAN_CLONE] = True
# If we cannot create default clone_path don't even try to do that
- if not default:
+ if not can_default:
storage_add()
continue

View File

@ -1,31 +0,0 @@
Subject: cli: Fix pool=default when path belongs to another pool (bz 1692489)
From: Cole Robinson crobinso@redhat.com Tue Mar 26 10:44:58 2019 -0400
Date: Tue Mar 26 11:15:46 2019 -0400:
Git: a0ca387aad0fde19683aa8b5b5636add6455b8b4
Using 'virt-install --disk size=X' implicitly uses pool=default. If
a pool named 'default' exists we use that; if not, and a pool using
the default path exists under a different name, we attempt to use
that as well, and if that doesn't exist, we create pool=default
The second case is broken, so if there's no pool=default and eg.
pool=FOO points to /var/lib/libvirt/images, we still attempt to
look up pool=default which understandably fails
https://bugzilla.redhat.com/show_bug.cgi?id=1692489
Index: virt-manager-2.1.0/virtinst/cli.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/cli.py
+++ virt-manager-2.1.0/virtinst/cli.py
@@ -2271,7 +2271,9 @@ class ParserDisk(VirtCLIParser):
poolobj = None
if poolname:
if poolname == "default":
- StoragePool.build_default_pool(self.guest.conn)
+ poolxml = StoragePool.build_default_pool(self.guest.conn)
+ if poolxml:
+ poolname = poolxml.name
poolobj = self.guest.conn.storagePoolLookupByName(poolname)
if volname:

View File

@ -1,30 +0,0 @@
Subject: engine: Fix first run startup error (bz 1674040)
From: Cole Robinson crobinso@redhat.com Fri Feb 8 15:50:15 2019 -0500
Date: Fri Feb 8 15:50:15 2019 -0500:
Git: ae8a4f3db3c1492a219a0d6ec8d32c765ac076bd
unitpath can be used uninitialized
https://bugzilla.redhat.com/show_bug.cgi?id=1674040
diff --git a/virtManager/engine.py b/virtManager/engine.py
index bf422b36..492c67db 100644
--- a/virtManager/engine.py
+++ b/virtManager/engine.py
@@ -135,6 +135,7 @@ class vmmEngine(vmmGObject):
unitname = "libvirtd.service"
libvirtd_installed = False
libvirtd_active = False
+ unitpath = None
# Fetch all units from systemd
try:
@@ -165,7 +166,7 @@ class vmmEngine(vmmGObject):
# If it's not running, try to start it
try:
- if units and libvirtd_installed and not libvirtd_active:
+ if unitpath and libvirtd_installed and not libvirtd_active:
unit = Gio.DBusProxy.new_sync(
bus, 0, None,
"org.freedesktop.systemd1", unitpath,

View File

@ -1,43 +0,0 @@
Subject: guest: Add VirtIO input devices to s390x guests with graphics
From: Andrea Bolognani abologna@redhat.com Wed Mar 20 16:52:35 2019 +0100
Date: Thu Mar 21 15:31:20 2019 +0100:
Git: f23b01be53aa8b5b8d91aadbfb0c06268fa5c7b9
We're not including any input devices in the generated XML
for s390x guests, and the results is that it's not possible
to interact with them short of using the serial console or
connecting through ssh, which is fine but probably not what
is expected when graphics are present.
USB input devices are not a good fit for s390x guests: USB
requires PCI, and PCI is not widely available or used on
s390x; VirtIO devices, on the other hand, are a perfect
match since s390x guests use basically no emulated devices
and rely on VirtIO for most functionality.
https://bugzilla.redhat.com/show_bug.cgi?id=1683609
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Index: virt-manager-2.1.0/virtinst/guest.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/guest.py
+++ virt-manager-2.1.0/virtinst/guest.py
@@ -622,6 +622,17 @@ class Guest(XMLBuilder):
dev.bus = "usb"
self.add_device(dev)
+ # s390x guests need VirtIO input devices
+ if self.os.is_s390x() and self.osinfo.supports_virtioinput():
+ dev = DeviceInput(self.conn)
+ dev.type = "tablet"
+ dev.bus = "virtio"
+ self.add_device(dev)
+ dev = DeviceInput(self.conn)
+ dev.type = "keyboard"
+ dev.bus = "virtio"
+ self.add_device(dev)
+
def _add_default_console_device(self):
if self.skip_default_console:
return

View File

@ -1,19 +0,0 @@
Subject: addhardware: Fix setting optimal default net model
From: Cole Robinson crobinso@redhat.com Sun Feb 3 19:47:20 2019 -0500
Date: Sun Feb 3 19:47:54 2019 -0500:
Git: f7508d024d58e54f9da5e7c51f5b805db929b76f
We were unconditionally reseting it to the first list entry
diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index eaab8275..69161782 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -327,7 +327,6 @@ class vmmAddHardware(vmmGObjectUI):
netmodel = self.widget("net-model")
self.populate_network_model_combo(self.vm, netmodel)
- netmodel.set_active(0)
# Char parameters

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4bbf6360887996686ddb6592287bc8a78d3d67b4bcabe9e777f900f61d44261e
size 1469024

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f32bd91e7a42a2ba2f66d5f6f72ec3342bb12606c5612750c6165544128d2db5
size 1482123

View File

@ -1,3 +1,79 @@
-------------------------------------------------------------------
Wed Jul 3 12:07:53 MDT 2019 - carnold@suse.com
- bsc#1140211 - VUL-1: CVE-2019-10183: virt-manager: unattended
option leaks password via command line argument
58c68764-unattended-Read-the-passwords-from-a-file.patch
51d28f04-unattended-Dont-log-user-admin-passwords.patch
- Upstream bug fix (bsc#1027942)
5312a961-virt-install-Revive-wait-0-as-alias-for-noautoconsole.patch
-------------------------------------------------------------------
Mon Jun 17 13:09:29 MDT 2019 - carnold@suse.com
- Update to virt-manager 2.2.0 (fate#326786)
virt-manager-2.2.0.tar.bz2
* libvirt XML viewing and editing UI for new and existing domain, pools, volumes, networks
* virt-install: libosinfo unattended support (Fabiano Fidêncio, Cole Robinson)
* Improve CPU model security defaults (Pavel Hrdina)
* virt-install: new install option. Ex: virt-install install fedora29
* virt-install: new install kernel=,initrd=
* virt-install: disk, memory, name defaults from libosinfo (Fabiano Fidêncio, Cole Robinson)
* virt-install: add device suboption aliases which consistently match libvirt XML naming
* virt-xml: new start, no-define options (Marc Hartmayer)
* virt-install: Add driver_queues argument to controller (Vasudeva Kamath)
* RISC-V support (Andrea Bolognani)
* Device default improvements for non-x86 KVM (Andrea Bolognani)
* Redesigned New Network wizard
* libguestfs inspection improvements (Pino Toscano)
* virt-install: Add support for xenbus controller (Jim Fehlig)
* cli: Add disk wwn=,rawio= (Athina Plaskasoviti)
* cli: Add memballoon autodeflate=,stats.period= (Athina Plaskasoviti)
* cli: Add iothreads (Athina Plaskasoviti)
* cli: Add numatune memory.placement (Athina Plaskasoviti)
* cli: Add launchSecurity option (Erik Skultety)
* cli: Fill in memorybacking options
* cli: smartcard: support database= and certificate[0-9]*=
* cli: sysinfo: Add chasis suboptions
* cli: metadata: add genid= and genid_enable=
* cli: vcpus: add vcpus.vcpu[0-9]* config
* cli: fill in all common char source options for serial, parellel, console, channel, smartcard, rng, redirdev
033e9702-xmleditor-Handle-gtksourceview3-as-well-as-gtksourceview4.patch
virtman-dont-specify-gtksource-version.patch
- Drop patches no longer needed
f7508d02-addhardware-Fix-setting-optimal-default-net-model.patch
1018ab44-inspection-handle-failures-in-application-listing.patch
ae8a4f3d-engine-Fix-first-run-startup-error.patch
57db4185-virt-clone-fix-force-copy-of-empty-cdrom-or-floppy-disk.patch
26a433fc-virtManager-clone-check-which-storage-pools-supports-volume-cloning.patch
4f66c423-cloner-Handle-nonsparse-for-qcow2-images.patch
a02fc0d0-virtManager-clone-build-default-clone-path-if-we-know-how.patch
1856c1fa-support-Fix-minimum-version-check.patch
001-adf30349-cli-refactor-get_prop.patch
002-60c7e778-xmlapi-add-set_prop.patch
003-5bad22e8-tests-Use-get-set_prop.patch
004-ee5f3eab-support-Add-SUPPORT_CONN_DEVICE_BOOT_ORDER.patch
005-7768eb17-cli-Add-check-if-device-boot-order-is-supported.patch
006-ecc0861c-tests-xmlparse-refactor-method-for-generating-out-file-path.patch
007-c9d070da-guest-Add-reorder_boot_order-method.patch
008-1b535940-tests-Add-test-case-for-reorder_boot_order-method.patch
009-b83a0a61-cli-Use-reorder_boot_order-for-setting-the-boot-order.patch
010-c896d19d-tests-cli-Add-boot.order-tests.patch
011-29f9f2ac-virt-xml-Add-no-define-argument.patch
012-c2bff509-tests-cli-Add-test-case-for-no-define-argument.patch
013-90b1a3ab-virt-xml-Add-support-for-starting-the-domain.patch
014-908b8e8d-tests-virt-xml-Add-test-cases-for-start-option.patch
5bc847eb-virt-install-Do-not-warn-about-consoles-on-s390x.patch
74bbc3db-urldetect-Check-also-for-treeinfo.patch
708af01c-osdict-Add-supports_virtioinput.patch
f23b01be-guest-Add-VirtIO-input-devices-to-s390x-guests-with-graphics.patch
7afbb90b-virt-xml-Handle-VM-names-that-look-like-id-uuid.patch
8d9743d6-virt-install-Add-support-for-xenbus-controller.patch
a0ca387a-cli-Fix-pool-default-when-path-belongs-to-another-pool.patch
578451fe-urldetect-Dont-run-regex-against-None-SUSE-product-name.patch
virtman-default-guest-from-host-os.patch
virtman-prevent-double-click-starting-vm-twice.patch
-------------------------------------------------------------------
Thu Jun 13 14:15:44 MDT 2019 - carnold@suse.com

View File

@ -12,7 +12,7 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
@ -21,7 +21,7 @@
%global default_hvs "qemu,xen,lxc"
Name: virt-manager
Version: 2.1.0
Version: 2.2.0
Release: 0
Summary: Virtual Machine Manager
License: GPL-2.0-or-later
@ -32,37 +32,10 @@ Source1: virt-install.rb
Source2: virt-install.desktop
Source3: virt-manager-supportconfig
# Upstream Patches
Patch1: f7508d02-addhardware-Fix-setting-optimal-default-net-model.patch
Patch2: 1018ab44-inspection-handle-failures-in-application-listing.patch
Patch3: ae8a4f3d-engine-Fix-first-run-startup-error.patch
Patch4: 57db4185-virt-clone-fix-force-copy-of-empty-cdrom-or-floppy-disk.patch
Patch5: 26a433fc-virtManager-clone-check-which-storage-pools-supports-volume-cloning.patch
Patch6: 4f66c423-cloner-Handle-nonsparse-for-qcow2-images.patch
Patch7: a02fc0d0-virtManager-clone-build-default-clone-path-if-we-know-how.patch
Patch8: 1856c1fa-support-Fix-minimum-version-check.patch
# jsc#SLE-6262 - KVM: Boot Configuration Override (virt-manager)
Patch9: 001-adf30349-cli-refactor-get_prop.patch
Patch10: 002-60c7e778-xmlapi-add-set_prop.patch
Patch11: 003-5bad22e8-tests-Use-get-set_prop.patch
Patch12: 004-ee5f3eab-support-Add-SUPPORT_CONN_DEVICE_BOOT_ORDER.patch
Patch13: 005-7768eb17-cli-Add-check-if-device-boot-order-is-supported.patch
Patch14: 006-ecc0861c-tests-xmlparse-refactor-method-for-generating-out-file-path.patch
Patch15: 007-c9d070da-guest-Add-reorder_boot_order-method.patch
Patch16: 008-1b535940-tests-Add-test-case-for-reorder_boot_order-method.patch
Patch17: 009-b83a0a61-cli-Use-reorder_boot_order-for-setting-the-boot-order.patch
Patch18: 010-c896d19d-tests-cli-Add-boot.order-tests.patch
Patch19: 011-29f9f2ac-virt-xml-Add-no-define-argument.patch
Patch20: 012-c2bff509-tests-cli-Add-test-case-for-no-define-argument.patch
Patch21: 013-90b1a3ab-virt-xml-Add-support-for-starting-the-domain.patch
Patch22: 014-908b8e8d-tests-virt-xml-Add-test-cases-for-start-option.patch
Patch23: 5bc847eb-virt-install-Do-not-warn-about-consoles-on-s390x.patch
Patch24: 74bbc3db-urldetect-Check-also-for-treeinfo.patch
Patch25: 708af01c-osdict-Add-supports_virtioinput.patch
Patch26: f23b01be-guest-Add-VirtIO-input-devices-to-s390x-guests-with-graphics.patch
Patch27: 7afbb90b-virt-xml-Handle-VM-names-that-look-like-id-uuid.patch
Patch28: 8d9743d6-virt-install-Add-support-for-xenbus-controller.patch
Patch29: a0ca387a-cli-Fix-pool-default-when-path-belongs-to-another-pool.patch
Patch30: 578451fe-urldetect-Dont-run-regex-against-None-SUSE-product-name.patch
Patch1: 033e9702-xmleditor-Handle-gtksourceview3-as-well-as-gtksourceview4.patch
Patch2: 5312a961-virt-install-Revive-wait-0-as-alias-for-noautoconsole.patch
Patch3: 58c68764-unattended-Read-the-passwords-from-a-file.patch
Patch4: 51d28f04-unattended-Dont-log-user-admin-passwords.patch
# SUSE Only
Patch70: virtman-desktop.patch
Patch71: virtman-kvm.patch
@ -74,7 +47,6 @@ Patch76: virtinst-change-location-for-grub_xen.patch
Patch77: virtman-fix-env-script-interpreter.patch
Patch78: virtinst-set-qemu-emulator.patch
# Features or Enhancements
Patch101: virtman-default-guest-from-host-os.patch
Patch102: virtman-default-to-xen-pv.patch
Patch103: virtman-load-stored-uris.patch
Patch120: virtinst-default-xen-to-qcow2-format.patch
@ -88,13 +60,13 @@ Patch127: virtinst-add-sle15-detection-support.patch
Patch128: virtinst-add-pvh-support.patch
Patch129: virtinst-media-detection.patch
# Bug Fixes
Patch150: virtman-prevent-double-click-starting-vm-twice.patch
Patch151: virtman-increase-setKeepAlive-count.patch
Patch152: virtman-allow-destroy-from-shutdown-menu-of-crashed-vm.patch
Patch153: virtman-check-for-valid-display.patch
Patch154: virtman-allow-creating-i686-vm.patch
Patch155: virtman-dont-specify-vte-version.patch
Patch156: virtman-fix-restore-vm-menu-selection.patch
Patch156: virtman-dont-specify-gtksource-version.patch
Patch157: virtman-fix-restore-vm-menu-selection.patch
Patch160: virtinst-xen-drive-type.patch
Patch161: virtinst-xenbus-disk-index-fix.patch
Patch162: virtinst-refresh_before_fetch_pool.patch
@ -117,12 +89,13 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define verrel %{version}-%{release}
Requires: dbus-1-x11
Requires: dconf
Requires: gtk3
Requires: gtk3 >= 3.22
Requires: python3-gobject-Gdk
# For console widget
Requires: python3-cairo
Requires: python3-gobject-cairo
Recommends: python3-SpiceClientGtk
Requires: gtksourceview >= 3
Requires: virt-install
Requires: virt-manager-common = %{verrel}
@ -134,7 +107,12 @@ BuildRequires: glib2-devel
BuildRequires: gtk3-tools
BuildRequires: intltool
BuildRequires: perl
BuildRequires: python3
BuildRequires: python3-devel
BuildRequires: python3-gobject
BuildRequires: python3-libvirt-python >= 0.7.0
BuildRequires: python3-libxml2-python
BuildRequires: python3-requests
BuildRequires: typelib(Libosinfo)
%description
Virtual Machine Manager provides a graphical tool for administering virtual
@ -194,32 +172,6 @@ machine).
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch29 -p1
%patch30 -p1
# SUSE Only
%patch70 -p1
%patch71 -p1
@ -231,7 +183,6 @@ machine).
%patch77 -p1
%patch78 -p1
# Enhancements
%patch101 -p1
%patch102 -p1
%patch103 -p1
%patch120 -p1
@ -245,13 +196,13 @@ machine).
%patch128 -p1
%patch129 -p1
# Bug Fixes
%patch150 -p1
%patch151 -p1
%patch152 -p1
%patch153 -p1
%patch154 -p1
%patch155 -p1
%patch156 -p1
%patch157 -p1
%patch160 -p1
%patch161 -p1
%patch162 -p1
@ -339,7 +290,6 @@ fi
%defattr(-,root,root,-)
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/virtcli
%{_datadir}/%{name}/virtconv
%{_datadir}/%{name}/virtinst

View File

@ -1,13 +1,13 @@
Index: virt-manager-2.0.0/virtconv/vmx.py
Index: virt-manager-2.2.0/virtconv/vmx.py
===================================================================
--- virt-manager-2.0.0.orig/virtconv/vmx.py
+++ virt-manager-2.0.0/virtconv/vmx.py
--- virt-manager-2.2.0.orig/virtconv/vmx.py
+++ virt-manager-2.2.0/virtconv/vmx.py
@@ -259,7 +259,7 @@ class vmx_parser(parser_class):
def _find_keys(prefixes):
ret = []
- for key, value in config.items():
+ for key, value in list(config.items()):
for p in util.listify(prefixes):
for p in xmlutil.listify(prefixes):
if key.startswith(p):
ret.append((key, value))

View File

@ -1,10 +1,10 @@
References: bsc#1010060
Index: virt-manager-2.1.0/virtinst/urldetect.py
Index: virt-manager-2.2.0/virtinst/install/urldetect.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/urldetect.py
+++ virt-manager-2.1.0/virtinst/urldetect.py
@@ -267,6 +267,12 @@ class _SUSEContent(object):
--- virt-manager-2.2.0.orig/virtinst/install/urldetect.py
+++ virt-manager-2.2.0/virtinst/install/urldetect.py
@@ -273,6 +273,12 @@ class _SUSEContent(object):
self.product_name.strip().rsplit(' ')[5][2])
distro_version = sle_version
@ -17,7 +17,7 @@ Index: virt-manager-2.1.0/virtinst/urldetect.py
return distro_version
@@ -553,6 +559,9 @@ class _SuseDistro(_RHELDistro):
@@ -550,6 +556,9 @@ class _SuseDistro(_RHELDistro):
# Tumbleweed 8 digit date
return "opensusetumbleweed"
@ -27,7 +27,7 @@ Index: virt-manager-2.1.0/virtinst/urldetect.py
if int(version) < 10:
return self._variant_prefix + "9"
@@ -625,6 +634,14 @@ class _OpensuseDistro(_SuseDistro):
@@ -622,6 +631,14 @@ class _OpensuseDistro(_SuseDistro):
famregex = ".*openSUSE.*"

View File

@ -1,11 +1,11 @@
References: fate#326698 - Add pvh support to virt-manager
At this time support is disabled in this patch.
Index: virt-manager-2.1.0/virtManager/create.py
Index: virt-manager-2.2.0/virtManager/createvm.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/create.py
+++ virt-manager-2.1.0/virtManager/create.py
@@ -739,6 +739,9 @@ class vmmCreate(vmmGObjectUI):
--- virt-manager-2.2.0.orig/virtManager/createvm.py
+++ virt-manager-2.2.0/virtManager/createvm.py
@@ -796,6 +796,9 @@ class vmmCreateVM(vmmGObjectUI):
for guest in guests:
if not guest.domains:
continue
@ -15,10 +15,10 @@ Index: virt-manager-2.1.0/virtManager/create.py
gtype = guest.os_type
dom = guest.domains[0]
Index: virt-manager-2.1.0/virtinst/domain/os.py
Index: virt-manager-2.2.0/virtinst/domain/os.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/domain/os.py
+++ virt-manager-2.1.0/virtinst/domain/os.py
--- virt-manager-2.2.0.orig/virtinst/domain/os.py
+++ virt-manager-2.2.0/virtinst/domain/os.py
@@ -32,6 +32,8 @@ class DomainOs(XMLBuilder):
return self.os_type == "hvm"
def is_xenpv(self):
@ -28,24 +28,24 @@ Index: virt-manager-2.1.0/virtinst/domain/os.py
def is_container(self):
return self.os_type == "exe"
Index: virt-manager-2.1.0/virtinst/guest.py
Index: virt-manager-2.2.0/virtinst/guest.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/guest.py
+++ virt-manager-2.1.0/virtinst/guest.py
@@ -612,7 +612,7 @@ class Guest(XMLBuilder):
--- virt-manager-2.2.0.orig/virtinst/guest.py
+++ virt-manager-2.2.0/virtinst/guest.py
@@ -818,7 +818,7 @@ class Guest(XMLBuilder):
usb_tablet = False
usb_keyboard = False
- if self.os.is_x86() and not self.os.is_xenpv():
+ if self.os.is_x86() and not self.os.is_xenpv() and not self.os.is_xenpvh():
usb_tablet = self.osinfo.supports_usbtablet()
if self.os.is_arm_machvirt():
usb_tablet = True
Index: virt-manager-2.1.0/virtManager/domain.py
if (self.os.is_arm_machvirt() or
self.os.is_riscv_virt() or
Index: virt-manager-2.2.0/virtManager/object/domain.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/domain.py
+++ virt-manager-2.1.0/virtManager/domain.py
@@ -1225,6 +1225,8 @@ class vmmDomain(vmmLibvirtObject):
--- virt-manager-2.2.0.orig/virtManager/object/domain.py
+++ virt-manager-2.2.0/virtManager/object/domain.py
@@ -1150,6 +1150,8 @@ class vmmDomain(vmmLibvirtObject):
return self.get_xmlobj().os.is_xenpv()
def is_hvm(self):
return self.get_xmlobj().os.is_hvm()
@ -54,11 +54,11 @@ Index: virt-manager-2.1.0/virtManager/domain.py
def get_uuid(self):
if self._uuid is None:
Index: virt-manager-2.1.0/virtManager/connection.py
Index: virt-manager-2.2.0/virtManager/connection.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/connection.py
+++ virt-manager-2.1.0/virtManager/connection.py
@@ -229,6 +229,8 @@ class vmmConnection(vmmGObject):
--- virt-manager-2.2.0.orig/virtManager/connection.py
+++ virt-manager-2.2.0/virtManager/connection.py
@@ -223,6 +223,8 @@ class vmmConnection(vmmGObject):
label = "xen (paravirt)"
elif gtype == "hvm":
label = "xen (fullvirt)"

View File

@ -1,10 +1,10 @@
References: bsc#1054986
Index: virt-manager-2.1.0/virtinst/urldetect.py
Index: virt-manager-2.2.0/virtinst/install/urldetect.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/urldetect.py
+++ virt-manager-2.1.0/virtinst/urldetect.py
@@ -589,6 +589,10 @@ class _SuseDistro(_RHELDistro):
--- virt-manager-2.2.0.orig/virtinst/install/urldetect.py
+++ virt-manager-2.2.0/virtinst/install/urldetect.py
@@ -586,6 +586,10 @@ class _SuseDistro(_RHELDistro):
if re.search("openSUSE Tumbleweed", self.cache.treeinfo_name):
return "opensusetumbleweed"
@ -15,7 +15,7 @@ Index: virt-manager-2.1.0/virtinst/urldetect.py
version, update = self.cache.split_version()
base = self._variant_prefix + str(version)
while update >= 0:
@@ -596,7 +600,10 @@ class _SuseDistro(_RHELDistro):
@@ -593,7 +597,10 @@ class _SuseDistro(_RHELDistro):
# SLE doesn't use '.0' for initial releases in
# osinfo-db (sles11, sles12, etc)
if update > 0 or not base.startswith('sle'):
@ -27,7 +27,7 @@ Index: virt-manager-2.1.0/virtinst/urldetect.py
if OSDB.lookup_os(tryvar):
return tryvar
update -= 1
@@ -610,6 +617,14 @@ class _SuseDistro(_RHELDistro):
@@ -607,6 +614,14 @@ class _SuseDistro(_RHELDistro):
return var

View File

@ -1,10 +1,10 @@
References: fate#326960, bsc#1123942
Index: virt-manager-2.1.0/virtinst/installer.py
Index: virt-manager-2.2.0/virtinst/install/installer.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/installer.py
+++ virt-manager-2.1.0/virtinst/installer.py
@@ -312,7 +312,10 @@ class Installer(object):
--- virt-manager-2.2.0.orig/virtinst/install/installer.py
+++ virt-manager-2.2.0/virtinst/install/installer.py
@@ -445,7 +445,10 @@ class Installer(object):
guest.bootloader = "pygrub"
else:
guest.bootloader = None
@ -15,11 +15,11 @@ Index: virt-manager-2.1.0/virtinst/installer.py
+ self._install_kernel = "/usr/lib/grub2/x86_64-xen/grub.xen"
self._install_initrd = None
self.extraargs = None
logging.info("Using grub.xen to boot guest")
Index: virt-manager-2.1.0/virtManager/delete.py
log.debug("Using grub.xen to boot guest")
Index: virt-manager-2.2.0/virtManager/delete.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/delete.py
+++ virt-manager-2.1.0/virtManager/delete.py
--- virt-manager-2.2.0.orig/virtManager/delete.py
+++ virt-manager-2.2.0/virtManager/delete.py
@@ -246,7 +246,7 @@ def populate_storage_list(storage_list,
diskdata.append(("dtb", vm.get_xmlobj().os.dtb, True, False, True))

View File

@ -1,15 +1,15 @@
Reference: bnc#885380
Allow Xen based VMs to default to using qcow2
Index: virt-manager-2.1.0/virtinst/support.py
Index: virt-manager-2.2.0/virtinst/support.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/support.py
+++ virt-manager-2.1.0/virtinst/support.py
@@ -232,7 +232,7 @@ SUPPORT_CONN_WORKING_XEN_EVENTS = _make(
# This is an arbitrary check to say whether it's a good idea to
# default to qcow2. It might be fine for xen or qemu older than the versions
# here, but until someone tests things I'm going to be a bit conservative.
-SUPPORT_CONN_DEFAULT_QCOW2 = _make(hv_version={"qemu": "1.2.0", "test": 0})
+SUPPORT_CONN_DEFAULT_QCOW2 = _make(hv_version={"qemu": "1.2.0", "all": 0})
SUPPORT_CONN_AUTOSOCKET = _make(hv_libvirt_version={"qemu": "1.0.6"})
SUPPORT_CONN_PM_DISABLE = _make(hv_version={"qemu": "1.2.0", "test": 0})
SUPPORT_CONN_QCOW2_LAZY_REFCOUNTS = _make(
--- virt-manager-2.2.0.orig/virtinst/support.py
+++ virt-manager-2.2.0/virtinst/support.py
@@ -249,7 +249,7 @@ class SupportCache:
# This is an arbitrary check to say whether it's a good idea to
# default to qcow2. It might be fine for xen or qemu older than the versions
# here, but until someone tests things I'm going to be a bit conservative.
- conn_default_qcow2 = _make(hv_version={"qemu": "1.2.0", "test": 0})
+ conn_default_qcow2 = _make(hv_version={"qemu": "1.2.0", "all": 0})
conn_autosocket = _make(hv_libvirt_version={"qemu": "1.0.6"})
conn_pm_disable = _make(hv_version={"qemu": "1.2.0", "test": 0})
conn_qcow2_lazy_refcounts = _make(

View File

@ -1,10 +1,10 @@
Enhancement to correctly detect Open Enterprise Server media is
selected as the installation source.
Index: virt-manager-2.1.0/virtinst/urldetect.py
Index: virt-manager-2.2.0/virtinst/install/urldetect.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/urldetect.py
+++ virt-manager-2.1.0/virtinst/urldetect.py
@@ -556,7 +556,7 @@ class _SuseDistro(_RHELDistro):
--- virt-manager-2.2.0.orig/virtinst/install/urldetect.py
+++ virt-manager-2.2.0/virtinst/install/urldetect.py
@@ -553,7 +553,7 @@ class _SuseDistro(_RHELDistro):
if int(version) < 10:
return self._variant_prefix + "9"
@ -13,7 +13,7 @@ Index: virt-manager-2.1.0/virtinst/urldetect.py
sp_version = ""
if len(distro_version.split('.', 1)) == 2:
sp_version = 'sp' + distro_version.split('.', 1)[1].strip()
@@ -625,6 +625,14 @@ class _OpensuseDistro(_SuseDistro):
@@ -622,6 +622,14 @@ class _OpensuseDistro(_SuseDistro):
famregex = ".*openSUSE.*"

View File

@ -12,11 +12,11 @@ It should be noted that selecting "Customize configuration before install"
and "CPUs" -> "Copy host CPU definition" also inserts 'host-model' so
this change mirrors what is already done there.
Index: virt-manager-2.1.0/virtinst/domain/cpu.py
Index: virt-manager-2.2.0/virtinst/domain/cpu.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/domain/cpu.py
+++ virt-manager-2.1.0/virtinst/domain/cpu.py
@@ -87,12 +87,16 @@ class DomainCpu(XMLBuilder):
--- virt-manager-2.2.0.orig/virtinst/domain/cpu.py
+++ virt-manager-2.2.0/virtinst/domain/cpu.py
@@ -89,12 +89,16 @@ class DomainCpu(XMLBuilder):
val = self.SPECIAL_MODE_HOST_MODEL
if (val == self.SPECIAL_MODE_HOST_MODEL or

View File

@ -2,17 +2,17 @@ Older SLE guests have a two stage installation that need the ISO.
Newer SLE PV guests hang when a cdrom device is attached without
an ISO file.
Index: virt-manager-2.1.0/virtinst/installer.py
Index: virt-manager-2.2.0/virtinst/install/installer.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/installer.py
+++ virt-manager-2.1.0/virtinst/installer.py
@@ -105,7 +105,8 @@ class Installer(object):
return
if self.livecd:
--- virt-manager-2.2.0.orig/virtinst/install/installer.py
+++ virt-manager-2.2.0/virtinst/install/installer.py
@@ -111,7 +111,8 @@ class Installer(object):
def _remove_install_cdrom_media(self, guest):
if not self._install_cdrom_device_added:
return
- if guest.osinfo.is_windows():
+ if (guest.osinfo.is_windows() or
+ guest.osinfo.name.startswith(("sles", "sled", "opensuse"))):
# Keep media attached for windows which has a multi stage install
return
self._install_cdrom_device.path = None
for disk in guest.devices.disk:

View File

@ -2,11 +2,11 @@ When both the content file and .treeinfo file are missing from the media
look in the media.1/products and media.1/media files for information.
Caasp 4.0 has not content or .treeinfo file on the media
Index: virt-manager-2.1.0/virtinst/urldetect.py
Index: virt-manager-2.2.0/virtinst/install/urldetect.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/urldetect.py
+++ virt-manager-2.1.0/virtinst/urldetect.py
@@ -494,8 +494,23 @@ class _SuseDistro(_RHELDistro):
--- virt-manager-2.2.0.orig/virtinst/install/urldetect.py
+++ virt-manager-2.2.0/virtinst/install/urldetect.py
@@ -488,8 +488,23 @@ class _SuseDistro(_RHELDistro):
cache.checked_for_suse_content = True
content_str = cache.acquire_file_content("content")
if content_str is None:

View File

@ -1,11 +1,11 @@
Enhancement for the following GUI wizard installation option.
1) If Xen, leave 'Architecture options' expanded so users know PV
is the default
Index: virt-manager-2.0.0/virtManager/create.py
Index: virt-manager-2.2.0/virtManager/createvm.py
===================================================================
--- virt-manager-2.0.0.orig/virtManager/create.py
+++ virt-manager-2.0.0/virtManager/create.py
@@ -346,8 +346,20 @@ class vmmCreate(vmmGObjectUI):
--- virt-manager-2.2.0.orig/virtManager/createvm.py
+++ virt-manager-2.2.0/virtManager/createvm.py
@@ -403,8 +403,20 @@ class vmmCreateVM(vmmGObjectUI):
self.widget("method-local").set_active(True)
self.widget("create-conn").set_active(-1)
activeconn = self._populate_conn_list(urihint)
@ -18,7 +18,7 @@ Index: virt-manager-2.0.0/virtManager/create.py
+ self.widget("arch-expander").set_expanded(False)
+
+ # Default to Network install if host was installed that way
+ host_instsrc = util.getHostInstallSource()
+ host_instsrc = getHostInstallSource()
+ if host_instsrc is not None and \
+ (host_instsrc.startswith('ftp:') or host_instsrc.startswith('http:') or \
+ host_instsrc.startswith('smb:') or host_instsrc.startswith('nfs:')):

View File

@ -3,11 +3,11 @@ to be supported through LTSS contracts for others. Hence the EOL
date in the osinfo-db file may be past but we want the distro to
continue to show up in the list.
Index: virt-manager-2.1.0/virtinst/osdict.py
Index: virt-manager-2.2.0/virtinst/osdict.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/osdict.py
+++ virt-manager-2.1.0/virtinst/osdict.py
@@ -321,7 +321,7 @@ class _OsVariant(object):
--- virt-manager-2.2.0.orig/virtinst/osdict.py
+++ virt-manager-2.2.0/virtinst/osdict.py
@@ -445,7 +445,7 @@ class _OsVariant(object):
# If no EOL is present, assume EOL if release was > 5 years ago
if rel is not None:

View File

@ -2,14 +2,14 @@ Reference: bnc#863821
grub.xen is required to boot PV VMs that use the BTRFS filesystem.
This patch forces the use of grub.xen (instead of using pygrub) for
suse distros SLE12GA, openSUSE 13.2, and newer.
Index: virt-manager-2.1.0/virtinst/installer.py
Index: virt-manager-2.2.0/virtinst/install/installer.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/installer.py
+++ virt-manager-2.1.0/virtinst/installer.py
@@ -303,6 +303,20 @@ class Installer(object):
--- virt-manager-2.2.0.orig/virtinst/install/installer.py
+++ virt-manager-2.2.0/virtinst/install/installer.py
@@ -436,6 +436,20 @@ class Installer(object):
install_xml = None
if self.has_install_phase():
install_xml = self._get_install_xml(guest)
install_xml = self._get_install_xml(guest, meter)
+ if (guest.os.is_xenpv() and
+ not guest.os.kernel):
+ os_ver = guest.osinfo.name
@ -22,8 +22,8 @@ Index: virt-manager-2.1.0/virtinst/installer.py
+ self._install_kernel = "/usr/lib/grub2/x86_64-xen/grub.xen"
+ self._install_initrd = None
+ self.extraargs = None
+ logging.info("Using grub.xen to boot guest")
+ log.debug("Using grub.xen to boot guest")
+ self._alter_bootconfig(guest)
final_xml = guest.get_xml()
logging.debug("Generated install XML: %s",
log.debug("Generated install XML: %s",

View File

@ -1,8 +1,8 @@
Index: virt-manager-2.1.0/virtinst/osdict.py
Index: virt-manager-2.2.0/virtinst/osdict.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/osdict.py
+++ virt-manager-2.1.0/virtinst/osdict.py
@@ -50,7 +50,7 @@ def _sort(tosort):
--- virt-manager-2.2.0.orig/virtinst/osdict.py
+++ virt-manager-2.2.0/virtinst/osdict.py
@@ -54,7 +54,7 @@ def _sort(tosort):
distro_mappings = {}
retlist = []
@ -11,37 +11,37 @@ Index: virt-manager-2.1.0/virtinst/osdict.py
# Libosinfo has some duplicate version numbers here, so append .1
# if there's a collision
sortby = _sortby(osinfo)
Index: virt-manager-2.1.0/virtinst/installertreemedia.py
Index: virt-manager-2.2.0/virtinst/install/installertreemedia.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/installertreemedia.py
+++ virt-manager-2.1.0/virtinst/installertreemedia.py
@@ -19,7 +19,7 @@ from .osdict import OSDB
# Enum of the various install media types we can have
--- virt-manager-2.2.0.orig/virtinst/install/installertreemedia.py
+++ virt-manager-2.2.0/virtinst/install/installertreemedia.py
@@ -20,7 +20,7 @@ from ..osdict import OSDB
(MEDIA_DIR,
MEDIA_ISO,
- MEDIA_URL) = range(1, 4)
+ MEDIA_URL) = list(range(1, 4))
MEDIA_URL,
- MEDIA_KERNEL) = range(1, 5)
+ MEDIA_KERNEL) = list(range(1, 5))
def _is_url(url):
Index: virt-manager-2.1.0/virtinst/xmlbuilder.py
Index: virt-manager-2.2.0/virtinst/xmlbuilder.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/xmlbuilder.py
+++ virt-manager-2.1.0/virtinst/xmlbuilder.py
@@ -624,7 +624,7 @@ class XMLBuilder(object):
--- virt-manager-2.2.0.orig/virtinst/xmlbuilder.py
+++ virt-manager-2.2.0/virtinst/xmlbuilder.py
@@ -661,7 +661,7 @@ class XMLBuilder(object):
whenever child objects are added or removed
"""
typecount = {}
- for propname, xmlprop in self._all_child_props().items():
+ for propname, xmlprop in list(self._all_child_props().items()):
for obj in util.listify(getattr(self, propname)):
for obj in xmlutil.listify(getattr(self, propname)):
idxstr = ""
if not xmlprop.is_single:
Index: virt-manager-2.1.0/virtinst/domcapabilities.py
Index: virt-manager-2.2.0/virtinst/domcapabilities.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/domcapabilities.py
+++ virt-manager-2.1.0/virtinst/domcapabilities.py
@@ -202,7 +202,7 @@ class DomainCapabilities(XMLBuilder):
--- virt-manager-2.2.0.orig/virtinst/domcapabilities.py
+++ virt-manager-2.2.0/virtinst/domcapabilities.py
@@ -217,7 +217,7 @@ class DomainCapabilities(XMLBuilder):
return _("BIOS")
return _("None")
@ -50,11 +50,11 @@ Index: virt-manager-2.1.0/virtinst/domcapabilities.py
for pattern in patterns:
if re.match(pattern, path):
return (_("UEFI %(arch)s: %(path)s") %
Index: virt-manager-2.1.0/virtinst/devices/disk.py
Index: virt-manager-2.2.0/virtinst/devices/disk.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/devices/disk.py
+++ virt-manager-2.1.0/virtinst/devices/disk.py
@@ -326,7 +326,7 @@ class DeviceDisk(Device):
--- virt-manager-2.2.0.orig/virtinst/devices/disk.py
+++ virt-manager-2.2.0/virtinst/devices/disk.py
@@ -269,7 +269,7 @@ class DeviceDisk(Device):
digit = 1
seen_valid = True
@ -63,7 +63,7 @@ Index: virt-manager-2.1.0/virtinst/devices/disk.py
return gen_t
@@ -919,11 +919,11 @@ class DeviceDisk(Device):
@@ -879,11 +879,11 @@ class DeviceDisk(Device):
def get_target():
first_found = None
@ -77,11 +77,11 @@ Index: virt-manager-2.1.0/virtinst/devices/disk.py
for i in ran:
postfix = self.num_to_target(i + 1)
Index: virt-manager-2.1.0/virtinst/pollhelpers.py
Index: virt-manager-2.2.0/virtinst/pollhelpers.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/pollhelpers.py
+++ virt-manager-2.1.0/virtinst/pollhelpers.py
@@ -131,7 +131,7 @@ def fetch_pools(backend, origmap, build_
--- virt-manager-2.2.0.orig/virtinst/pollhelpers.py
+++ virt-manager-2.2.0/virtinst/pollhelpers.py
@@ -129,7 +129,7 @@ def fetch_pools(backend, origmap, build_
for obj in objs:
try:
obj.refresh(0)

View File

@ -13,14 +13,14 @@ status affects the hypervisor connection.
Signed-off-by: Chunyan Liu <cyliu@suse.com>
Index: virt-manager-2.0.0/virtinst/pollhelpers.py
Index: virt-manager-2.2.0/virtinst/pollhelpers.py
===================================================================
--- virt-manager-2.0.0.orig/virtinst/pollhelpers.py
+++ virt-manager-2.0.0/virtinst/pollhelpers.py
@@ -121,6 +121,19 @@ def fetch_pools(backend, origmap, build_
--- virt-manager-2.2.0.orig/virtinst/pollhelpers.py
+++ virt-manager-2.2.0/virtinst/pollhelpers.py
@@ -119,6 +119,19 @@ def fetch_pools(backend, origmap, build_
name = "pool"
if backend.check_support(
backend.SUPPORT_CONN_LISTALLSTORAGEPOOLS) and not FORCE_OLD_POLL:
if backend.support.conn_listallstoragepools() and not FORCE_OLD_POLL:
+
+ # Refresh pools before poll_helper. For those
+ # 'active' but target path not exist (or other reasons

View File

@ -1,10 +1,10 @@
Reference: bnc#869024
Disable graphics on s390x
Index: virt-manager-2.1.0/virtinst/guest.py
Index: virt-manager-2.2.0/virtinst/guest.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/guest.py
+++ virt-manager-2.1.0/virtinst/guest.py
@@ -159,7 +159,10 @@ class Guest(XMLBuilder):
--- virt-manager-2.2.0.orig/virtinst/guest.py
+++ virt-manager-2.2.0/virtinst/guest.py
@@ -225,7 +225,10 @@ class Guest(XMLBuilder):
self.skip_default_channel = False
self.skip_default_sound = False
self.skip_default_usbredir = False
@ -16,7 +16,7 @@ Index: virt-manager-2.1.0/virtinst/guest.py
self.skip_default_rng = False
self.x86_cpu_default = self.cpu.SPECIAL_MODE_APP_DEFAULT
@@ -323,7 +326,7 @@ class Guest(XMLBuilder):
@@ -479,7 +482,7 @@ class Guest(XMLBuilder):
if not os_support:
return False
@ -25,7 +25,7 @@ Index: virt-manager-2.1.0/virtinst/guest.py
return True
return False
@@ -650,7 +653,7 @@ class Guest(XMLBuilder):
@@ -858,7 +861,7 @@ class Guest(XMLBuilder):
self.add_device(dev)
def _add_default_video_device(self):
@ -34,7 +34,7 @@ Index: virt-manager-2.1.0/virtinst/guest.py
return
if self.devices.video:
return
@@ -714,7 +717,7 @@ class Guest(XMLBuilder):
@@ -925,7 +928,7 @@ class Guest(XMLBuilder):
return
if self.os.is_container() and not self.conn.is_vz():
return

View File

@ -1,13 +1,13 @@
Set cache mode for target installation disk to unsafe for better
performance.
Index: virt-manager-2.1.0/virtinst/installer.py
Index: virt-manager-2.2.0/virtinst/install/installer.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/installer.py
+++ virt-manager-2.1.0/virtinst/installer.py
@@ -290,10 +290,21 @@ class Installer(object):
guest.os.kernel_args, guest.on_reboot) = data
--- virt-manager-2.2.0.orig/virtinst/install/installer.py
+++ virt-manager-2.2.0/virtinst/install/installer.py
@@ -421,11 +421,22 @@ class Installer(object):
guest.memory) = data
def _get_install_xml(self, guest):
def _get_install_xml(self, guest, meter):
+ # At install time set the target disk to 'unsafe' for
+ # better performance if the target is not a block device
+ saved_cache = "None"
@ -20,6 +20,7 @@ Index: virt-manager-2.1.0/virtinst/installer.py
data = self._prepare_get_install_xml(guest)
try:
self._alter_bootconfig(guest)
self._alter_install_resources(guest, meter)
ret = guest.get_xml()
+ if saved_cache != "None":
+ target_disk.driver_cache = saved_cache

View File

@ -1,11 +1,11 @@
Use the correct qemu emulator based on the architecture.
We want to get away from using the old qemu-dm emulator
for Xen HVM guests so default to qemu-system-i386.
Index: virt-manager-2.1.0/virtinst/guest.py
Index: virt-manager-2.2.0/virtinst/guest.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/guest.py
+++ virt-manager-2.1.0/virtinst/guest.py
@@ -525,6 +525,10 @@ class Guest(XMLBuilder):
--- virt-manager-2.2.0.orig/virtinst/guest.py
+++ virt-manager-2.2.0/virtinst/guest.py
@@ -736,6 +736,10 @@ class Guest(XMLBuilder):
self._add_default_rng()
self.clock.set_defaults(self)

View File

@ -2,11 +2,11 @@ References: bsc#989639
When the device added is a cdrom device (/dev/sr0), don't use
"phy" as the driver name but instead use "qemu".
Index: virt-manager-2.1.0/virtinst/devices/disk.py
Index: virt-manager-2.2.0/virtinst/devices/disk.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/devices/disk.py
+++ virt-manager-2.1.0/virtinst/devices/disk.py
@@ -436,7 +436,8 @@ class DeviceDisk(Device):
--- virt-manager-2.2.0.orig/virtinst/devices/disk.py
+++ virt-manager-2.2.0/virtinst/devices/disk.py
@@ -389,7 +389,8 @@ class DeviceDisk(Device):
# Recommended xen defaults from here:
# https://bugzilla.redhat.com/show_bug.cgi?id=1171550#c9
# If type block, use name=phy. Otherwise do the same as qemu
@ -14,5 +14,5 @@ Index: virt-manager-2.1.0/virtinst/devices/disk.py
+ if self.conn.is_xen() and self.type == self.TYPE_BLOCK and not \
+ self.is_cdrom():
return self.DRIVER_NAME_PHY
if self.conn.check_support(
self.conn.SUPPORT_CONN_DISK_DRIVER_NAME_QEMU):
if self.conn.support.conn_disk_driver_name_qemu():
return self.DRIVER_NAME_QEMU

View File

@ -4,11 +4,11 @@ a non pae version. The sles10 sp4 32bit kernel will only boot para-
virtualized if the pae kernel is selected.
Note that sles12 and newer has no 32bit release.
Index: virt-manager-2.1.0/virtinst/urldetect.py
Index: virt-manager-2.2.0/virtinst/install/urldetect.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/urldetect.py
+++ virt-manager-2.1.0/virtinst/urldetect.py
@@ -539,9 +539,14 @@ class _SuseDistro(_RHELDistro):
--- virt-manager-2.2.0.orig/virtinst/install/urldetect.py
+++ virt-manager-2.2.0/virtinst/install/urldetect.py
@@ -533,9 +533,14 @@ class _SuseDistro(_RHELDistro):
if self.type == "xen":
# Matches Opensuse > 10.2 and sles 10
@ -24,5 +24,5 @@ Index: virt-manager-2.1.0/virtinst/urldetect.py
+ ("boot/%s/vmlinuz-xen" % tree_arch,
+ "boot/%s/initrd-xen" % tree_arch))
if (tree_arch == "s390x" and
str(self._os_variant).startswith(("sles11", "sled11"))):
if str(self._os_variant).startswith(("sles11", "sled11")):
if tree_arch == "s390x":

View File

@ -4,32 +4,31 @@ issue on btrfs.
Signed-off-by: Chunyan Liu <cyliu@suse.com>
Index: virt-manager-2.1.0/virtinst/storage.py
Index: virt-manager-2.2.0/virtinst/storage.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/storage.py
+++ virt-manager-2.1.0/virtinst/storage.py
@@ -629,6 +629,11 @@ class StorageVolume(_StorageObject):
--- virt-manager-2.2.0.orig/virtinst/storage.py
+++ virt-manager-2.2.0/virtinst/storage.py
@@ -655,6 +655,11 @@ class StorageVolume(_StorageObject):
return self._pool_xml.get_disk_type()
file_type = property(_get_vol_type)
+ def _nocow_default_cb(self):
+ return self.conn.check_support(
+ self.conn.SUPPORT_CONN_NOCOW)
+ self.conn.conn_nocow)
+ nocow = XMLProperty("./target/nocow", is_bool=True)
+
##################
# XML properties #
Index: virt-manager-2.1.0/virtinst/support.py
Index: virt-manager-2.2.0/virtinst/support.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/support.py
+++ virt-manager-2.1.0/virtinst/support.py
@@ -267,6 +267,8 @@ SUPPORT_CONN_MACHVIRT_PCI_DEFAULT = _mak
SUPPORT_CONN_QEMU_XHCI = _make(version="3.3.0", hv_version={"qemu": "2.9.0"})
SUPPORT_CONN_VNC_NONE_AUTH = _make(hv_version={"qemu": "2.9.0"})
SUPPORT_CONN_DEVICE_BOOT_ORDER = _make(hv_version={"qemu": 0, "test": 0})
+SUPPORT_CONN_NOCOW = _make(
+ version="1.2.18", hv_version={"qemu": "2.2.0", "test": 0})
--- virt-manager-2.2.0.orig/virtinst/support.py
+++ virt-manager-2.2.0/virtinst/support.py
@@ -283,6 +283,7 @@ class SupportCache:
conn_vnc_none_auth = _make(hv_version={"qemu": "2.9.0"})
conn_device_boot_order = _make(hv_version={"qemu": 0, "test": 0})
conn_riscv_virt_pci_default = _make(version="5.3.0", hv_version={"qemu": "4.0.0"})
+ conn_nocow = _make(version="1.2.18", hv_version={"qemu": "2.2.0", "test": 0})
# We choose qemu 2.11.0 as the first version to target for q35 default.
# That's not really based on anything except reasonably modern at the
# We choose qemu 2.11.0 as the first version to target for q35 default.
# That's not really based on anything except reasonably modern at the

View File

@ -2,11 +2,11 @@ Reference: bnc#813082
Virt-manager on Xen doesn't fill in any type thereby defaulting to
'raw'. This patch will generate the correct XML on Xen.
Index: virt-manager-2.1.0/virtinst/devices/disk.py
Index: virt-manager-2.2.0/virtinst/devices/disk.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/devices/disk.py
+++ virt-manager-2.1.0/virtinst/devices/disk.py
@@ -454,6 +454,10 @@ class DeviceDisk(Device):
--- virt-manager-2.2.0.orig/virtinst/devices/disk.py
+++ virt-manager-2.2.0/virtinst/devices/disk.py
@@ -406,6 +406,10 @@ class DeviceDisk(Device):
https://lists.gnu.org/archive/html/qemu-devel/2008-04/msg00675.html
"""
if self.driver_name != self.DRIVER_NAME_QEMU:

View File

@ -6,11 +6,11 @@ types (ide vs xen) it added xvda with hda. These disks were then
passed to qemu where it error'ed out with the disks having the same
index (in this case both are 0).
Index: virt-manager-2.1.0/virtinst/devices/disk.py
Index: virt-manager-2.2.0/virtinst/devices/disk.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/devices/disk.py
+++ virt-manager-2.1.0/virtinst/devices/disk.py
@@ -901,6 +901,17 @@ class DeviceDisk(Device):
--- virt-manager-2.2.0.orig/virtinst/devices/disk.py
+++ virt-manager-2.2.0/virtinst/devices/disk.py
@@ -861,6 +861,17 @@ class DeviceDisk(Device):
:returns: generated target
"""
prefix, maxnode = self.get_target_prefix(skip_targets)
@ -28,7 +28,7 @@ Index: virt-manager-2.1.0/virtinst/devices/disk.py
skip_targets = [t for t in skip_targets if t and t.startswith(prefix)]
skip_targets.sort()
@@ -914,7 +925,12 @@ class DeviceDisk(Device):
@@ -874,7 +885,12 @@ class DeviceDisk(Device):
ran = range(pref_ctrl * 7, (pref_ctrl + 1) * 7)
for i in ran:

View File

@ -1,11 +1,11 @@
References: bsc#919692
Because openSUSE repos combine 32 and 64 bit sources we need to
continue showing the 'Architecture' pop-up.
Index: virt-manager-2.1.0/virtManager/create.py
Index: virt-manager-2.2.0/virtManager/createvm.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/create.py
+++ virt-manager-2.1.0/virtManager/create.py
@@ -777,11 +777,6 @@ class vmmCreate(vmmGObjectUI):
--- virt-manager-2.2.0.orig/virtManager/createvm.py
+++ virt-manager-2.2.0/virtManager/createvm.py
@@ -834,11 +834,6 @@ class vmmCreateVM(vmmGObjectUI):
for guest in self.conn.caps.guests:
if guest.os_type == self._capsinfo.os_type:
archs.append(guest.arch)

View File

@ -6,11 +6,11 @@ Steps to get a KVM VM in the crashed state:
4) Edit the VM's /etc/default/grub file and remove the crashkernel information
and then run grub2-mkconfig /boot/grub2/grub.cfg.
5) Start the VM and within the VM's terminal type "echo 'c' > /proc/sysrq-trigger"
Index: virt-manager-2.0.0/virtManager/manager.py
Index: virt-manager-2.2.0/virtManager/manager.py
===================================================================
--- virt-manager-2.0.0.orig/virtManager/manager.py
+++ virt-manager-2.0.0/virtManager/manager.py
@@ -789,7 +789,7 @@ class vmmManager(vmmGObjectUI):
--- virt-manager-2.2.0.orig/virtManager/manager.py
+++ virt-manager-2.2.0/virtManager/manager.py
@@ -784,7 +784,7 @@ class vmmManager(vmmGObjectUI):
show_pause = bool(vm and vm.is_unpauseable())
else:
show_pause = bool(vm and vm.is_pauseable())
@ -19,10 +19,10 @@ Index: virt-manager-2.0.0/virtManager/manager.py
if vm and vm.managedsave_supported:
self.change_run_text(vm.has_managed_save())
Index: virt-manager-2.0.0/virtManager/vmmenu.py
Index: virt-manager-2.2.0/virtManager/vmmenu.py
===================================================================
--- virt-manager-2.0.0.orig/virtManager/vmmenu.py
+++ virt-manager-2.0.0/virtManager/vmmenu.py
--- virt-manager-2.2.0.orig/virtManager/vmmenu.py
+++ virt-manager-2.2.0/virtManager/vmmenu.py
@@ -21,6 +21,7 @@ class _VMMenu(Gtk.Menu):
self._parent = src
self._current_vm_cb = current_vm_cb
@ -39,7 +39,7 @@ Index: virt-manager-2.0.0/virtManager/vmmenu.py
if name == "reset":
child.set_tooltip_text(None)
@@ -106,7 +108,8 @@ class VMActionMenu(_VMMenu):
@@ -105,7 +107,8 @@ class VMActionMenu(_VMMenu):
self._add_action(_("R_esume"), "resume", VMActionUI.resume,
Gtk.STOCK_MEDIA_PAUSE)
s = self._add_action(_("_Shut Down"), "shutdown", None)
@ -49,7 +49,7 @@ Index: virt-manager-2.0.0/virtManager/vmmenu.py
self.add(Gtk.SeparatorMenuItem())
self._add_action(_("Clone..."), "clone",
@@ -126,7 +129,7 @@ class VMActionMenu(_VMMenu):
@@ -125,7 +128,7 @@ class VMActionMenu(_VMMenu):
def update_widget_states(self, vm):
statemap = {
"run": bool(vm and vm.is_runable()),
@ -58,7 +58,7 @@ Index: virt-manager-2.0.0/virtManager/vmmenu.py
"suspend": bool(vm and vm.is_stoppable()),
"resume": bool(vm and vm.is_paused()),
"migrate": bool(vm and vm.is_stoppable()),
@@ -143,6 +146,8 @@ class VMActionMenu(_VMMenu):
@@ -142,6 +145,8 @@ class VMActionMenu(_VMMenu):
child.get_submenu().update_widget_states(vm)
if name in statemap:
child.set_sensitive(statemap[name])

View File

@ -1,11 +1,11 @@
References: bnc#907958
Sanity check for those who forget '-X' on ssh and try to start virt-manager
Index: virt-manager-2.0.0/virt-manager
Index: virt-manager-2.2.0/virt-manager
===================================================================
--- virt-manager-2.0.0.orig/virt-manager
+++ virt-manager-2.0.0/virt-manager
--- virt-manager-2.2.0.orig/virt-manager
+++ virt-manager-2.2.0/virt-manager
@@ -66,8 +66,11 @@ def _import_gtk(leftovers):
print("gtk3 3.14.0 or later is required.")
print("gtk3 3.22.0 or later is required.")
sys.exit(1)
- # This will error if Gtk wasn't correctly initialized

View File

@ -1,89 +0,0 @@
Enhancement to default to the host os version when creating a VM
and media detection of the install source is turned off.
Index: virt-manager-2.1.0/virtManager/create.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/create.py
+++ virt-manager-2.1.0/virtManager/create.py
@@ -10,6 +10,9 @@ import pkgutil
import os
import threading
import time
+import sys
+import os
+import re
from gi.repository import Gdk
from gi.repository import Gtk
@@ -1184,6 +1187,63 @@ class vmmCreate(vmmGObjectUI):
def _iso_activated_cb(self, mediacombo, entry):
self._detectable_media_widget_changed(entry, checkfocus=False)
+ def _lookup_host_os(self):
+ def _lookup_sp(line):
+ sp = ""
+ m = re.search(' SP[12345] ', line)
+ if m:
+ sp = m.group(0).strip().lower()
+ return sp
+ if sys.platform.startswith('linux'):
+ if os.path.exists('/etc/issue'):
+ f = open('/etc/issue')
+ lines = f.readlines()
+ f.close()
+ for line in lines:
+ if "openSUSE " in line:
+ parts = line.split(' ')
+ if len(parts) > 2 and len(parts[3]) <= 4:
+ os_ver = "opensuse" + parts[3]
+ return 'linux', os_ver
+ return 'linux', 'opensuse42.2'
+ if "SUSE Linux Enterprise Server 15" in line:
+ return 'linux', ('sle15' + _lookup_sp(line))
+ if "SUSE Linux Enterprise Server 12" in line:
+ return 'linux', ('sles12' + _lookup_sp(line))
+ if "SUSE Linux Enterprise Server 11" in line:
+ return 'linux', ('sles11' + _lookup_sp(line))
+ if "SUSE Linux Enterprise Desktop 15" in line:
+ return 'linux', ('sled15' + _lookup_sp(line))
+ if "SUSE Linux Enterprise Desktop 12" in line:
+ return 'linux', ('sled12' + _lookup_sp(line))
+ if "SUSE Linux Enterprise Desktop 11" in line:
+ return 'linux', ('sled11' + _lookup_sp(line))
+ return None, None
+
+ def detect_host_os(self):
+ box = self.widget('install-os-type')
+ if box.get_active() <= 0:
+ os_type, os_variant = self._lookup_host_os()
+ if os_type is None:
+ return
+ model = box.get_model()
+ index = 0
+ for row in model:
+ if row[0] == 'linux':
+ box.set_active(index)
+ break
+ index += 1
+ if os_variant is None:
+ return
+ box = self.widget('install-os-version')
+ model = box.get_model()
+ index = 0
+ for row in model:
+ if row[0] == os_variant:
+ box.set_active(index)
+ break
+ index += 1
+
def _detect_os_toggled_cb(self, src):
if not src.is_visible():
return
@@ -1194,6 +1254,8 @@ class vmmCreate(vmmGObjectUI):
if dodetect:
self._os_already_detected_for_media = False
self._start_detect_os_if_needed()
+ else:
+ self.detect_host_os()
def _browse_oscontainer(self, ignore):
self._browse_file("install-oscontainer-fs", is_dir=True)

View File

@ -1,9 +1,9 @@
Enhancement to default to PV instead of HVM on Xen host.
Index: virt-manager-2.0.0/virtManager/create.py
Index: virt-manager-2.2.0/virtManager/createvm.py
===================================================================
--- virt-manager-2.0.0.orig/virtManager/create.py
+++ virt-manager-2.0.0/virtManager/create.py
@@ -683,7 +683,12 @@ class vmmCreate(vmmGObjectUI):
--- virt-manager-2.2.0.orig/virtManager/createvm.py
+++ virt-manager-2.2.0/virtManager/createvm.py
@@ -740,7 +740,12 @@ class vmmCreateVM(vmmGObjectUI):
if gtype is None:
# If none specified, prefer HVM so install options aren't limited
# with a default PV choice.

View File

@ -0,0 +1,21 @@
--- virt-manager-2.2.0/virtManager/xmleditor.py.orig 2019-06-25 12:21:53.267971599 -0600
+++ virt-manager-2.2.0/virtManager/xmleditor.py 2019-06-25 12:22:20.854908884 -0600
@@ -7,12 +7,12 @@ import gi
from virtinst import log
# We can use either gtksourceview3 or gtksourceview4
-try:
- gi.require_version("GtkSource", "4")
- log.debug("Using GtkSource 4")
-except ValueError:
- gi.require_version("GtkSource", "3.0")
- log.debug("Using GtkSource 3.0")
+#try:
+# gi.require_version("GtkSource", "4")
+# log.debug("Using GtkSource 4")
+#except ValueError:
+# gi.require_version("GtkSource", "3.0")
+# log.debug("Using GtkSource 3.0")
from gi.repository import GtkSource
from .lib import uiutil

View File

@ -2,26 +2,26 @@ Creates a problem for gobject-introspection identifying what
version of vte is really allowed. Vte 2.91 is installed on the
host but the RPM is built requiring 2.90.
Index: virt-manager-2.0.0/virtManager/serialcon.py
Index: virt-manager-2.2.0/virtManager/details/serialcon.py
===================================================================
--- virt-manager-2.0.0.orig/virtManager/serialcon.py
+++ virt-manager-2.0.0/virtManager/serialcon.py
--- virt-manager-2.2.0.orig/virtManager/details/serialcon.py
+++ virt-manager-2.2.0/virtManager/details/serialcon.py
@@ -12,12 +12,12 @@ from gi.repository import Gtk
from virtinst import log
# We can use either 2.91 or 2.90. This is just to silence runtime warnings
# pylint: disable=wrong-import-position
-try:
- gi.require_version("Vte", "2.91")
- logging.debug("Using VTE API 2.91")
- log.debug("Using VTE API 2.91")
-except ValueError:
- gi.require_version("Vte", "2.90")
- logging.debug("Using VTE API 2.90")
- log.debug("Using VTE API 2.90")
+#try:
+# gi.require_version("Vte", "2.91")
+# logging.debug("Using VTE API 2.91")
+# log.debug("Using VTE API 2.91")
+#except ValueError:
+# gi.require_version("Vte", "2.90")
+# logging.debug("Using VTE API 2.90")
+# log.debug("Using VTE API 2.90")
from gi.repository import Vte
import libvirt

View File

@ -3,9 +3,11 @@ virt-manager no longer tracks the saved state but leaves it up to libvirt.
Libvirt returns libvirt.VIR_DOMAIN_PMSUSPENDED after a vm has been 'saved'.
--- virt-manager-2.1.0/virtManager/domain.py.orig 2019-06-13 13:53:44.915571869 -0600
+++ virt-manager-2.1.0/virtManager/domain.py 2019-06-13 14:11:40.413147729 -0600
@@ -1599,7 +1599,8 @@ class vmmDomain(vmmLibvirtObject):
Index: virt-manager-2.2.0/virtManager/object/domain.py
===================================================================
--- virt-manager-2.2.0.orig/virtManager/object/domain.py
+++ virt-manager-2.2.0/virtManager/object/domain.py
@@ -1454,7 +1454,8 @@ class vmmDomain(vmmLibvirtObject):
return (self.is_stoppable() or
self.status() in [libvirt.VIR_DOMAIN_CRASHED])
def is_runable(self):

View File

@ -2,16 +2,16 @@ References: bnc#892003
For very large memory VMs Xen takes a long time scrubbing memory
which causes the libvirt connection to timeout. Upstream was not
interested in making this a preferences option (4/11/2015)
Index: virt-manager-2.0.0/virtManager/connection.py
Index: virt-manager-2.2.0/virtManager/connection.py
===================================================================
--- virt-manager-2.0.0.orig/virtManager/connection.py
+++ virt-manager-2.0.0/virtManager/connection.py
@@ -1061,7 +1061,7 @@ class vmmConnection(vmmGObject):
self.caps.get_cpu_values(self.caps.host.cpu.arch)
--- virt-manager-2.2.0.orig/virtManager/connection.py
+++ virt-manager-2.2.0/virtManager/connection.py
@@ -1003,7 +1003,7 @@ class vmmConnection(vmmGObject):
self._add_conn_events()
try:
- self._backend.setKeepAlive(20, 1)
+ self._backend.setKeepAlive(20, 10)
except Exception as e:
if (not isinstance(e, AttributeError) and
not util.is_error_nosupport(e)):
not self.support.is_error_nosupport(e)):

View File

@ -1,8 +1,8 @@
Enhancement adding Send Keys for mostly NetWare and also Windows
Index: virt-manager-2.1.0/virtManager/console.py
Index: virt-manager-2.1.0/virtManager/details/console.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/console.py
+++ virt-manager-2.1.0/virtManager/console.py
--- virt-manager-2.1.0.orig/virtManager/details/console.py
+++ virt-manager-2.1.0/virtManager/details/console.py
@@ -114,6 +114,16 @@ def build_keycombo_menu(on_send_key_fn):
make_item("Ctrl+Alt+_Backspace", ["Control_L", "Alt_L", "BackSpace"])
make_item("Ctrl+Alt+_Delete", ["Control_L", "Alt_L", "Delete"])

View File

@ -1,10 +1,10 @@
/usr/bin/kvm doesn't exist on suse distros so check instead for
/usr/bin/qemu-system-x86_64
Index: virt-manager-2.0.0/virtManager/connect.py
Index: virt-manager-2.2.0/virtManager/createconn.py
===================================================================
--- virt-manager-2.0.0.orig/virtManager/connect.py
+++ virt-manager-2.0.0/virtManager/connect.py
@@ -66,7 +66,7 @@ class vmmConnect(vmmGObjectUI):
--- virt-manager-2.2.0.orig/virtManager/createconn.py
+++ virt-manager-2.2.0/virtManager/createconn.py
@@ -67,7 +67,7 @@ class vmmCreateConn(vmmGObjectUI):
if (os.path.exists("/usr/bin/qemu") or
os.path.exists("/usr/bin/qemu-kvm") or

View File

@ -1,16 +1,16 @@
If booted Xen, don't try connecting to local qemu
Likewise if booted native, don't try connecting to local xen
Index: virt-manager-2.0.0/virtManager/connmanager.py
Index: virt-manager-2.2.0/virtManager/connmanager.py
===================================================================
--- virt-manager-2.0.0.orig/virtManager/connmanager.py
+++ virt-manager-2.0.0/virtManager/connmanager.py
--- virt-manager-2.2.0.orig/virtManager/connmanager.py
+++ virt-manager-2.2.0/virtManager/connmanager.py
@@ -26,11 +26,17 @@ class vmmConnectionManager(vmmGObject):
def __init__(self):
vmmGObject.__init__(self)
+ from .connect import vmmConnect
+ default_uri = vmmConnect.default_uri()
+ from .createconn import vmmCreateConn
+ default_uri = vmmCreateConn.default_uri()
self._conns = {}
@ -18,7 +18,7 @@ Index: virt-manager-2.0.0/virtManager/connmanager.py
for uri in self.config.get_conn_uris():
+ if uri == 'xen:///' or uri == 'qemu:///system':
+ if default_uri and default_uri != uri:
+ logging.debug("Skipping local connection %s because it is incompatible with the host", uri)
+ log.debug("Skipping local connection %s because it is incompatible with the host", uri)
+ continue
self.add_conn(uri)

View File

@ -1,19 +0,0 @@
Reference: bnc#874594
When the 'Power on virtual machine' button is double clicked,
virt-manager issues two start commands to start the VM which
results in a failure. There is code elsewhere to desensitize the
button but this patch does it earlier.
Index: virt-manager-2.1.0/virtManager/details.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/details.py
+++ virt-manager-2.1.0/virtManager/details.py
@@ -1505,6 +1505,9 @@ class vmmDetails(vmmGObjectUI):
def control_vm_run(self, src_ignore):
if self.has_unapplied_changes(self.get_hw_row()):
return
+ # De-sensitize widget so a double click on the icon won't attempt to
+ # start the VM twice
+ self.widget("control-run").set_sensitive(False)
vmmenu.VMActionUI.run(self, self.vm)
def control_vm_shutdown(self, src_ignore):

View File

@ -1,9 +1,9 @@
Index: virt-manager-2.1.0/virt-manager
Index: virt-manager-2.2.0/virt-manager
===================================================================
--- virt-manager-2.1.0.orig/virt-manager
+++ virt-manager-2.1.0/virt-manager
--- virt-manager-2.2.0.orig/virt-manager
+++ virt-manager-2.2.0/virt-manager
@@ -66,7 +66,7 @@ def _import_gtk(leftovers):
print("gtk3 3.14.0 or later is required.")
print("gtk3 3.22.0 or later is required.")
sys.exit(1)
- if os.environ.has_key('DISPLAY') and os.environ['DISPLAY']:
@ -11,24 +11,11 @@ Index: virt-manager-2.1.0/virt-manager
# This will error if Gtk wasn't correctly initialized
Gtk.Window()
else:
Index: virt-manager-2.1.0/virtManager/network.py
Index: virt-manager-2.2.0/virtManager/details/console.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/network.py
+++ virt-manager-2.1.0/virtManager/network.py
@@ -110,7 +110,7 @@ class vmmNetwork(vmmLibvirtObject):
def set_qos(self, **kwargs):
xmlobj = self._make_xmlobj_to_define()
q = xmlobj.bandwidth
- for key, val in kwargs.items():
+ for key, val in list(kwargs.items()):
setattr(q, key, val)
self._redefine_xmlobj(xmlobj)
Index: virt-manager-2.1.0/virtManager/console.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/console.py
+++ virt-manager-2.1.0/virtManager/console.py
@@ -21,7 +21,7 @@ from .viewers import SpiceViewer, VNCVie
--- virt-manager-2.2.0.orig/virtManager/details/console.py
+++ virt-manager-2.2.0/virtManager/details/console.py
@@ -21,7 +21,7 @@ from ..vmwindow import DETAILS_PAGE_CONS
(_CONSOLE_PAGE_UNAVAILABLE,
_CONSOLE_PAGE_AUTHENTICATE,
_CONSOLE_PAGE_SERIAL,
@ -37,11 +24,11 @@ Index: virt-manager-2.1.0/virtManager/console.py
class _TimedRevealer(vmmGObject):
Index: virt-manager-2.1.0/virtManager/connection.py
Index: virt-manager-2.2.0/virtManager/connection.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/connection.py
+++ virt-manager-2.1.0/virtManager/connection.py
@@ -165,7 +165,7 @@ class vmmConnection(vmmGObject):
--- virt-manager-2.2.0.orig/virtManager/connection.py
+++ virt-manager-2.2.0/virtManager/connection.py
@@ -159,7 +159,7 @@ class vmmConnection(vmmGObject):
(_STATE_DISCONNECTED,
_STATE_CONNECTING,
@ -50,33 +37,24 @@ Index: virt-manager-2.1.0/virtManager/connection.py
def __init__(self, uri):
self._uri = uri
Index: virt-manager-2.1.0/virtManager/addhardware.py
Index: virt-manager-2.2.0/virtManager/addhardware.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/addhardware.py
+++ virt-manager-2.1.0/virtManager/addhardware.py
@@ -43,7 +43,7 @@ from .vsockdetails import vmmVsockDetail
--- virt-manager-2.2.0.orig/virtManager/addhardware.py
+++ virt-manager-2.2.0/virtManager/addhardware.py
@@ -44,7 +44,7 @@ from .xmleditor import vmmXMLEditor
PAGE_TPM,
PAGE_RNG,
PAGE_PANIC,
- PAGE_VSOCK) = range(18)
+ PAGE_VSOCK) = list(range(18))
- PAGE_VSOCK) = range(17)
+ PAGE_VSOCK) = list(range(17))
def _build_combo(combo, values, default_value=None, sort=True):
@@ -889,7 +889,7 @@ class vmmAddHardware(vmmGObjectUI):
self._dev = DeviceTpm(self.conn.get_backend())
self._dev.type = devtype
- for param_name, widget_name in tpm_widget_mappings.items():
+ for param_name, widget_name in list(tpm_widget_mappings.items()):
make_visible = self._dev.supports_property(param_name)
uiutil.set_grid_row_visible(self.widget(widget_name + "-label"),
make_visible)
Index: virt-manager-2.1.0/virtManager/snapshots.py
Index: virt-manager-2.2.0/virtManager/details/snapshots.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/snapshots.py
+++ virt-manager-2.1.0/virtManager/snapshots.py
@@ -30,7 +30,7 @@ mimemap = {
--- virt-manager-2.2.0.orig/virtManager/details/snapshots.py
+++ virt-manager-2.2.0/virtManager/details/snapshots.py
@@ -55,7 +55,7 @@ def _make_screenshot_pixbuf(mime, sdata)
def _mime_to_ext(val, reverse=False):
@ -85,11 +63,11 @@ Index: virt-manager-2.1.0/virtManager/snapshots.py
if val == m and not reverse:
return e
if val == e and reverse:
Index: virt-manager-2.1.0/virtManager/engine.py
Index: virt-manager-2.2.0/virtManager/engine.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/engine.py
+++ virt-manager-2.1.0/virtManager/engine.py
@@ -21,7 +21,7 @@ from .inspection import vmmInspection
--- virt-manager-2.2.0.orig/virtManager/engine.py
+++ virt-manager-2.2.0/virtManager/engine.py
@@ -22,7 +22,7 @@ from .lib.inspection import vmmInspectio
from .systray import vmmSystray
(PRIO_HIGH,
@ -98,10 +76,10 @@ Index: virt-manager-2.1.0/virtManager/engine.py
def _show_startup_error(fn):
Index: virt-manager-2.1.0/virtManager/mediacombo.py
Index: virt-manager-2.2.0/virtManager/device/mediacombo.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/mediacombo.py
+++ virt-manager-2.1.0/virtManager/mediacombo.py
--- virt-manager-2.2.0.orig/virtManager/device/mediacombo.py
+++ virt-manager-2.2.0/virtManager/device/mediacombo.py
@@ -22,7 +22,7 @@ class vmmMediaCombo(vmmGObjectUI):
(MEDIA_FIELD_PATH,
MEDIA_FIELD_LABEL,
@ -111,11 +89,11 @@ Index: virt-manager-2.1.0/virtManager/mediacombo.py
def __init__(self, conn, builder, topwin):
vmmGObjectUI.__init__(self, None, None, builder=builder, topwin=topwin)
Index: virt-manager-2.1.0/virtManager/manager.py
Index: virt-manager-2.2.0/virtManager/manager.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/manager.py
+++ virt-manager-2.1.0/virtManager/manager.py
@@ -36,7 +36,7 @@ ROW_IS_CONN_CONNECTED,
--- virt-manager-2.2.0.orig/virtManager/manager.py
+++ virt-manager-2.2.0/virtManager/manager.py
@@ -33,7 +33,7 @@ ROW_IS_CONN_CONNECTED,
ROW_IS_VM,
ROW_IS_VM_RUNNING,
ROW_COLOR,
@ -124,7 +102,7 @@ Index: virt-manager-2.1.0/virtManager/manager.py
# Columns in the tree view
(COL_NAME,
@@ -44,7 +44,7 @@ COL_GUEST_CPU,
@@ -41,7 +41,7 @@ COL_GUEST_CPU,
COL_HOST_CPU,
COL_MEM,
COL_DISK,
@ -133,11 +111,11 @@ Index: virt-manager-2.1.0/virtManager/manager.py
def _style_get_prop(widget, propname):
Index: virt-manager-2.1.0/virtManager/addstorage.py
Index: virt-manager-2.2.0/virtManager/device/addstorage.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/addstorage.py
+++ virt-manager-2.1.0/virtManager/addstorage.py
@@ -148,7 +148,7 @@ class vmmAddStorage(vmmGObjectUI):
--- virt-manager-2.2.0.orig/virtManager/device/addstorage.py
+++ virt-manager-2.2.0/virtManager/device/addstorage.py
@@ -108,7 +108,7 @@ class vmmAddStorage(vmmGObjectUI):
errmsg = _("Errors were encountered changing permissions for the "
"following directories:")
details = ""
@ -146,29 +124,29 @@ Index: virt-manager-2.1.0/virtManager/addstorage.py
if p not in broken_paths:
continue
details += "%s : %s\n" % (p, error)
Index: virt-manager-2.1.0/virtManager/details.py
Index: virt-manager-2.2.0/virtManager/details/details.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/details.py
+++ virt-manager-2.1.0/virtManager/details.py
@@ -105,7 +105,7 @@ from .vsockdetails import vmmVsockDetail
--- virt-manager-2.2.0.orig/virtManager/details/details.py
+++ virt-manager-2.2.0/virtManager/details/details.py
@@ -104,7 +104,7 @@ from ..xmleditor import vmmXMLEditor
EDIT_FS,
- EDIT_HOSTDEV_ROMBAR) = range(1, 58)
+ EDIT_HOSTDEV_ROMBAR) = list(range(1, 58))
- EDIT_HOSTDEV_ROMBAR) = range(1, 59)
+ EDIT_HOSTDEV_ROMBAR) = list(range(1, 59))
# Columns in hw list model
@@ -113,7 +113,7 @@ from .vsockdetails import vmmVsockDetail
@@ -112,7 +112,7 @@ from ..xmleditor import vmmXMLEditor
HW_LIST_COL_ICON_NAME,
HW_LIST_COL_ICON_SIZE,
HW_LIST_COL_TYPE,
- HW_LIST_COL_DEVICE) = range(5)
+ HW_LIST_COL_DEVICE) = list(range(5))
HW_LIST_COL_DEVICE,
- HW_LIST_COL_KEY) = range(5)
+ HW_LIST_COL_KEY) = list(range(5))
# Types for the hw list model: numbers specify what order they will be listed
(HW_LIST_TYPE_GENERAL,
@@ -138,7 +138,7 @@ from .vsockdetails import vmmVsockDetail
@@ -137,7 +137,7 @@ from ..xmleditor import vmmXMLEditor
HW_LIST_TYPE_TPM,
HW_LIST_TYPE_RNG,
HW_LIST_TYPE_PANIC,
@ -177,26 +155,20 @@ Index: virt-manager-2.1.0/virtManager/details.py
remove_pages = [HW_LIST_TYPE_NIC, HW_LIST_TYPE_INPUT,
HW_LIST_TYPE_GRAPHICS, HW_LIST_TYPE_SOUND, HW_LIST_TYPE_CHAR,
@@ -153,12 +153,12 @@ remove_pages = [HW_LIST_TYPE_NIC, HW_LIS
@@ -152,7 +152,7 @@ remove_pages = [HW_LIST_TYPE_NIC, HW_LIS
BOOT_LABEL,
BOOT_ICON,
BOOT_ACTIVE,
- BOOT_CAN_SELECT) = range(5)
+ BOOT_CAN_SELECT) = list(range(5))
# Main tab pages
(DETAILS_PAGE_DETAILS,
DETAILS_PAGE_CONSOLE,
- DETAILS_PAGE_SNAPSHOTS) = range(3)
+ DETAILS_PAGE_SNAPSHOTS) = list(range(3))
Index: virt-manager-2.1.0/virtManager/create.py
def _calculate_disk_bus_index(disklist):
Index: virt-manager-2.2.0/virtManager/createvm.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/create.py
+++ virt-manager-2.1.0/virtManager/create.py
@@ -43,7 +43,7 @@ DEFAULT_MEM = 1024
--- virt-manager-2.2.0.orig/virtManager/createvm.py
+++ virt-manager-2.2.0/virtManager/createvm.py
@@ -40,7 +40,7 @@ DEFAULT_MEM = 1024
PAGE_INSTALL,
PAGE_MEM,
PAGE_STORAGE,
@ -205,7 +177,7 @@ Index: virt-manager-2.1.0/virtManager/create.py
(INSTALL_PAGE_ISO,
INSTALL_PAGE_URL,
@@ -51,13 +51,13 @@ DEFAULT_MEM = 1024
@@ -48,13 +48,13 @@ DEFAULT_MEM = 1024
INSTALL_PAGE_IMPORT,
INSTALL_PAGE_CONTAINER_APP,
INSTALL_PAGE_CONTAINER_OS,
@ -221,7 +193,7 @@ Index: virt-manager-2.1.0/virtManager/create.py
#####################
@@ -2159,7 +2159,7 @@ class vmmCreate(vmmGObjectUI):
@@ -2127,7 +2127,7 @@ class vmmCreateVM(vmmGObjectUI):
'insecure': self._get_config_oscontainer_isecure,
'root_password': self._get_config_oscontainer_root_password,
}
@ -230,11 +202,11 @@ Index: virt-manager-2.1.0/virtManager/create.py
bootstrap_args[key] = getter()
parentobj = self._customize_window or self
Index: virt-manager-2.1.0/virtManager/preferences.py
Index: virt-manager-2.2.0/virtManager/preferences.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/preferences.py
+++ virt-manager-2.1.0/virtManager/preferences.py
@@ -127,7 +127,7 @@ class vmmPreferences(vmmGObjectUI):
--- virt-manager-2.2.0.orig/virtManager/preferences.py
+++ virt-manager-2.2.0/virtManager/preferences.py
@@ -129,7 +129,7 @@ class vmmPreferences(vmmGObjectUI):
}
model.append([-1, _("System default (%s)") %
vals[self.config.default_console_resizeguest]])
@ -243,11 +215,11 @@ Index: virt-manager-2.1.0/virtManager/preferences.py
model.append([key, val])
combo.set_model(model)
uiutil.init_combo_text_column(combo, 1)
Index: virt-manager-2.1.0/virtManager/migrate.py
Index: virt-manager-2.2.0/virtManager/migrate.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/migrate.py
+++ virt-manager-2.1.0/virtManager/migrate.py
@@ -23,7 +23,7 @@ from .domain import vmmDomain
--- virt-manager-2.2.0.orig/virtManager/migrate.py
+++ virt-manager-2.2.0/virtManager/migrate.py
@@ -23,7 +23,7 @@ from .object.domain import vmmDomain
NUM_COLS = 3
(COL_LABEL,
COL_URI,
@ -256,11 +228,11 @@ Index: virt-manager-2.1.0/virtManager/migrate.py
class vmmMigrateDialog(vmmGObjectUI):
Index: virt-manager-2.1.0/virtManager/storagelist.py
Index: virt-manager-2.2.0/virtManager/hoststorage.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/storagelist.py
+++ virt-manager-2.1.0/virtManager/storagelist.py
@@ -30,13 +30,13 @@ VOL_NUM_COLUMNS = 7
--- virt-manager-2.2.0.orig/virtManager/hoststorage.py
+++ virt-manager-2.2.0/virtManager/hoststorage.py
@@ -32,13 +32,13 @@ VOL_NUM_COLUMNS = 7
VOL_COLUMN_SIZESTR,
VOL_COLUMN_FORMAT,
VOL_COLUMN_INUSEBY,
@ -276,16 +248,3 @@ Index: virt-manager-2.1.0/virtManager/storagelist.py
ICON_RUNNING = "state_running"
ICON_SHUTOFF = "state_shutoff"
Index: virt-manager-2.1.0/virtManager/createnet.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/createnet.py
+++ virt-manager-2.1.0/virtManager/createnet.py
@@ -20,7 +20,7 @@ from .baseclass import vmmGObjectUI
(PAGE_NAME,
PAGE_IPV4,
PAGE_IPV6,
-PAGE_MISC) = range(4)
+PAGE_MISC) = list(range(4))
PAGE_MAX = PAGE_MISC

View File

@ -6,11 +6,11 @@ it is not recognized as a top level dialog on python3 and therefore we explicitl
need to set the connection event. Not getting the event to cleanup leaves us in a
bad state for when the details dialog is reopened.
Index: virt-manager-2.1.0/virtManager/details.py
Index: virt-manager-2.2.0/virtManager/vmwindow.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/details.py
+++ virt-manager-2.1.0/virtManager/details.py
@@ -635,6 +635,9 @@ class vmmDetails(vmmGObjectUI):
--- virt-manager-2.2.0.orig/virtManager/vmwindow.py
+++ virt-manager-2.2.0/virtManager/vmwindow.py
@@ -141,6 +141,9 @@ class vmmVMWindow(vmmGObjectUI):
self.console.details_auth_login),
})

View File

@ -1,46 +1,22 @@
Enhancement that gets installation repos from zypper.
These locations are then presented as potential installation
sources when creating a VM.
Index: virt-manager-2.1.0/virtManager/create.py
Index: virt-manager-2.2.0/virtManager/createvm.py
===================================================================
--- virt-manager-2.1.0.orig/virtManager/create.py
+++ virt-manager-2.1.0/virtManager/create.py
@@ -371,7 +371,13 @@ class vmmCreate(vmmGObjectUI):
self.widget("install-url-entry").set_text("")
self.widget("install-url-options").set_expanded(False)
urlmodel = self.widget("install-url-combo").get_model()
- _populate_media_model(urlmodel, self.config.get_media_urls())
+ urllist = self.config.get_media_urls()
+ (index, inst_repos) = util.getInstallRepos()
+ for u in urllist:
+ if u in inst_repos:
+ inst_repos.remove(u)
+ media_urllist = urllist + inst_repos
+ _populate_media_model(urlmodel, media_urllist)
--- virt-manager-2.2.0.orig/virtManager/createvm.py
+++ virt-manager-2.2.0/virtManager/createvm.py
@@ -99,6 +99,69 @@ def is_virt_bootstrap_installed():
return pkgutil.find_loader('virtBootstrap') is not None
# Install import
self.widget("install-import-entry").set_text("")
Index: virt-manager-2.1.0/virtinst/util.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/util.py
+++ virt-manager-2.1.0/virtinst/util.py
@@ -10,9 +10,12 @@ import os
import random
import re
import sys
+################################################
+# Helpers for using SUSE installation location #
+################################################
+
+import subprocess
+from subprocess import Popen, PIPE
import libvirt
+
+_host_repo_url = None
def listify(l):
if l is None:
@@ -291,3 +294,57 @@ def make_meter(quiet):
if quiet:
return progress.BaseMeter()
return progress.TextMeter(fo=sys.stdout)
+
+def getHostInstallSource():
+ global _host_repo_url
@ -95,3 +71,22 @@ Index: virt-manager-2.1.0/virtinst/util.py
+ return (0, [])
+ return lookupZypperRepos(getHostInstallSource())
+
+
##############
# Main class #
##############
@@ -368,7 +431,13 @@ class vmmCreateVM(vmmGObjectUI):
self.widget("install-url-entry").set_text("")
self.widget("install-url-options").set_expanded(False)
urlmodel = self.widget("install-url-combo").get_model()
- _populate_media_model(urlmodel, self.config.get_media_urls())
+ urllist = self.config.get_media_urls()
+ (index, inst_repos) = getInstallRepos()
+ for u in urllist:
+ if u in inst_repos:
+ inst_repos.remove(u)
+ media_urllist = urllist + inst_repos
+ _populate_media_model(urlmodel, media_urllist)
# Install import
self.widget("install-import-entry").set_text("")

View File

@ -1,20 +1,20 @@
Index: virt-manager-2.1.0/tests/clitest.py
Index: virt-manager-2.2.0/tests/clitest.py
===================================================================
--- virt-manager-2.1.0.orig/tests/clitest.py
+++ virt-manager-2.1.0/tests/clitest.py
@@ -204,7 +204,7 @@ class Command(object):
--- virt-manager-2.2.0.orig/tests/clitest.py
+++ virt-manager-2.2.0/tests/clitest.py
@@ -300,7 +300,7 @@ class Command(object):
try:
conn = None
- for idx in reversed(range(len(self.argv))):
+ for idx in reversed(list(range(len(self.argv)))):
if self.argv[idx] == "--connect":
conn = utils.URIs.openconn(self.argv[idx + 1])
break
Index: virt-manager-2.1.0/tests/test_inject.py
def _run(self):
conn = None
- for idx in reversed(range(len(self.argv))):
+ for idx in reversed(list(range(len(self.argv)))):
if self.argv[idx] == "--connect":
conn = utils.URIs.openconn(self.argv[idx + 1])
break
Index: virt-manager-2.2.0/tests/test_inject.py
===================================================================
--- virt-manager-2.1.0.orig/tests/test_inject.py
+++ virt-manager-2.1.0/tests/test_inject.py
--- virt-manager-2.2.0.orig/tests/test_inject.py
+++ virt-manager-2.2.0/tests/test_inject.py
@@ -15,7 +15,7 @@ FEDORA_URL = "http://dl.fedoraproject.or
(WARN_RHEL5,
@ -24,7 +24,7 @@ Index: virt-manager-2.1.0/tests/test_inject.py
def prompt():
@@ -115,7 +115,7 @@ def _make_tests():
@@ -117,7 +117,7 @@ def _make_tests():
return lambda s: _test_distro(_d)
idx = 0