[libvirt] [PATCHv5 22/28] util: storage: Return complete parent info from virStorageFileChainLookup

Eric Blake eblake at redhat.com
Tue Jul 8 23:28:42 UTC 2014


On 07/04/2014 05:29 AM, Peter Krempa wrote:
> Instead of just returning the parent path, return the complete parent
> source structure.
> ---
>  src/qemu/qemu_driver.c    | 16 ++++-----
>  src/util/virstoragefile.c | 17 ++++------
>  src/util/virstoragefile.h |  2 +-
>  tests/virstoragetest.c    | 86 ++++++++++++++++++++++-------------------------
>  4 files changed, 56 insertions(+), 65 deletions(-)

> @@ -15585,10 +15585,9 @@ qemuDomainBlockCommit(virDomainPtr dom,
>      clean_access = true;
>      if (qemuDomainPrepareDiskChainElement(driver, vm, disk, baseSource,
>                                            VIR_DISK_CHAIN_READ_WRITE) < 0 ||
> -        (top_parent && top_parent != disk->src->path &&
> -         qemuDomainPrepareDiskChainElementPath(driver, vm, disk,
> -                                               top_parent,
> -                                               VIR_DISK_CHAIN_READ_WRITE) < 0))
> +        (top_parent != disk->src &&
> +         qemuDomainPrepareDiskChainElement(driver, vm, disk, top_parent,
> +                                           VIR_DISK_CHAIN_READ_WRITE) < 0))

Oops.  This doesn't quite work with active commit (where top_parent is
NULL, but where qemuDomainPrepareDiskChainElement isn't too happy to get
a NULL pointer).  But then again, I'm rebasing my active commit on top
of you, so your patch is not wrong if it goes in first.  If you want,
restore the condition to '(top_parent && top_parent != disk->src &&...)'.

> @@ -1388,7 +1387,6 @@ virStorageFileChainLookup(virStorageSourcePtr chain,
>                      goto error;
>                  }
> 
> -
>                  int result = virFileRelLinkPointsTo(parentDir, name,
>                                                      chain->path);

Aha - squash this hunk into an earlier commit.

ACK, whether or not you fix the NULL top_parent for active commit.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140708/bc4a8b72/attachment-0001.sig>


More information about the libvir-list mailing list