From 1c36d0682a8ad7bb43fe23ca3b38206d72452edf Mon Sep 17 00:00:00 2001 From: Soren Hansen Date: Tue, 9 Mar 2010 13:59:51 +0100 Subject: [PATCH] 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. --- src/conf/domain_conf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) -- GitLab