On 09/20/2017 07:15 AM, Kevin Wolf wrote: > This additional check for change-backing-file makes sure that actions on > one part of the graph don't interfere with later actions elsewhere. > > Suggested-by: Eric Blake <ebl...@redhat.com> > Signed-off-by: Kevin Wolf <kw...@redhat.com> > --- > tests/qemu-iotests/195 | 17 ++++++++++++++++ > tests/qemu-iotests/195.out | 51 > ++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 68 insertions(+) >
> +run_qemu -drive if=none,file="$TEST_IMG",node-name=top,backing.node-name=mid > <<EOF > +{"execute":"qmp_capabilities"} > +{"execute":"change-backing-file", > "arguments":{"device":"none0","image-node-name":"mid","backing-file":"/dev/null"}} > +{"execute":"change-backing-file", > "arguments":{"device":"none0","image-node-name":"top","backing-file":"/dev/null"}} I guess 'mid' is still accessible even though 'top' now no longer points to mid in the header, because we rely on our cache of the relationships rather than what is written into the header (of course, as soon as qemu quits, we've broken the chain, but that doesn't matter for this test). > +{"execute":"change-backing-file", > "arguments":{"device":"none0","image-node-name":"mid","backing-file":"/dev/null"}} Should the second modification to 'mid' be distinct from the first (as in, back to $TEST_IMG.mid), to make sure we are actually making another change, rather than triggering some short-cut that might treat a no-op change as something that can be skipped? Even bouncing between "$TEST_IMG.mid", "./$TEST_IMG.mid", and "././$TEST_IMG.mid" will access the same file (and thus not break the chain), while still making it obvious which changes took effect, when compared to your change to /dev/null. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature