[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/3] Prevent creating an image with the same fil
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 3/3] Prevent creating an image with the same filename as backing file |
Date: |
Thu, 16 Dec 2010 11:46:25 +0000 |
On Thu, Dec 16, 2010 at 11:04 AM, <address@hidden> wrote:
> From: Jes Sorensen <address@hidden>
>
> Signed-off-by: Jes Sorensen <address@hidden>
> ---
> block.c | 7 +++++++
> 1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/block.c b/block.c
> index 765f9f3..027dc6a 100644
> --- a/block.c
> +++ b/block.c
> @@ -2769,6 +2769,13 @@ int bdrv_img_create(const char *filename, const char
> *fmt,
> BlockDriver *drv, *proto_drv;
> int ret = 0;
>
> + if (!strcmp(filename, base_filename)) {
> + error_report("Error: Trying to create a snapshot with the same "
> + "filename as the backing file");
Can we avoid using the word "snapshot" here? Just "image" would make sense too.
Users could hit this if they incorrectly create an image manually.
They might not be thinking in terms of "snapshot" and that word is
already overloaded in QEMU.
Stefan