qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] block: for HMP commit() operations on 'all', sk


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] block: for HMP commit() operations on 'all', skip non-COW drives
Date: Tue, 26 Feb 2013 16:03:07 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

Il 26/02/2013 15:55, Jeff Cody ha scritto:
> During a commit of 'all' using the HMP non-live commit, the operation
> is aborted and returns error on the first error enountered.  When
> non-COW drives are in use (e.g. ejected floppy, cdrom, or drives without
> a backing parent), that means a commit all will return an error of either
> -ENOMEDIUM or -ENOTSUP.  This is not desirable, so for the 'all' commit
> case, only attempt the commit if both bs->drv and bs->backing_hd are
> present.
> 
> More succinctly: 'commit all' now means a commit on all COW drives.
> 
> This means an individual commit to a specific non-COW drive will still
> return the appropriate error (-ENOMEDIUM if eject / not present, -ENOTSUP
> if no backing file).
> 
> Reported-by: Jan Kiszka <address@hidden>
> Signed-off-by: Jeff Cody <address@hidden>
> ---
>  block.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/block.c b/block.c
> index 50dab8e..7a105dc 100644
> --- a/block.c
> +++ b/block.c
> @@ -1620,9 +1620,11 @@ int bdrv_commit_all(void)
>      BlockDriverState *bs;
>  
>      QTAILQ_FOREACH(bs, &bdrv_states, list) {
> -        int ret = bdrv_commit(bs);
> -        if (ret < 0) {
> -            return ret;
> +        if (bs->drv && bs->backing_hd) {
> +            int ret = bdrv_commit(bs);
> +            if (ret < 0) {
> +                return ret;
> +            }
>          }
>      }
>      return 0;
> 

Reviewed-by: Paolo Bonzini <address@hidden>



reply via email to

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