提交 8efeeb59 编写于 作者: P Peter Krempa

qemuMigrationCookieAddNBD: Use glib memory allocators

Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 3093822d
...@@ -461,8 +461,7 @@ qemuMigrationCookieAddNBD(qemuMigrationCookiePtr mig, ...@@ -461,8 +461,7 @@ qemuMigrationCookieAddNBD(qemuMigrationCookiePtr mig,
/* It is not a bug if there already is a NBD data */ /* It is not a bug if there already is a NBD data */
qemuMigrationCookieNBDFree(mig->nbd); qemuMigrationCookieNBDFree(mig->nbd);
if (VIR_ALLOC(mig->nbd) < 0) mig->nbd = g_new0(qemuMigrationCookieNBD, 1);
return -1;
mig->nbd->port = priv->nbdPort; mig->nbd->port = priv->nbdPort;
mig->flags |= QEMU_MIGRATION_COOKIE_NBD; mig->flags |= QEMU_MIGRATION_COOKIE_NBD;
...@@ -470,8 +469,7 @@ qemuMigrationCookieAddNBD(qemuMigrationCookiePtr mig, ...@@ -470,8 +469,7 @@ qemuMigrationCookieAddNBD(qemuMigrationCookiePtr mig,
if (vm->def->ndisks == 0) if (vm->def->ndisks == 0)
return 0; return 0;
if (VIR_ALLOC_N(mig->nbd->disks, vm->def->ndisks) < 0) mig->nbd->disks = g_new0(struct qemuMigrationCookieNBDDisk, vm->def->ndisks);
return -1;
mig->nbd->ndisks = 0; mig->nbd->ndisks = 0;
for (i = 0; i < vm->def->ndisks; i++) { for (i = 0; i < vm->def->ndisks; i++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册