qemu: blockcopy: Initialize correct source structure

4cc1f1a01f introduced a crash when doing a
block copy as virStorageSourceInitChainElement was called on
"disk->mirror" that is still NULL at that point instead of "mirror"
which temporarily holds the mirror source struct until it's fully
initialized. This resulted into a crash as a NULL was dereferenced.

Reported by: Shanzi Yu <shyu@redhat.com>
This commit is contained in:
Peter Krempa 2014-07-15 10:31:36 +02:00
parent 54d4619cda
commit 95d6aff787

View File

@ -15309,7 +15309,7 @@ qemuDomainBlockCopy(virDomainObjPtr vm,
if (VIR_STRDUP(mirror->path, dest) < 0)
goto endjob;
if (virStorageSourceInitChainElement(disk->mirror, disk->src, false) < 0)
if (virStorageSourceInitChainElement(mirror, disk->src, false) < 0)
goto endjob;
if (qemuDomainPrepareDiskChainElement(driver, vm, mirror,