提交 2d26f8b7 编写于 作者: P Peter Krempa

qemu: backup: Initialize 'store' source properly and just once

Two functions called in sequence both initialized the virStorageSource
backing 'store' leading to a memleak.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 b5212365
...@@ -272,9 +272,6 @@ qemuBackupDiskPrepareDataOne(virDomainObjPtr vm, ...@@ -272,9 +272,6 @@ qemuBackupDiskPrepareDataOne(virDomainObjPtr vm,
dd->backingStore = dd->terminator = virStorageSourceNew(); dd->backingStore = dd->terminator = virStorageSourceNew();
} }
if (qemuDomainStorageFileInit(priv->driver, vm, dd->store, dd->domdisk->src) < 0)
return -1;
if (qemuDomainPrepareStorageSourceBlockdev(NULL, dd->store, priv, cfg) < 0) if (qemuDomainPrepareStorageSourceBlockdev(NULL, dd->store, priv, cfg) < 0)
return -1; return -1;
...@@ -410,7 +407,7 @@ qemuBackupDiskPrepareOneStorage(virDomainObjPtr vm, ...@@ -410,7 +407,7 @@ qemuBackupDiskPrepareOneStorage(virDomainObjPtr vm,
return -1; return -1;
} }
if (qemuDomainStorageFileInit(priv->driver, vm, dd->store, NULL) < 0) if (qemuDomainStorageFileInit(priv->driver, vm, dd->store, dd->domdisk->src) < 0)
return -1; return -1;
dd->initialized = true; dd->initialized = true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册