On 05/22/2014 07:47 AM, Peter Krempa wrote:
Refactor the function to accept a virStorageSourcePtr instead of
just
the path, add a check to run it only on local storage and fix callers
(possibly by using a newly introduced wrapper that wraps a path in the
virStorageSource struct for legacy code)
---
Notes:
Version 2:
- V1 acked by Eric with comment cleanup
ACK still holds.
This is a large series; you should go ahead and push ACK'd patches
(especially if it is before the 1.2.5 freeze) rather than waiting for a
full-series review, unless stated explicitly in a patch, or until I hit
something that requires rework that might affect later patches. [that,
and I have patches for live commit that I'm waiting to rebase on top of
yours...]
qemuDomainPrepareDiskChainElement(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDiskDefPtr disk,
- const char *file,
+ virStorageSourcePtr elem,
qemuDomainDiskChainMode mode)
{
/* The easiest way to label a single file with the same
* permissions it would have as if part of the disk chain is to
* temporarily modify the disk in place. */
- char *origsrc = disk->src.path;
- int origformat = disk->src.format;
- virStorageSourcePtr origchain = disk->src.backingStore;
+ virStorageSource origdisk;
+
+ /* XXX This would be easier when disk->src will be a pointer */
+ memcpy(&origdisk, &disk->src, sizeof(origdisk));
Yep, this is definitely going to conflict with my proposed patch for
converting to virStorageSourcePtr in domain_conf.h. I don't mind
rebasing on top of yours (in part because the compiler will enforce that
my mechanical fallout for a type change catches all uses), but it does
mean yours has to go in first :)
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org