From: Soren Hansen Date: Tue, 9 Mar 2010 12:59:51 +0000 (+0100) Subject: Fix virDomainGetXMLDesc cache settings output X-Git-Tag: v0.8.0~332 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c36d0682a8ad7bb43fe23ca3b38206d72452edf;p=thirdparty%2Flibvirt.git Fix virDomainGetXMLDesc cache settings output If a special cache strategy for a disk has been specified in a domain definition, but no driverName has been set, virDomainGetXMLDesc would not include the tag at all. * src/conf/domain_conf.c: make sure any tag setting is serialized if set. --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 96ba0b013d..56c5239dcf 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4718,8 +4718,10 @@ virDomainDiskDefFormat(virBufferPtr buf, " \n", type, device); - if (def->driverName) { - virBufferVSprintf(buf, " driverName); + if (def->driverName || def->driverType || def->cachemode) { + virBufferVSprintf(buf, " driverName) + virBufferVSprintf(buf, " name='%s'", def->driverName); if (def->driverType) virBufferVSprintf(buf, " type='%s'", def->driverType); if (def->cachemode)