conf: Fix incorrect spice graphic XML format on compression options

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.
This commit is contained in:
Michal Privoznik 2011-05-24 13:43:30 +02:00
parent ef983dfe5a
commit 155542a57f

View 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));