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

2013-06-07 Thread Mark Trumpold
On 5/28/13 11:42 PM, "Stefan Hajnoczi" wrote: >On Tue, May 28, 2013 at 06:00:08PM +, Mark Trumpold wrote: >> >> >-Original Message- >> >From: Stefan Hajnoczi [mailto:stefa...@gmail.com] >> >Sent: Monday, May 27, 2013 05:36 AM >> >To: 'Mark Trumpold' >> >Cc: 'Paolo Bonzini', qemu-deve

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

2013-05-29 Thread Mark Trumpold
On 5/28/13 11:42 PM, "Stefan Hajnoczi" wrote: >On Tue, May 28, 2013 at 06:00:08PM +, Mark Trumpold wrote: >> >> >-Original Message- >> >From: Stefan Hajnoczi [mailto:stefa...@gmail.com] >> >Sent: Monday, May 27, 2013 05:36 AM >> >To: 'Mark Trumpold' >> >Cc: 'Paolo Bonzini', qemu-deve

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

2013-05-29 Thread Stefan Hajnoczi
On Tue, May 28, 2013 at 06:00:08PM +, Mark Trumpold wrote: > > >-Original Message- > >From: Stefan Hajnoczi [mailto:stefa...@gmail.com] > >Sent: Monday, May 27, 2013 05:36 AM > >To: 'Mark Trumpold' > >Cc: 'Paolo Bonzini', qemu-devel@nongnu.org, ma...@tachyon.net > >Subject: Re: 'qemu-n

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

2013-05-28 Thread Mark Trumpold
>-Original Message- >From: Stefan Hajnoczi [mailto:stefa...@gmail.com] >Sent: Monday, May 27, 2013 05:36 AM >To: 'Mark Trumpold' >Cc: 'Paolo Bonzini', qemu-devel@nongnu.org, ma...@tachyon.net >Subject: Re: 'qemu-nbd' explicit flush > >On Sat, May 25, 2013 at 09:42:08AM -0800, Mark Trumpold

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

2013-05-27 Thread Stefan Hajnoczi
On Sat, May 25, 2013 at 09:42:08AM -0800, Mark Trumpold wrote: > On 5/24/13 1:05 AM, "Stefan Hajnoczi" wrote: > >On Thu, May 23, 2013 at 09:58:31PM +, Mark Trumpold wrote: > >One thing to be careful of is whether these operations are asynchronous. > >The signal is asynchronous, you have no way

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

2013-05-25 Thread Mark Trumpold
On 5/24/13 1:05 AM, "Stefan Hajnoczi" wrote: >On Thu, May 23, 2013 at 09:58:31PM +, Mark Trumpold wrote: >> I have a working configuration using the signal approach suggested by >>Stefan. >> >> 'qemu-nbd.c' is patched as follows: >> >> do { >> main_loop_wait(false); >> + i

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

2013-05-24 Thread Paolo Bonzini
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; > +

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

2013-05-24 Thread Stefan Hajnoczi
On Thu, May 23, 2013 at 11:35:24PM +, Mark Trumpold wrote: > I had one question I forgot to ask.. > > Is it possible to switch from '--cache=writeback' functionality > to '--cache=writethrough' (and visa versa) while qemu-nbd is > connected to the '/dev/nbd' device? No. The block layer APIs

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

2013-05-24 Thread Stefan Hajnoczi
On Thu, May 23, 2013 at 09:58:31PM +, Mark Trumpold wrote: > 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 = fal

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

2013-05-23 Thread Mark Trumpold
I had one question I forgot to ask.. Is it possible to switch from '--cache=writeback' functionality to '--cache=writethrough' (and visa versa) while qemu-nbd is connected to the '/dev/nbd' device? Thank you, Mark T. -Original Message- From: Mark Trumpold [mailto:ma...@netqa.com] Sent:

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

2013-05-23 Thread Mark Trumpold
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(); } }

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

2013-05-22 Thread Mark Trumpold
Thank you guys for responding!! > > > 1. Add a signal handler (like SIGHUP or SIGUSR1) to qemu-nbd which > >flushes all exports. > > That would be a useful addition anyway. > > Paolo This is exactly what I was going to try today. I'm just getting familiar with Qemu source. I'll let you k

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

2013-05-22 Thread Paolo Bonzini
Il 22/05/2013 11:47, Stefan Hajnoczi ha scritto: > On Tue, May 21, 2013 at 08:01:10PM +, Mark Trumpold wrote: >> Linux kernel 3.3.1 with Qemu patch to enable kernel flushing: >> http://thread.gmane.org/gmane.linux.drivers.nbd.general/1108 > > Did you check that the kernel is sendin

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

2013-05-22 Thread Stefan Hajnoczi
On Tue, May 21, 2013 at 08:01:10PM +, Mark Trumpold wrote: > Linux kernel 3.3.1 with Qemu patch to enable kernel flushing: > http://thread.gmane.org/gmane.linux.drivers.nbd.general/1108 Did you check that the kernel is sending NBD_FLUSH commands? You can use tcpdump and then check

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

2013-05-21 Thread Mark Trumpold
Hello all, I am using ‘qemu-nbd’ and ‘qemu-img’ from the command line to provide ‘qcow2’ loop filesystems. For performance, I have '--cache=writeback' set for the qemu-nbd device. I am having trouble flushing all caches to disk at will; specifically before snapshotting the underlying filesyst