From 97fac17c77d9bdfacafff1c5c39b2df3c1530614 Mon Sep 17 00:00:00 2001 From: Luyao Huang Date: Wed, 7 Jan 2015 18:39:37 +0800 Subject: [PATCH] conf: Correctly format controller's driver https://bugzilla.redhat.com/show_bug.cgi?id=1179684 The way that we currently generate the for is just madness:
It's obvious that we should be aiming at the following:
Signed-off-by: Luyao Huang --- src/conf/domain_conf.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d1a483add0..57e99e6782 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -17120,14 +17120,19 @@ virDomainControllerDefFormat(virBufferPtr buf, virDomainDeviceInfoIsSet(&def->info, flags) || pcihole64) { virBufferAddLit(buf, ">\n"); virBufferAdjustIndent(buf, 2); - if (def->queues) - virBufferAsprintf(buf, "\n", def->queues); - if (def->cmd_per_lun) - virBufferAsprintf(buf, "\n", def->cmd_per_lun); + if (def->queues || def->cmd_per_lun || def->max_sectors) { + virBufferAddLit(buf, "queues) + virBufferAsprintf(buf, " queues='%u'", def->queues); - if (def->max_sectors) - virBufferAsprintf(buf, "\n", def->max_sectors); + if (def->cmd_per_lun) + virBufferAsprintf(buf, " cmd_per_lun='%u'", def->cmd_per_lun); + + if (def->max_sectors) + virBufferAsprintf(buf, " max_sectors='%u'", def->max_sectors); + virBufferAddLit(buf, "/>\n"); + } if (virDomainDeviceInfoIsSet(&def->info, flags) && virDomainDeviceInfoFormat(buf, &def->info, flags) < 0)