On Thu, Apr 24, 2014 at 08:47:34 -0600, Eric Blake wrote:
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(a)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.
Don't worry, this will go away in the next patch. It's enough to
directly compare virStorageSourcePtr (and also usable for other than
local files).
Jirka