[libvirt] [PATCH 1/4] qemuDomainBlockCommit: Don't track top_canon path separately

Eric Blake eblake at redhat.com
Thu Apr 24 14:47:34 UTC 2014


On 04/22/2014 06:49 AM, Jiri Denemark wrote:
> virStorageFileChainLookup is able to give use virStorageSourcePtr which
> contains the pointer to its canonical path. There's no need for the
> caller to store both of them.
> 
> Former top_meta maps to topSource and top_canon maps to topSource->path.
> 
> Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
> ---
>  src/qemu/qemu_driver.c | 27 +++++++++++++--------------
>  1 file changed, 13 insertions(+), 14 deletions(-)

ACK - it's nice to see the sort of cleanups we can do now that the
structs aren't as complicated.

> @@ -15363,11 +15362,11 @@ qemuDomainBlockCommit(virDomainPtr dom, const char *path, const char *base,
>       * virStorageFileChainLookup guarantees a simple pointer
>       * comparison will work, rather than needing full-blown STREQ.  */
>      if ((flags & VIR_DOMAIN_BLOCK_COMMIT_SHALLOW) &&
> -        base_canon != top_meta->backingStore->path) {
> +        base_canon != topSource->backingStore->path) {

Given the testsuite rework I did, I'm a bit more worried about pointer
equality here, and we may need to use STREQ after all.  But we can
double-check that after finishing the rest of the cleanups in your series.

-- 
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/20140424/7d2a3f67/attachment-0001.sig>


More information about the libvir-list mailing list