Instead of open-coding a partial version of it.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
src/qemu/qemu_hotplug.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 137904034d..0f7ffb6506 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -873,9 +873,9 @@ qemuDomainFindOrCreateSCSIDiskController(virDomainObj *vm,
/* No SCSI controller present, for backward compatibility we
* now hotplug a controller */
- cont = g_new0(virDomainControllerDef, 1);
- cont->type = VIR_DOMAIN_CONTROLLER_TYPE_SCSI;
+ cont = virDomainControllerDefNew(VIR_DOMAIN_CONTROLLER_TYPE_SCSI);
cont->idx = controller;
+
if (model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_DEFAULT)
cont->model = qemuDomainGetSCSIControllerModel(vm->def, cont,
priv->qemuCaps);
else
--
2.43.0