[PATCH 3/3] qemu: Use virDomainControllerDefNew() more

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Instead of open-coding a partial version of it.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 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
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux