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 <driver> tag at all.

* src/conf/domain_conf.c: make sure any <driver> tag setting is
  serialized if set.
This commit is contained in:
Soren Hansen 2010-03-09 13:59:51 +01:00 committed by Daniel Veillard
parent 785d8580b3
commit 1c36d0682a

View File

@ -4718,8 +4718,10 @@ virDomainDiskDefFormat(virBufferPtr buf,
" <disk type='%s' device='%s'>\n",
type, device);
if (def->driverName) {
virBufferVSprintf(buf, " <driver name='%s'", def->driverName);
if (def->driverName || def->driverType || def->cachemode) {
virBufferVSprintf(buf, " <driver");
if (def->driverName)
virBufferVSprintf(buf, " name='%s'", def->driverName);
if (def->driverType)
virBufferVSprintf(buf, " type='%s'", def->driverType);
if (def->cachemode)