qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] 'qemu-nbd' explicit flush


From: Paolo Bonzini
Subject: Re: [Qemu-devel] 'qemu-nbd' explicit flush
Date: Fri, 24 May 2013 14:10:26 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6

Il 23/05/2013 23:58, Mark Trumpold ha scritto:
> I have a working configuration using the signal approach suggested by Stefan.
> 
> 'qemu-nbd.c' is patched as follows:
> 
>     do {
>         main_loop_wait(false);
> +       if (sighup_reported) {
> +           sighup_reported = false;
> +           bdrv_drain_all();
> +           bdrv_flush_all();
>         }
>     } while (!sigterm_reported && (persistent || !nbd_started || nb_fds > 0));
> 
> The driving script was patched as follows:

Yes, a patch along these lines would be acceptable.

>      mount -o remount,ro /dev/nbd0
>      blockdev --flushbufs /dev/nbd0
> +    kill -HUP <qemu-nbd process id>
> 
> I needed to retain 'blockdev --flushbufs' for things to work. Seems
> the 'bdrv_flush_all' is flushing what is being missed by the blockdev
> flush. I did not go back an retest with 'fsync' or other approaches I
> had tried before.

Right.  That said, I think a newer kernel would do what you want.
Perhaps you can look at the actual patches that went into 3.9 and
backport them.

Paolo



reply via email to

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