Some of the other controllers in this function still had their id's
hardcoded with a printf rather than getting it from alias in the
controller object.
---
src/qemu/qemu_command.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index b9f4c51..7adce0a 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4557,8 +4557,7 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef,
} else {
virBufferAddLit(&buf, "virtio-serial");
}
- virBufferAsprintf(&buf, ",id=" QEMU_VIRTIO_SERIAL_PREFIX
"%d",
- def->idx);
+ virBufferAsprintf(&buf, ",id=%s", def->info.alias);
if (def->opts.vioserial.ports != -1) {
virBufferAsprintf(&buf, ",max_ports=%d",
def->opts.vioserial.ports);
@@ -4570,7 +4569,7 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef,
break;
case VIR_DOMAIN_CONTROLLER_TYPE_CCID:
- virBufferAsprintf(&buf, "usb-ccid,id=ccid%d", def->idx);
+ virBufferAsprintf(&buf, "usb-ccid,id=%s", def->info.alias);
break;
case VIR_DOMAIN_CONTROLLER_TYPE_SATA:
@@ -4594,8 +4593,8 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef,
_("PCI bridge index should be > 0"));
goto error;
}
- virBufferAsprintf(&buf, "pci-bridge,chassis_nr=%d,id=pci.%d",
- def->idx, def->idx);
+ virBufferAsprintf(&buf, "pci-bridge,chassis_nr=%d,id=%s",
+ def->idx, def->info.alias);
break;
case VIR_DOMAIN_CONTROLLER_MODEL_DMI_TO_PCI_BRIDGE:
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE)) {
@@ -4609,7 +4608,7 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef,
_("dmi-to-pci-bridge index should be > 0"));
goto error;
}
- virBufferAsprintf(&buf, "i82801b11-bridge,id=pci.%d",
def->idx);
+ virBufferAsprintf(&buf, "i82801b11-bridge,id=%s",
def->info.alias);
break;
case VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT:
case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT:
--
2.1.0