]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
conf: Fix incorrect spice graphic XML format on compression options
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 24 May 2011 11:43:30 +0000 (13:43 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 31 May 2011 13:35:08 +0000 (15:35 +0200)
If spice graphics has no <channel> elements, the output graphics XML
is messed up. To prevent this, we need to end the <graphics> element
just before adding any compression selecting elements.

src/conf/domain_conf.c

index 77ab1e5343ffc2753dfeb5f0c18c33c075b69e97..b40620208ecc301eebd5e3886daafcba96432632 100644 (file)
@@ -8998,6 +8998,12 @@ virDomainGraphicsDefFormat(virBufferPtr buf,
                               virDomainGraphicsSpiceChannelNameTypeToString(i),
                               virDomainGraphicsSpiceChannelModeTypeToString(mode));
         }
+        if (!children && (def->data.spice.image || def->data.spice.jpeg ||
+                          def->data.spice.zlib || def->data.spice.playback ||
+                          def->data.spice.streaming)) {
+            virBufferAddLit(buf, ">\n");
+            children = 1;
+        }
         if (def->data.spice.image)
             virBufferAsprintf(buf, "      <image compression='%s'/>\n",
                               virDomainGraphicsSpiceImageCompressionTypeToString(def->data.spice.image));