Hello community,

here is the log from the commit of package virt-manager for openSUSE:Factory 
checked in at 2016-09-13 22:24:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/virt-manager (Old)
 and      /work/SRC/openSUSE:Factory/.virt-manager.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "virt-manager"

Changes:
--------
--- /work/SRC/openSUSE:Factory/virt-manager/virt-manager.changes        
2016-08-25 09:57:08.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.virt-manager.new/virt-manager.changes   
2016-09-13 22:25:21.000000000 +0200
@@ -1,0 +2,21 @@
+Thu Sep  8 13:50:49 MDT 2016 - carn...@suse.com
+
+- bsc#996020 - L3: Unable to migrate VMs between SLES12 SP1 XEN
+  Hosts with virt-manager
+  0425975f-use-virDomainMigrate3-API.patch
+  561f5cd3-drop-xenmigr-scheme-from-Xen-migration-URI.patch
+
+-------------------------------------------------------------------
+Thu Sep  8 10:03:24 MDT 2016 - carn...@suse.com
+
+- fate#319621 - KVM: Provide SMBIOS info to KVM virtual machines
+  d8a0a788-xmlbuilder-01.patch
+  559e813b-xmlbuilder-02.patch
+  a931a1a6-xmlbuilder-03.patch
+  835ddc5f-xmlbuilder-04.patch
+  b08647c2-xmlbuilder-05.patch
+  b31c0b44-Add-classes-for-defining-SMBios-information.patch
+  a3206f89-Add-the-sysinfo-option.patch
+  63784f4d-document-new-sysinfo-option.patch
+
+-------------------------------------------------------------------

New:
----
  0425975f-use-virDomainMigrate3-API.patch
  559e813b-xmlbuilder-02.patch
  561f5cd3-drop-xenmigr-scheme-from-Xen-migration-URI.patch
  63784f4d-document-new-sysinfo-option.patch
  835ddc5f-xmlbuilder-04.patch
  a3206f89-Add-the-sysinfo-option.patch
  a931a1a6-xmlbuilder-03.patch
  b08647c2-xmlbuilder-05.patch
  b31c0b44-Add-classes-for-defining-SMBios-information.patch
  d8a0a788-xmlbuilder-01.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ virt-manager.spec ++++++
--- /var/tmp/diff_new_pack.HGrPyM/_old  2016-09-13 22:25:23.000000000 +0200
+++ /var/tmp/diff_new_pack.HGrPyM/_new  2016-09-13 22:25:23.000000000 +0200
@@ -40,6 +40,16 @@
 Patch1:         e69cc002-spice-catch-failure-to-setup-usbdev-manager.patch
 Patch2:         c5ce0ab5-connection-fix-transport-detection.patch
 Patch3:         6daff68a-fix-italian-lang-file.patch
+Patch4:         d8a0a788-xmlbuilder-01.patch
+Patch5:         559e813b-xmlbuilder-02.patch
+Patch6:         a931a1a6-xmlbuilder-03.patch
+Patch7:         835ddc5f-xmlbuilder-04.patch
+Patch8:         b08647c2-xmlbuilder-05.patch
+Patch9:         b31c0b44-Add-classes-for-defining-SMBios-information.patch
+Patch10:        a3206f89-Add-the-sysinfo-option.patch
+Patch11:        63784f4d-document-new-sysinfo-option.patch
+Patch12:        0425975f-use-virDomainMigrate3-API.patch
+Patch13:        561f5cd3-drop-xenmigr-scheme-from-Xen-migration-URI.patch
 # SUSE Only
 Patch70:        virtman-desktop.patch
 Patch71:        virtman-kvm.patch
@@ -160,6 +170,16 @@
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
+%patch11 -p1
+%patch12 -p1
+%patch13 -p1
 # SUSE Only
 %patch70 -p1
 %patch71 -p1

++++++ 0425975f-use-virDomainMigrate3-API.patch ++++++
References: bsc#996020

Subject: virt-manager: use virDomainMigrate3 API
From: Jim Fehlig jfeh...@suse.com Wed Aug 31 11:26:24 2016 -0600
Date: Thu Sep 8 11:47:45 2016 -0400:
Git: 0425975f38cec8fca6fd6ad600985403b9d24adb

libvirt has supported the migration V3 protocol for many years now.
A nice feature of the virDomainMigrate3 API is that it will detect
the protocol version supported by the underlying hypervisor,
including whether it supports the extensible parameters variant,
and call the hypervisor API with parameters fixed up as needed.

Change virt-manager to use the virDomainMigrate3 API, allowing
migration to work with hypervisors that only support the extensible
parameters variant of the migration V3 API.

Signed-off-by: Jim Fehlig <jfeh...@suse.com>

Index: virt-manager-1.4.0/virtManager/domain.py
===================================================================
--- virt-manager-1.4.0.orig/virtManager/domain.py
+++ virt-manager-1.4.0/virtManager/domain.py
@@ -1487,7 +1487,11 @@ class vmmDomain(vmmLibvirtObject):
         if meter:
             start_job_progress_thread(self, meter, _("Migrating domain"))
 
-        self._backend.migrate(libvirt_destconn, flags, None, interface, 0)
+        params = {}
+        if interface:
+            params[libvirt.VIR_MIGRATE_PARAM_URI] = interface
+
+        self._backend.migrate3(libvirt_destconn, params, flags)
 
         # Don't schedule any conn update, migrate dialog handles it for us
 
++++++ 559e813b-xmlbuilder-02.patch ++++++
References: fate#319621

Subject: xmlbuilder: Clarify the node 'pretty' helper function
From: Cole Robinson crobi...@redhat.com Mon Jul 18 13:23:43 2016 -0400
Date: Mon Jul 18 14:46:50 2016 -0400:
Git: 559e813b966c8e062740dd64d87f3193b0413771


Index: virt-manager-1.4.0/virtinst/xmlbuilder.py
===================================================================
--- virt-manager-1.4.0.orig/virtinst/xmlbuilder.py
+++ virt-manager-1.4.0/virtinst/xmlbuilder.py
@@ -98,14 +98,13 @@ def _get_xpath_node(ctx, xpath):
     return (node and node[0] or None)
 
 
-def _build_xpath_node(ctx, xpath, addnode=None):
+def _add_pretty_child(parentnode, newnode):
     """
-    Build all nodes required to set an xpath. If we have XML <foo/>, and want
-    to set xpath /foo/bar/baz@booyeah, we create node 'bar' and 'baz'
-    returning the last node created.
+    Add 'newnode' as a child of 'parentnode', but try to preserve
+    whitespace and nicely format the result.
     """
-    parentpath = ""
-    parentnode = None
+    def node_is_text(n):
+        return bool(n and n.type == "text" and not n.content.count("<"))
 
     def prevSibling(node):
         parent = node.get_parent()
@@ -120,47 +119,51 @@ def _build_xpath_node(ctx, xpath, addnod
 
         return None
 
-    def make_node(parentnode, newnode):
-        # Add the needed parent node, try to preserve whitespace by
-        # looking for a starting TEXT node, and copying it
-        def node_is_text(n):
-            return bool(n and n.type == "text" and not n.content.count("<"))
-
-        sib = parentnode.get_last()
-        if not node_is_text(sib):
-            # This case is when we add a child element to a node for the
-            # first time, like:
-            #
-            # <features/>
-            # to
-            # <features>
-            #   <acpi/>
-            # </features>
-            prevsib = prevSibling(parentnode)
-            if node_is_text(prevsib):
-                sib = libxml2.newText(prevsib.content)
-            else:
-                sib = libxml2.newText("\n")
-            parentnode.addChild(sib)
-
-        # This case is adding a child element to an already properly
-        # spaced element. Example:
-        # <features>
-        #   <acpi/>
-        # </features>
+    sib = parentnode.get_last()
+    if not node_is_text(sib):
+        # This case is when we add a child element to a node for the
+        # first time, like:
+        #
+        # <features/>
         # to
         # <features>
         #   <acpi/>
-        #   <apic/>
         # </features>
-        sib = parentnode.get_last()
-        content = sib.content
-        sib = sib.addNextSibling(libxml2.newText("  "))
-        txt = libxml2.newText(content)
-
-        sib.addNextSibling(newnode)
-        newnode.addNextSibling(txt)
-        return newnode
+        prevsib = prevSibling(parentnode)
+        if node_is_text(prevsib):
+            sib = libxml2.newText(prevsib.content)
+        else:
+            sib = libxml2.newText("\n")
+        parentnode.addChild(sib)
+
+    # This case is adding a child element to an already properly
+    # spaced element. Example:
+    # <features>
+    #   <acpi/>
+    # </features>
+    # to
+    # <features>
+    #   <acpi/>
+    #   <apic/>
+    # </features>
+    sib = parentnode.get_last()
+    content = sib.content
+    sib = sib.addNextSibling(libxml2.newText("  "))
+    txt = libxml2.newText(content)
+
+    sib.addNextSibling(newnode)
+    newnode.addNextSibling(txt)
+    return newnode
+
+
+def _build_xpath_node(ctx, xpath, addnode=None):
+    """
+    Build all nodes required to set an xpath. If we have XML <foo/>, and want
+    to set xpath /foo/bar/baz@booyeah, we create node 'bar' and 'baz'
+    returning the last node created.
+    """
+    parentpath = ""
+    parentnode = None
 
     nodelist = xpath.split("/")
     for nodename in nodelist:
@@ -192,10 +195,10 @@ def _build_xpath_node(ctx, xpath, addnod
             nodename = nodename[:nodename.index("[")]
 
         newnode = libxml2.newNode(nodename)
-        parentnode = make_node(parentnode, newnode)
+        parentnode = _add_pretty_child(parentnode, newnode)
 
     if addnode:
-        parentnode = make_node(parentnode, addnode)
+        parentnode = _add_pretty_child(parentnode, addnode)
 
     return parentnode
 
++++++ 561f5cd3-drop-xenmigr-scheme-from-Xen-migration-URI.patch ++++++
References: bsc#996020

Subject: virt-manager: drop 'xenmigr' scheme from Xen migration URI
From: Jim Fehlig jfeh...@suse.com Tue Sep 6 22:55:42 2016 -0600
Date: Thu Sep 8 11:47:52 2016 -0400:
Git: 561f5cd3e68fa3f1fb6745463a5c1a486171d8c9

For Xen, virt-manager uses a 'xenmigr' URI scheme, which is not
supported by the libvirt libxl driver. Attempting migration
fails with

libvirtError: invalid argument: unable to parse URI: xenmigr://myhost

The old xend-based libvirt driver supports this scheme, but also
supports an empty scheme. It's not clear what the 'xenmigr' scheme
is used for. 'xenmigr' is not referenced by any files in the Xen
code-base, including old branches with xend.

Drop setting scheme to 'xenmigr' when creating the Xen migration URI.

Signed-off-by: Jim Fehlig <jfeh...@suse.com>

Index: virt-manager-1.4.0/virtManager/migrate.py
===================================================================
--- virt-manager-1.4.0.orig/virtManager/migrate.py
+++ virt-manager-1.4.0/virtManager/migrate.py
@@ -344,7 +344,7 @@ class vmmMigrateDialog(vmmGObjectUI):
             return
 
         if self.conn.is_xen():
-            uri = "xenmigr://%s" % address
+            uri = "%s" % address
         else:
             uri = "tcp:%s" % address
         if port:
++++++ 63784f4d-document-new-sysinfo-option.patch ++++++
Subject: man: Document new --sysinfo option
From: Cole Robinson crobi...@redhat.com Thu Sep 8 11:42:45 2016 -0400
Date: Thu Sep 8 11:42:45 2016 -0400:
Git: 63784f4dd82caaf164fa93a1685cbe5272b68404


Index: virt-manager-1.4.0/man/virt-install.pod
===================================================================
--- virt-manager-1.4.0.orig/man/virt-install.pod
+++ virt-manager-1.4.0/man/virt-install.pod
@@ -135,6 +135,12 @@ Specify resource partitioning for the gu
 
 Use --resource=? to see a list of all available sub options. Complete details 
at L<http://libvirt.org/formatdomain.html#resPartition>
 
+=item B<--sysinfo> OPT=VAL,[...]
+
+Configure sysinfo/SMBIOS values exposed to the guest OS. '--sysinfo host' can 
be used to expose the host's SMBIOS info to the VM, otherwise values can be 
manually specified.
+
+Use --sysinfo=? to see a list of all available sub options. Complete details 
at L<http://libvirt.org/formatdomain.html#elementsSysinfo>
+
 =item B<--vcpus> OPTIONS
 
 Number of virtual cpus to configure for the guest. If 'maxvcpus' is specified,
++++++ 835ddc5f-xmlbuilder-04.patch ++++++
References: fate#319621

Subject: xmlbuilder: More comments for _build_xpath_node
From: Cole Robinson crobi...@redhat.com Mon Jul 18 13:50:25 2016 -0400
Date: Mon Jul 18 14:46:50 2016 -0400:
Git: 835ddc5f7710d195a8d069358693712e68f2b353


Index: virt-manager-1.4.0/virtinst/xmlbuilder.py
===================================================================
--- virt-manager-1.4.0.orig/virtinst/xmlbuilder.py
+++ virt-manager-1.4.0/virtinst/xmlbuilder.py
@@ -158,44 +158,56 @@ def _add_pretty_child(parentnode, newnod
 
 def _build_xpath_node(ctx, xpath):
     """
-    Build all nodes required to set an xpath. If we have XML <foo/>, and want
-    to set xpath /foo/bar/baz@booyeah, we create node 'bar' and 'baz'
-    returning the last node created.
-    """
-    parentpath = ""
-    parentnode = None
+    Build all nodes for the passed xpath. For example, if 'ctx' xml=<foo/>,
+    and xpath=./bar/@baz, after this function the 'ctx' XML will be:
 
-    nodelist = xpath.split("/")
-    for nodename in nodelist:
-        if not nodename:
-            continue
+      <foo>
+        <bar baz=''/>
+      </foo>
+
+    And the node pointing to @baz will be returned, for the caller to
+    do with as they please.
+    """
+    def _handle_node(nodename, parentnode, parentpath):
+        # If the passed xpath snippet (nodename) exists, return the node
+        # If it doesn't exist, create it, and return the new node
 
-        # If xpath is a node property, set it and move on
+        # If nodename is a node property, we can handle it up front
         if nodename.startswith("@"):
             nodename = nodename.strip("@")
-            parentnode = parentnode.setProp(nodename, "")
-            continue
+            return parentnode.setProp(nodename, ""), parentpath
 
         if not parentpath:
             parentpath = nodename
         else:
             parentpath += "/%s" % nodename
 
-        # Node found, nothing to create for now
+        # See if the xpath node already exists
         node = _get_xpath_node(ctx, parentpath)
         if node:
-            parentnode = node
-            continue
+            # xpath node already exists, so we don't need to create anything
+            return node, parentpath
 
+        # If we don't have a parentnode by this point, the root of the
+        # xpath didn't find anything. Usually a coding error
         if not parentnode:
             raise RuntimeError("Could not find XML root node")
 
-        # Remove conditional xpath elements for node creation
+        # Remove conditional xpath elements for node creation. We preserved
+        # them up until this point since it was needed for proper xpath
+        # lookup, but they aren't valid syntax when creating the node
         if nodename.count("["):
             nodename = nodename[:nodename.index("[")]
 
         newnode = libxml2.newNode(nodename)
-        parentnode = _add_pretty_child(parentnode, newnode)
+        return _add_pretty_child(parentnode, newnode), parentpath
+
+
+    # Split the xpath and lookup/create each individual piece
+    parentpath = None
+    parentnode = None
+    for nodename in xpath.split("/"):
+        parentnode, parentpath = _handle_node(nodename, parentnode, parentpath)
 
     return parentnode
 
++++++ a3206f89-Add-the-sysinfo-option.patch ++++++
Subject: virtinst: Add the --sysinfo option
From: Charles Arnold carn...@suse.com Tue Sep 6 16:12:20 2016 -0600
Date: Thu Sep 8 11:36:59 2016 -0400:
Git: a3206f89c89ff4f197748f2a7d1040380afc835d

Allow passing SMBios information to the guest using the new sysinfo
option. Also update the appropriate files with test cases.

Index: 
virt-manager-1.4.0/tests/cli-test-xml/compare/virt-install-singleton-config-2.xml
===================================================================
--- 
virt-manager-1.4.0.orig/tests/cli-test-xml/compare/virt-install-singleton-config-2.xml
+++ 
virt-manager-1.4.0/tests/cli-test-xml/compare/virt-install-singleton-config-2.xml
@@ -36,6 +36,7 @@
     <boot dev="fd"/>
     <boot dev="hd"/>
     <boot dev="network"/>
+    <smbios mode="sysinfo"/>
     <bootmenu enable="no"/>
   </os>
   <idmap>
@@ -122,6 +123,31 @@
   <seclabel type="static" model="selinux" relabel="yes">
     <label>system_u:object_r:svirt_image_t:s0:c100,c200</label>
   </seclabel>
+  <sysinfo type="smbios">
+    <bios>
+      <entry name="vendor">Acme LLC</entry>
+      <entry name="version">1.2.3</entry>
+      <entry name="date">01/01/1970</entry>
+      <entry name="release">10.22</entry>
+    </bios>
+    <system>
+      <entry name="manufacturer">Acme Inc.</entry>
+      <entry name="product">Computer</entry>
+      <entry name="version">3.2.1</entry>
+      <entry name="serial">123456789</entry>
+      <entry name="uuid">00000000-1111-2222-3333-444444444444</entry>
+      <entry name="sku">abc-123</entry>
+      <entry name="family">Server</entry>
+    </system>
+    <baseBoard>
+      <entry name="manufacturer">Acme Corp.</entry>
+      <entry name="product">Motherboard</entry>
+      <entry name="version">A01</entry>
+      <entry name="serial">1234-5678</entry>
+      <entry name="asset">Tag</entry>
+      <entry name="location">Chassis</entry>
+    </baseBoard>
+  </sysinfo>
   <on_lockfailure>ignore</on_lockfailure>
 </domain>
 <domain type="kvm">
@@ -162,6 +188,7 @@
     <boot dev="fd"/>
     <boot dev="hd"/>
     <boot dev="network"/>
+    <smbios mode="sysinfo"/>
     <bootmenu enable="no"/>
   </os>
   <idmap>
@@ -248,5 +275,30 @@
   <seclabel type="static" model="selinux" relabel="yes">
     <label>system_u:object_r:svirt_image_t:s0:c100,c200</label>
   </seclabel>
+  <sysinfo type="smbios">
+    <bios>
+      <entry name="vendor">Acme LLC</entry>
+      <entry name="version">1.2.3</entry>
+      <entry name="date">01/01/1970</entry>
+      <entry name="release">10.22</entry>
+    </bios>
+    <system>
+      <entry name="manufacturer">Acme Inc.</entry>
+      <entry name="product">Computer</entry>
+      <entry name="version">3.2.1</entry>
+      <entry name="serial">123456789</entry>
+      <entry name="uuid">00000000-1111-2222-3333-444444444444</entry>
+      <entry name="sku">abc-123</entry>
+      <entry name="family">Server</entry>
+    </system>
+    <baseBoard>
+      <entry name="manufacturer">Acme Corp.</entry>
+      <entry name="product">Motherboard</entry>
+      <entry name="version">A01</entry>
+      <entry name="serial">1234-5678</entry>
+      <entry name="asset">Tag</entry>
+      <entry name="location">Chassis</entry>
+    </baseBoard>
+  </sysinfo>
   <on_lockfailure>ignore</on_lockfailure>
 </domain>
Index: virt-manager-1.4.0/tests/clitest.py
===================================================================
--- virt-manager-1.4.0.orig/tests/clitest.py
+++ virt-manager-1.4.0/tests/clitest.py
@@ -427,6 +427,9 @@ c.add_compare("""--pxe \
 --memorybacking size=1,unit='G',nodeset='1,2-5',nosharepages=yes,locked=yes \
 --features 
acpi=off,eoi=on,privnet=on,hyperv_spinlocks=on,hyperv_spinlocks_retries=1234,vmport=off,pmu=off
 \
 --clock offset=utc,hpet_present=no,rtc_tickpolicy=merge \
+--sysinfo type=smbios,bios_vendor="Acme 
LLC",bios_version=1.2.3,bios_date=01/01/1970,bios_release=10.22 \
+--sysinfo type=smbios,system_manufacturer="Acme 
Inc.",system_product=Computer,system_version=3.2.1,system_serial=123456789,system_uuid=00000000-1111-2222-3333-444444444444,system_sku=abc-123,system_family=Server
 \
+--sysinfo type=smbios,baseBoard_manufacturer="Acme 
Corp.",baseBoard_product=Motherboard,baseBoard_version=A01,baseBoard_serial=1234-5678,baseBoard_asset=Tag,baseBoard_location=Chassis
 \
 --pm suspend_to_mem=yes,suspend_to_disk=no \
 --resource partition=/virtualmachines/production \
 --events 
on_poweroff=destroy,on_reboot=restart,on_crash=preserve,on_lockfailure=ignore \
Index: virt-manager-1.4.0/virtinst/cli.py
===================================================================
--- virt-manager-1.4.0.orig/virtinst/cli.py
+++ virt-manager-1.4.0/virtinst/cli.py
@@ -21,6 +21,7 @@
 
 import argparse
 import collections
+import datetime
 import logging
 import logging.handlers
 import os
@@ -67,6 +68,7 @@ from .osxml import OSXML
 from .pm import PM
 from .seclabel import Seclabel
 from .storage import StoragePool, StorageVolume
+from .sysinfo import SYSInfo
 
 
 ##########################
@@ -722,6 +724,13 @@ def add_guest_xml_options(geng):
         help=_("Configure VM lifecycle management policy"))
     geng.add_argument("--resource", action="append",
         help=_("Configure VM resource partitioning (cgroups)"))
+    geng.add_argument("--sysinfo", action="append",
+        help=_("Configure SMBIOS System Information. Ex:\n"
+               "--sysinfo emulate\n"
+               "--sysinfo host\n"
+               "--sysinfo bios_vendor=Vendor_Inc.,bios_version=1.2.3-abc,...\n"
+               "--sysinfo 
system_manufacturer=System_Corp.,system_product=Computer,...\n"
+               "--sysinfo 
baseBoard_manufacturer=Baseboard_Corp.,baseBoard_product=Motherboard,...\n"))
 
 
 def add_boot_options(insg):
@@ -1541,6 +1550,13 @@ class ParserBoot(VirtCLIParser):
     def set_initargs_cb(self, inst, val, virtarg):
         inst.os.set_initargs_string(val)
 
+    def set_smbios_mode_cb(self, inst, val, virtarg):
+        if not val.startswith("emulate") and not val.startswith("host"):
+            inst.sysinfo.parse(val)
+            val = "sysinfo"
+        inst.os.smbios_mode = val
+        self.optdict["smbios_mode"] = val
+
     def noset_cb(self, inst, val, virtarg):
         pass
 
@@ -1584,6 +1600,8 @@ ParserBoot.add_arg("os.kernel_args", "ke
 ParserBoot.add_arg("os.init", "init")
 ParserBoot.add_arg("os.machine", "machine")
 ParserBoot.add_arg("os.initargs", "initargs", cb=ParserBoot.set_initargs_cb)
+ParserBoot.add_arg("os.smbios_mode", "smbios_mode",
+                   can_comma=True, cb=ParserBoot.set_smbios_mode_cb)
 
 # This is simply so the boot options are advertised with --boot help,
 # actual processing is handled by _parse
@@ -1702,6 +1720,95 @@ ParserPM.add_arg("suspend_to_mem", "susp
 ParserPM.add_arg("suspend_to_disk", "suspend_to_disk", is_onoff=True)
 
 
+#####################
+# --sysinfo parsing #
+#####################
+
+class ParserSYSInfo(VirtCLIParser):
+    cli_arg_name = "sysinfo"
+    objclass = SYSInfo
+    remove_first = "type"
+
+    def set_type_cb(self, inst, val, virtarg):
+        if val == "host" or val == "emulate":
+            self.guest.os.smbios_mode = val
+        elif val == "smbios":
+            self.guest.os.smbios_mode = "sysinfo"
+            inst.type = val
+        else:
+            fail(_("Unknown sysinfo flag '%s'") % val)
+
+    def validate_date_cb(self, inst, val, virtarg):
+        # If supplied, date must be in either mm/dd/yy or mm/dd/yyyy format
+        try:
+            datetime.datetime.strptime(val, '%m/%d/%Y')
+        except ValueError:
+            try:
+                datetime.datetime.strptime(val, '%m/%d/%y')
+            except ValueError:
+                raise RuntimeError(_("SMBios date string '%s' is invalid.")
+                            % val)
+        inst.bios_date = val
+        return val
+
+    def validate_uuid_cb(self, inst, val, virtarg):
+        # If a uuid is supplied it must match the guest UUID. This would be
+        # impossible to guess if the guest uuid is autogenerated so just
+        # overwrite the guest uuid with what is passed in assuming it passes
+        # the sanity checking below.
+        try:
+            util.validate_uuid(val)
+        except ValueError:
+            raise ValueError(_("Invalid uuid for SMBios: %s") % val)
+
+        if util.vm_uuid_collision(self.guest.conn, val):
+            raise ValueError(_("UUID '%s' is in use by another guest.") %
+                        val)
+
+        # Override guest uuid with passed in SMBios value (they must match)
+        self.guest.uuid = val
+        inst.system_uuid = val
+
+    def _parse(self, inst):
+        if self.optstr == "none":
+            self.guest.skip_default_sysinfo = True
+            return
+        if self.optstr == "host" or self.optstr == "emulate":
+            self.optdict['type'] = self.optstr
+
+        return VirtCLIParser._parse(self, inst)
+
+_register_virt_parser(ParserSYSInfo)
+# <sysinfo type='smbios'>
+ParserSYSInfo.add_arg("type", "type",
+                      cb=ParserSYSInfo.set_type_cb, can_comma=True)
+
+# <bios> type 0 BIOS Information
+ParserSYSInfo.add_arg("bios_vendor", "bios_vendor")
+ParserSYSInfo.add_arg("bios_version", "bios_version")
+ParserSYSInfo.add_arg("bios_date", "bios_date",
+                      cb=ParserSYSInfo.validate_date_cb)
+ParserSYSInfo.add_arg("bios_release", "bios_release")
+
+# <system> type 1 System Information
+ParserSYSInfo.add_arg("system_manufacturer", "system_manufacturer")
+ParserSYSInfo.add_arg("system_product", "system_product")
+ParserSYSInfo.add_arg("system_version", "system_version")
+ParserSYSInfo.add_arg("system_serial", "system_serial")
+ParserSYSInfo.add_arg("system_uuid", "system_uuid",
+                      cb=ParserSYSInfo.validate_uuid_cb)
+ParserSYSInfo.add_arg("system_sku", "system_sku")
+ParserSYSInfo.add_arg("system_family", "system_family")
+
+# <baseBoard> type 2 Baseboard (or Module) Information
+ParserSYSInfo.add_arg("baseBoard_manufacturer", "baseBoard_manufacturer")
+ParserSYSInfo.add_arg("baseBoard_product", "baseBoard_product")
+ParserSYSInfo.add_arg("baseBoard_version", "baseBoard_version")
+ParserSYSInfo.add_arg("baseBoard_serial", "baseBoard_serial")
+ParserSYSInfo.add_arg("baseBoard_asset", "baseBoard_asset")
+ParserSYSInfo.add_arg("baseBoard_location", "baseBoard_location")
+
+
 ##########################
 # Guest <device> parsing #
 ##########################
++++++ a931a1a6-xmlbuilder-03.patch ++++++
References: fate#319621

Subject: xmlbuilder: Opencode single addnode= usage
From: Cole Robinson crobi...@redhat.com Mon Jul 18 13:34:06 2016 -0400
Date: Mon Jul 18 14:46:50 2016 -0400:
Git: a931a1a6adf768f73c223f9b8d78fb7ca25cb0a3


Index: virt-manager-1.4.0/virtinst/xmlbuilder.py
===================================================================
--- virt-manager-1.4.0.orig/virtinst/xmlbuilder.py
+++ virt-manager-1.4.0/virtinst/xmlbuilder.py
@@ -156,7 +156,7 @@ def _add_pretty_child(parentnode, newnod
     return newnode
 
 
-def _build_xpath_node(ctx, xpath, addnode=None):
+def _build_xpath_node(ctx, xpath):
     """
     Build all nodes required to set an xpath. If we have XML <foo/>, and want
     to set xpath /foo/bar/baz@booyeah, we create node 'bar' and 'baz'
@@ -197,9 +197,6 @@ def _build_xpath_node(ctx, xpath, addnod
         newnode = libxml2.newNode(nodename)
         parentnode = _add_pretty_child(parentnode, newnode)
 
-    if addnode:
-        parentnode = _add_pretty_child(parentnode, addnode)
-
     return parentnode
 
 
@@ -989,7 +986,9 @@ class XMLBuilder(object):
             use_xpath = obj.get_root_xpath().rsplit("/", 1)[0]
             indent = 2 * obj.get_root_xpath().count("/")
             newnode = libxml2.parseDoc(util.xml_indent(xml, indent)).children
-            _build_xpath_node(self._xmlstate.xml_ctx, use_xpath, newnode)
+            parentnode = _build_xpath_node(self._xmlstate.xml_ctx, use_xpath)
+            # Tack newnode on the end
+            _add_pretty_child(parentnode, newnode)
         obj._parse_with_children(None, self._xmlstate.xml_node)
 
     def remove_child(self, obj):
++++++ b08647c2-xmlbuilder-05.patch ++++++
References: fate#319621

Subject: xmlbuilder: Handle setting conditional xpaths correctly
From: Cole Robinson crobi...@redhat.com Mon Jul 18 14:40:58 2016 -0400
Date: Mon Jul 18 14:46:50 2016 -0400:
Git: b08647c2f277e463971ae1e4430aaed28a4619f3

So if xml=<foo> and xpath=./bar[@baz='foo'] and val=XXX, xmlbuilder
previously would generate XML

  <foo>
    <bar>XXX</bar>
  </foo>

But now generates the expected

  <foo>
    <bar baz='foo'/>XXX</bar>
  </foo>

No users yet, but they are incoming

Index: virt-manager-1.4.0/virtinst/xmlbuilder.py
===================================================================
--- virt-manager-1.4.0.orig/virtinst/xmlbuilder.py
+++ virt-manager-1.4.0/virtinst/xmlbuilder.py
@@ -167,6 +167,16 @@ def _build_xpath_node(ctx, xpath):
 
     And the node pointing to @baz will be returned, for the caller to
     do with as they please.
+
+    There's also special handling to ensure that setting
+    xpath=./bar[@baz='foo']/frob will create
+
+      <bar baz='foo'>
+        <frob></frob>
+      </bar>
+
+    Even if <bar> didn't exist before. So we fill in the dependent property
+    expression values
     """
     def _handle_node(nodename, parentnode, parentpath):
         # If the passed xpath snippet (nodename) exists, return the node
@@ -209,6 +219,19 @@ def _build_xpath_node(ctx, xpath):
     for nodename in xpath.split("/"):
         parentnode, parentpath = _handle_node(nodename, parentnode, parentpath)
 
+        # Check if the xpath snippet had an '=' expression in it, example:
+        #
+        #   ./foo[@bar='baz']
+        #
+        # If so, we also want to set <foo bar='baz'/>, so that setting
+        # this XML element works as expected in this case.
+        if "[" not in nodename or "=" not in nodename:
+            continue
+
+        propname, val = nodename.split("[")[1].strip("]").split("=")
+        propobj, ignore = _handle_node(propname, parentnode, parentpath)
+        propobj.setContent(val.strip("'"))
+
     return parentnode
 
 
++++++ b31c0b44-Add-classes-for-defining-SMBios-information.patch ++++++
Subject: virtinst: Add classes for defining SMBios information
From: Charles Arnold carn...@suse.com Tue Sep 6 16:12:19 2016 -0600
Date: Thu Sep 8 11:36:59 2016 -0400:
Git: b31c0b442e9b1295d86cc49bd77c31919ab0cc02

This includes adding an smbios sub-element to the guest os element and a
sysinfo sub-element to the guest. The sysinfo sub-element contains the SMBios
specific data.

Index: virt-manager-1.4.0/virtinst/guest.py
===================================================================
--- virt-manager-1.4.0.orig/virtinst/guest.py
+++ virt-manager-1.4.0/virtinst/guest.py
@@ -52,6 +52,7 @@ from .idmap import IdMap
 from .osxml import OSXML
 from .pm import PM
 from .seclabel import Seclabel
+from .sysinfo import SYSInfo
 from .xmlbuilder import XMLBuilder, XMLProperty, XMLChildProperty
 
 
@@ -106,7 +107,7 @@ class Guest(XMLBuilder):
         "vcpus", "curvcpus", "vcpu_placement", "cpuset",
         "numatune", "bootloader", "os", "idmap",
         "features", "cpu", "clock", "on_poweroff", "on_reboot", "on_crash",
-        "resource", "pm", "emulator", "_devices", "seclabels"]
+        "resource", "pm", "emulator", "_devices", "seclabels", "sysinfo"]
 
     def __init__(self, *args, **kwargs):
         XMLBuilder.__init__(self, *args, **kwargs)
@@ -212,6 +213,7 @@ class Guest(XMLBuilder):
     memoryBacking = XMLChildProperty(DomainMemorybacking, is_single=True)
     idmap = XMLChildProperty(IdMap, is_single=True)
     resource = XMLChildProperty(DomainResource, is_single=True)
+    sysinfo = XMLChildProperty(SYSInfo, is_single=True)
 
 
     ###############################
Index: virt-manager-1.4.0/virtinst/osxml.py
===================================================================
--- virt-manager-1.4.0.orig/virtinst/osxml.py
+++ virt-manager-1.4.0/virtinst/osxml.py
@@ -77,7 +77,7 @@ class OSXML(XMLBuilder):
     _XML_ROOT_NAME = "os"
     _XML_PROP_ORDER = ["arch", "os_type", "loader", "loader_ro", "loader_type",
                        "nvram", "nvram_template", "kernel", "initrd",
-                       "kernel_args", "dtb", "_bootdevs"]
+                       "kernel_args", "dtb", "_bootdevs", "smbios_mode"]
 
     def _get_bootorder(self):
         return [dev.dev for dev in self._bootdevs]
@@ -116,6 +116,7 @@ class OSXML(XMLBuilder):
     loader = XMLProperty("./loader")
     loader_ro = XMLProperty("./loader/@readonly", is_yesno=True)
     loader_type = XMLProperty("./loader/@type")
+    smbios_mode = XMLProperty("./smbios/@mode")
     nvram = XMLProperty("./nvram")
     nvram_template = XMLProperty("./nvram/@template")
     arch = XMLProperty("./type/@arch",
Index: virt-manager-1.4.0/virtinst/sysinfo.py
===================================================================
--- /dev/null
+++ virt-manager-1.4.0/virtinst/sysinfo.py
@@ -0,0 +1,61 @@
+#
+# Copyright (C) 2016 Red Hat, Inc.
+# Copyright (C) 2016 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Charles Arnold <carnold suse com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA.
+"""
+Classes for building and installing with libvirt <sysinfo> XML
+"""
+
+from .xmlbuilder import XMLBuilder, XMLProperty
+
+
+class SYSInfo(XMLBuilder):
+    """
+    Top level class for <sysinfo type='smbios'> object XML
+    """
+
+    _XML_ROOT_NAME = "sysinfo"
+    _XML_PROP_ORDER = ["type",
+        "bios_vendor", "bios_version", "bios_date", "bios_release",
+        "system_manufacturer", "system_product", "system_version",
+        "system_serial", "system_uuid", "system_sku", "system_family",
+        "baseBoard_manufacturer", "baseBoard_product", "baseBoard_version",
+        "baseBoard_serial", "baseBoard_asset", "baseBoard_location"]
+
+    type = XMLProperty("./@type")
+
+    bios_vendor = XMLProperty("./bios/entry[@name='vendor']")
+    bios_version = XMLProperty("./bios/entry[@name='version']")
+    bios_date = XMLProperty("./bios/entry[@name='date']")
+    bios_release = XMLProperty("./bios/entry[@name='release']")
+
+    system_manufacturer = XMLProperty("./system/entry[@name='manufacturer']")
+    system_product = XMLProperty("./system/entry[@name='product']")
+    system_version = XMLProperty("./system/entry[@name='version']")
+    system_serial = XMLProperty("./system/entry[@name='serial']")
+    system_uuid = XMLProperty("./system/entry[@name='uuid']")
+    system_sku = XMLProperty("./system/entry[@name='sku']")
+    system_family = XMLProperty("./system/entry[@name='family']")
+
+    baseBoard_manufacturer = XMLProperty(
+        "./baseBoard/entry[@name='manufacturer']")
+    baseBoard_product = XMLProperty("./baseBoard/entry[@name='product']")
+    baseBoard_version = XMLProperty("./baseBoard/entry[@name='version']")
+    baseBoard_serial = XMLProperty("./baseBoard/entry[@name='serial']")
+    baseBoard_asset = XMLProperty("./baseBoard/entry[@name='asset']")
+    baseBoard_location = XMLProperty("./baseBoard/entry[@name='location']")
++++++ d8a0a788-xmlbuilder-01.patch ++++++
References: fate#319621

Subject: xmlbuilder: Update XMLProperty docs
From: Cole Robinson crobi...@redhat.com Mon Jul 18 12:46:59 2016 -0400
Date: Mon Jul 18 14:46:50 2016 -0400:
Git: d8a0a78805b17778c37d181f7b3a0be145536e9b


Index: virt-manager-1.4.0/virtinst/xmlbuilder.py
===================================================================
--- virt-manager-1.4.0.orig/virtinst/xmlbuilder.py
+++ virt-manager-1.4.0/virtinst/xmlbuilder.py
@@ -340,15 +340,16 @@ class XMLProperty(property):
                  is_bool=False, is_int=False, is_yesno=False, is_onoff=False,
                  default_cb=None, default_name=None, do_abspath=False):
         """
-        Set a XMLBuilder class property that represents a value in the
-        <domain> XML. For example
+        Set a XMLBuilder class property that maps to a value in an XML
+        document, indicated by the passed xpath. For example, for a
+        <domain><name> the definition may look like:
 
-        name = XMLProperty(get_name, set_name, xpath="/domain/name")
+          name = XMLProperty("./name")
 
-        When building XML from scratch (virt-install), name is a regular
-        class property. When parsing and editting existing guest XML, we
-        use the xpath value to map the name property to the underlying XML
-        definition.
+        When building XML from scratch (virt-install), 'name' works
+        similar to a regular class property(). When parsing and editing
+        existing guest XML, we  use the xpath value to get/set the value
+        in the parsed XML document.
 
         @param doc: option doc string for the property
         @param xpath: xpath string which maps to the associated property
++++++ virtinst-add-default-rng-device.patch ++++++
--- /var/tmp/diff_new_pack.HGrPyM/_old  2016-09-13 22:25:24.000000000 +0200
+++ /var/tmp/diff_new_pack.HGrPyM/_new  2016-09-13 22:25:24.000000000 +0200
@@ -4,15 +4,15 @@
 ===================================================================
 --- virt-manager-1.4.0.orig/virtinst/guest.py
 +++ virt-manager-1.4.0/virtinst/guest.py
-@@ -54,6 +54,7 @@ from .pm import PM
- from .seclabel import Seclabel
- from .xmlbuilder import XMLBuilder, XMLProperty, XMLChildProperty
- from .devicedisk import VirtualDisk
+@@ -39,6 +39,7 @@ from .devicedisk import VirtualDisk
+ from .devicegraphics import VirtualGraphics
+ from .deviceinput import VirtualInputDevice
+ from .deviceredirdev import VirtualRedirDevice
 +from .devicerng import VirtualRNGDevice
- 
- 
- class Guest(XMLBuilder):
-@@ -654,6 +655,15 @@ class Guest(XMLBuilder):
+ from .devicevideo import VirtualVideoDevice
+ from .distroinstaller import DistroInstaller
+ from .domainblkiotune import DomainBlkiotune
+@@ -655,6 +656,15 @@ class Guest(XMLBuilder):
              return
          self.add_device(VirtualGraphics(self.conn))
  
@@ -28,7 +28,7 @@
      def add_default_devices(self):
          self.add_default_graphics()
          self.add_default_video_device()
-@@ -661,6 +671,7 @@ class Guest(XMLBuilder):
+@@ -662,6 +672,7 @@ class Guest(XMLBuilder):
          self.add_default_console_device()
          self.add_default_usb_controller()
          self.add_default_channels()

++++++ virtinst-pvgrub2-bootloader.patch ++++++
--- /var/tmp/diff_new_pack.HGrPyM/_old  2016-09-13 22:25:24.000000000 +0200
+++ /var/tmp/diff_new_pack.HGrPyM/_new  2016-09-13 22:25:24.000000000 +0200
@@ -6,7 +6,7 @@
 ===================================================================
 --- virt-manager-1.4.0.orig/virtinst/guest.py
 +++ virt-manager-1.4.0/virtinst/guest.py
-@@ -362,8 +362,20 @@ class Guest(XMLBuilder):
+@@ -364,8 +364,20 @@ class Guest(XMLBuilder):
          if (not install and
              self.os.is_xenpv() and
              not self.os.kernel):

++++++ virtinst-s390x-disable-graphics.patch ++++++
--- /var/tmp/diff_new_pack.HGrPyM/_old  2016-09-13 22:25:24.000000000 +0200
+++ /var/tmp/diff_new_pack.HGrPyM/_new  2016-09-13 22:25:24.000000000 +0200
@@ -16,7 +16,7 @@
          self.x86_cpu_default = self.cpu.SPECIAL_MODE_HOST_MODEL_ONLY
  
          self.__os_object = None
-@@ -605,7 +608,7 @@ class Guest(XMLBuilder):
+@@ -606,7 +609,7 @@ class Guest(XMLBuilder):
          self.add_device(dev)
  
      def add_default_video_device(self):
@@ -25,7 +25,7 @@
              return
          if self.get_devices("video"):
              return
-@@ -643,6 +646,8 @@ class Guest(XMLBuilder):
+@@ -644,6 +647,8 @@ class Guest(XMLBuilder):
              dev.target_type = "virtio"
              dev.target_name = dev.CHANNEL_NAME_QEMUGA
              self.add_device(dev)
@@ -34,7 +34,7 @@
  
      def add_default_graphics(self):
          if self.skip_default_graphics:
-@@ -651,7 +656,7 @@ class Guest(XMLBuilder):
+@@ -652,7 +657,7 @@ class Guest(XMLBuilder):
              return
          if self.os.is_container():
              return
@@ -43,7 +43,7 @@
              return
          self.add_device(VirtualGraphics(self.conn))
  
-@@ -979,7 +984,7 @@ class Guest(XMLBuilder):
+@@ -980,7 +985,7 @@ class Guest(XMLBuilder):
          if self._hv_only_supports_virtio():
              return True
  

++++++ virtinst-set-cache-mode-unsafe-for-install.patch ++++++
--- /var/tmp/diff_new_pack.HGrPyM/_old  2016-09-13 22:25:24.000000000 +0200
+++ /var/tmp/diff_new_pack.HGrPyM/_new  2016-09-13 22:25:24.000000000 +0200
@@ -4,15 +4,7 @@
 ===================================================================
 --- virt-manager-1.4.0.orig/virtinst/guest.py
 +++ virt-manager-1.4.0/virtinst/guest.py
-@@ -53,6 +53,7 @@ from .osxml import OSXML
- from .pm import PM
- from .seclabel import Seclabel
- from .xmlbuilder import XMLBuilder, XMLProperty, XMLChildProperty
-+from .devicedisk import VirtualDisk
- 
- 
- class Guest(XMLBuilder):
-@@ -358,6 +359,17 @@ class Guest(XMLBuilder):
+@@ -360,6 +360,17 @@ class Guest(XMLBuilder):
  
          self._set_osxml_defaults()
  
@@ -30,7 +22,7 @@
          self.bootloader = None
          if (not install and
              self.os.is_xenpv() and
-@@ -377,7 +389,10 @@ class Guest(XMLBuilder):
+@@ -379,7 +390,10 @@ class Guest(XMLBuilder):
                  self.bootloader = "/usr/bin/pygrub"
                  self.os.clear()
  

++++++ virtinst-set-qemu-emulator.patch ++++++
--- /var/tmp/diff_new_pack.HGrPyM/_old  2016-09-13 22:25:24.000000000 +0200
+++ /var/tmp/diff_new_pack.HGrPyM/_new  2016-09-13 22:25:24.000000000 +0200
@@ -5,7 +5,7 @@
 ===================================================================
 --- virt-manager-1.4.0.orig/virtinst/guest.py
 +++ virt-manager-1.4.0/virtinst/guest.py
-@@ -792,14 +792,11 @@ class Guest(XMLBuilder):
+@@ -793,14 +793,11 @@ class Guest(XMLBuilder):
              self.emulator = None
              return
  


Reply via email to