render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
d76c62
From b3f938e7c0907ea9222827550fd3dfa0c1f1e1fd Mon Sep 17 00:00:00 2001
d76c62
Message-Id: <b3f938e7c0907ea9222827550fd3dfa0c1f1e1fd@dist-git>
d76c62
From: Peter Krempa <pkrempa@redhat.com>
d76c62
Date: Tue, 4 Feb 2020 15:08:04 +0100
d76c62
Subject: [PATCH] qemuMigrationCookieAddNBD: Use glib memory allocators
d76c62
MIME-Version: 1.0
d76c62
Content-Type: text/plain; charset=UTF-8
d76c62
Content-Transfer-Encoding: 8bit
d76c62
d76c62
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
d76c62
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
d76c62
(cherry picked from commit 8efeeb59a6e76fa9515deb7d3d26ae570e0fb7a7)
d76c62
d76c62
https://bugzilla.redhat.com/show_bug.cgi?id=1793263
d76c62
Message-Id: <5872c474b94250bb0994748d9b769883ecbea6f8.1580824112.git.pkrempa@redhat.com>
d76c62
Reviewed-by: Ján Tomko <jtomko@redhat.com>
d76c62
---
d76c62
 src/qemu/qemu_migration_cookie.c | 6 ++----
d76c62
 1 file changed, 2 insertions(+), 4 deletions(-)
d76c62
d76c62
diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c
d76c62
index 73ae815818..1c3de13983 100644
d76c62
--- a/src/qemu/qemu_migration_cookie.c
d76c62
+++ b/src/qemu/qemu_migration_cookie.c
d76c62
@@ -461,8 +461,7 @@ qemuMigrationCookieAddNBD(qemuMigrationCookiePtr mig,
d76c62
     /* It is not a bug if there already is a NBD data */
d76c62
     qemuMigrationCookieNBDFree(mig->nbd);
d76c62
 
d76c62
-    if (VIR_ALLOC(mig->nbd) < 0)
d76c62
-        return -1;
d76c62
+    mig->nbd = g_new0(qemuMigrationCookieNBD, 1);
d76c62
 
d76c62
     mig->nbd->port = priv->nbdPort;
d76c62
     mig->flags |= QEMU_MIGRATION_COOKIE_NBD;
d76c62
@@ -470,8 +469,7 @@ qemuMigrationCookieAddNBD(qemuMigrationCookiePtr mig,
d76c62
     if (vm->def->ndisks == 0)
d76c62
         return 0;
d76c62
 
d76c62
-    if (VIR_ALLOC_N(mig->nbd->disks, vm->def->ndisks) < 0)
d76c62
-        return -1;
d76c62
+    mig->nbd->disks = g_new0(struct qemuMigrationCookieNBDDisk, vm->def->ndisks);
d76c62
     mig->nbd->ndisks = 0;
d76c62
 
d76c62
     for (i = 0; i < vm->def->ndisks; i++) {
d76c62
-- 
d76c62
2.25.0
d76c62