2011/5/24 Michal PrÃvoznÃk <mprivozn@xxxxxxxxxx>: > On 24.05.2011 13:43, Michal Privoznik wrote: >> If spice graphics has no <channel> elements, the output graphics XML >> is messed up. To prevent this, we need to end the <graphics> element > By messing up I mean something like this: > ...... > Â Â<graphics type='spice' autoport='yes' Â Â Â<image > compression='auto_glz'/> > Â Â Â<jpeg compression='auto'/> > Â Â Â<zlib compression='auto'/> > Â Â Â<playback compression='on'/> > /> > ...... >> just before adding any compression selecting elements. >> --- >> Âsrc/conf/domain_conf.c | Â Â6 ++++++ >> Â1 files changed, 6 insertions(+), 0 deletions(-) >> >> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c >> index 3f2fb11..2800db5 100644 >> --- a/src/conf/domain_conf.c >> +++ b/src/conf/domain_conf.c >> @@ -8082,6 +8082,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)); > Could you add test file to the qemu tests that shows the broken formatting and passes cleanly after your patch is applied? This way we can avoid future regressions in XML formatting in this area, because will complain. Matthias -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list