qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH 1/4] Fix migration in case of scsi-generic


From: Paolo Bonzini
Subject: Re: [Qemu-block] [PATCH 1/4] Fix migration in case of scsi-generic
Date: Fri, 08 May 2015 13:44:45 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0


On 08/05/2015 13:38, Dimitris Aragiorgis wrote:
> During migration, QEMU uses fsync()/fdatasync() on the open file
> descriptor for read-write block devices to flush data just before
> stopping the VM.
> 
> However, fsync() on a scsi-generic device returns -EINVAL which
> causes the migration to fail. This patch skips flushing data in case
> of an SG device, since submitting SCSI commands directly via an SG
> character device (e.g. /dev/sg0) bypasses the page cache completely,
> anyway.

Good catch!  The patch is correct, but please remove the same test from
iscsi_co_flush (in block/iscsi.c) because it's now duplicate.

Thanks,

Paolo

> Signed-off-by: Dimitris Aragiorgis <address@hidden>
> ---
>  block/io.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block/io.c b/block/io.c
> index 1ce62c4..d248a4d 100644
> --- a/block/io.c
> +++ b/block/io.c
> @@ -2231,7 +2231,7 @@ int coroutine_fn bdrv_co_flush(BlockDriverState *bs)
>  {
>      int ret;
>  
> -    if (!bs || !bdrv_is_inserted(bs) || bdrv_is_read_only(bs)) {
> +    if (!bs || !bdrv_is_inserted(bs) || bdrv_is_read_only(bs) || 
> bdrv_is_sg(bs)) {
>          return 0;
>      }
>  
> 



reply via email to

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