提交 97fac17c 编写于 作者: L Luyao Huang 提交者: Michal Privoznik

conf: Correctly format controller's driver

https://bugzilla.redhat.com/show_bug.cgi?id=1179684

The way that we currently generate the <driver/> for <controller/> is
just madness:

    <controller type='scsi' index='0' model='virtio-scsi'>
      <driver queues='12'/>
      <driver cmd_per_lun='123'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </controller>

It's obvious that we should be aiming at the following:

    <controller type='scsi' index='0' model='virtio-scsi'>
      <driver queues='12' cmd_per_lun='123'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </controller>
Signed-off-by: NLuyao Huang <lhuang@redhat.com>
上级 1390c268
......@@ -17120,14 +17120,19 @@ virDomainControllerDefFormat(virBufferPtr buf,
virDomainDeviceInfoIsSet(&def->info, flags) || pcihole64) {
virBufferAddLit(buf, ">\n");
virBufferAdjustIndent(buf, 2);
if (def->queues)
virBufferAsprintf(buf, "<driver queues='%u'/>\n", def->queues);
if (def->cmd_per_lun)
virBufferAsprintf(buf, "<driver cmd_per_lun='%u'/>\n", def->cmd_per_lun);
if (def->queues || def->cmd_per_lun || def->max_sectors) {
virBufferAddLit(buf, "<driver");
if (def->queues)
virBufferAsprintf(buf, " queues='%u'", def->queues);
if (def->max_sectors)
virBufferAsprintf(buf, "<driver max_sectors='%u'/>\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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册