Re: [PATCH 06/10] qemuMigrationCookieAddNBD: Use glib memory allocators

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

 



On 1/30/20 3:53 PM, Peter Krempa wrote:
Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
  src/qemu/qemu_migration_cookie.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c
index 73ae815818..1c3de13983 100644
--- a/src/qemu/qemu_migration_cookie.c
+++ b/src/qemu/qemu_migration_cookie.c
@@ -461,8 +461,7 @@ qemuMigrationCookieAddNBD(qemuMigrationCookiePtr mig,
      /* It is not a bug if there already is a NBD data */
      qemuMigrationCookieNBDFree(mig->nbd);

-    if (VIR_ALLOC(mig->nbd) < 0)
-        return -1;
+    mig->nbd = g_new0(qemuMigrationCookieNBD, 1);

      mig->nbd->port = priv->nbdPort;
      mig->flags |= QEMU_MIGRATION_COOKIE_NBD;
@@ -470,8 +469,7 @@ qemuMigrationCookieAddNBD(qemuMigrationCookiePtr mig,
      if (vm->def->ndisks == 0)
          return 0;

-    if (VIR_ALLOC_N(mig->nbd->disks, vm->def->ndisks) < 0)
-        return -1;
+    mig->nbd->disks = g_new0(struct qemuMigrationCookieNBDDisk, vm->def->ndisks);

This 'struct ' should be dropped.

      mig->nbd->ndisks = 0;

      for (i = 0; i < vm->def->ndisks; i++) {


Michal




[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