mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 21:15:20 +00:00
qemu: blockjob: Clear out any irrelevant data in copied source
Since we copy everything from the original storage source including some runtime data which are not relevant for the config we should clear them. Signed-off-by: Peter Krempa <pkrempa@redhat.com> ACKed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
3b27b5f35a
commit
d3833b0799
@ -433,6 +433,25 @@ qemuBlockJobEmitEvents(virQEMUDriverPtr driver,
|
|||||||
virObjectEventStateQueue(driver->domainEventState, event2);
|
virObjectEventStateQueue(driver->domainEventState, event2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* qemuBlockJobCleanStorageSourceRuntime:
|
||||||
|
* @src: storage source to clean from runtime data
|
||||||
|
*
|
||||||
|
* Remove all runtime related data from the storage source.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
qemuBlockJobCleanStorageSourceRuntime(virStorageSourcePtr src)
|
||||||
|
{
|
||||||
|
src->id = 0;
|
||||||
|
src->detected = false;
|
||||||
|
VIR_FREE(src->relPath);
|
||||||
|
VIR_FREE(src->backingStoreRaw);
|
||||||
|
VIR_FREE(src->nodestorage);
|
||||||
|
VIR_FREE(src->nodeformat);
|
||||||
|
VIR_FREE(src->tlsAlias);
|
||||||
|
VIR_FREE(src->tlsCertdir);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* qemuBlockJobRewriteConfigDiskSource:
|
* qemuBlockJobRewriteConfigDiskSource:
|
||||||
@ -467,6 +486,8 @@ qemuBlockJobRewriteConfigDiskSource(virDomainObjPtr vm,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qemuBlockJobCleanStorageSourceRuntime(copy);
|
||||||
|
|
||||||
virObjectUnref(persistDisk->src);
|
virObjectUnref(persistDisk->src);
|
||||||
VIR_STEAL_PTR(persistDisk->src, copy);
|
VIR_STEAL_PTR(persistDisk->src, copy);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user