aboutsummaryrefslogtreecommitdiff
path: root/qga
diff options
context:
space:
mode:
authorAlberto Garcia <berto@igalia.com>2015-10-26 14:27:13 +0200
committerKevin Wolf <kwolf@redhat.com>2015-11-11 16:25:47 +0100
commita39a24fbb05055d00026eb569ff3f7b868ca8785 (patch)
tree681383c1863e96889ec222f507ffa45510cb8321 /qga
parentadfe20303f2a897ce64b77fe579a0c7dc1e81771 (diff)
block: check for existing device IDs in external_snapshot_prepare()
The 'snapshot-node-name' parameter of blockdev-snapshot-sync allows setting the node name of the image that is going to be created. Before creating the image, external_snapshot_prepare() checks that the name is not already being used. The check is however incomplete since it only considers existing node names, but node names must not clash with device IDs either because they share the same namespace. If the user attempts to create a snapshot using the name of an existing device for the 'snapshot-node-name' parameter the operation will eventually fail, but only after the new image has been created. This patch replaces bdrv_find_node() with bdrv_lookup_bs() to extend the check to existing device IDs, and thus detect possible name clashes before the new image is created. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'qga')
0 files changed, 0 insertions, 0 deletions