qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] mirror: Fail gracefully for source == target


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH] mirror: Fail gracefully for source == target
Date: Tue, 14 Aug 2018 07:57:39 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 08/14/2018 04:58 AM, Kevin Wolf wrote:
blockdev-mirror with the same node for source and target segfaults
today: A node is in its own backing chain, so mirror_start_job() decides
that this is an active commit. When adding the intermediate nodes with
block_job_add_bdrv(), it starts the iteration through the subchain with
the backing file of source, though, so it never reaches target and
instead runs into NULL at the base.

While we could fix that by starting with source itself, there is no
point in allowing mirroring a node into itself and I wouldn't be
surprised if this caused more problems later.

So just check for this scenario and error out.

Cc: address@hidden
Signed-off-by: Kevin Wolf <address@hidden>
---
  block/mirror.c             | 5 +++++
  tests/qemu-iotests/041     | 6 ++++++
  tests/qemu-iotests/041.out | 4 ++--
  3 files changed, 13 insertions(+), 2 deletions(-)


Reviewed-by: Eric Blake <address@hidden>

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]