[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v7 1/5] block: check for existing device IDs in
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH v7 1/5] block: check for existing device IDs in external_snapshot_prepare() |
Date: |
Mon, 12 Oct 2015 22:20:58 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 12.10.2015 11:16, Alberto Garcia wrote:
> 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 <address@hidden>
> ---
> blockdev.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
Reviewed-by: Max Reitz <address@hidden>
signature.asc
Description: OpenPGP digital signature
- [Qemu-block] [PATCH v7 0/5] Add 'blockdev-snapshot' command, Alberto Garcia, 2015/10/12
- [Qemu-block] [PATCH v7 3/5] block: support passing 'backing': '' to 'blockdev-add', Alberto Garcia, 2015/10/12
- [Qemu-block] [PATCH v7 1/5] block: check for existing device IDs in external_snapshot_prepare(), Alberto Garcia, 2015/10/12
- [Qemu-block] [PATCH v7 4/5] block: add a 'blockdev-snapshot' QMP command, Alberto Garcia, 2015/10/12
- [Qemu-block] [PATCH v7 5/5] block: add tests for the 'blockdev-snapshot' command, Alberto Garcia, 2015/10/12
- [Qemu-block] [PATCH v7 2/5] block: rename BlockdevSnapshot to BlockdevSnapshotSync, Alberto Garcia, 2015/10/15