Received: from eggs.gnu.org ([140.186.70.92]:60810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RM03C-0005Wy-6w for qemu-devel@nongnu.org; Thu, 03 Nov 2011 12:21:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RM03B-00088P-2B for qemu-devel@nongnu.org; Thu, 03 Nov 2011 12:21:58 -0400 Received: from mtagate3.uk.ibm.com ([194.196.100.163]:51943) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RM03A-00087V-NY for qemu-devel@nongnu.org; Thu, 03 Nov 2011 12:21:56 -0400 Received: from d06nrmr1707.portsmouth.uk.ibm.com (d06nrmr1707.portsmouth.uk.ibm.com [9.149.39.225]) by mtagate3.uk.ibm.com (8.13.1/8.13.1) with ESMTP id pA3GLoV1019698 for ; Thu, 3 Nov 2011 16:21:50 GMT Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pA3GLoOa2269316 for ; Thu, 3 Nov 2011 16:21:50 GMT Received: from d06av11.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pA3GLoIg025024 for ; Thu, 3 Nov 2011 10:21:50 -0600 Date: Thu, 3 Nov 2011 16:21:34 +0000 From: Stefan Hajnoczi Message-ID: <20111103162134.GA15623@stefanha-thinkpad.localdomain> References: <1318866452-30026-1-git-send-email-stefanha@linux.vnet.ibm.com> <1318866452-30026-7-git-send-email-stefanha@linux.vnet.ibm.com> <4EB2A5F1.5080407@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4EB2A5F1.5080407@redhat.com> Subject: Re: [Qemu-devel] [RFC 6/6] block: add -drive copy-on-read=on|off List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Paolo Bonzini , Marcelo Tosatti , qemu-devel@nongnu.org On Thu, Nov 03, 2011 at 03:32:17PM +0100, Kevin Wolf wrote: > Am 17.10.2011 17:47, schrieb Stefan Hajnoczi: > > This patch adds the -drive copy-on-read=on|off command-line option: > > > > copy-on-read=on|off > > copy-on-read is "on" or "off" and enables whether to copy read backing > > file sectors into the image file. Copy-on-read avoids accessing the > > same backing file sectors repeatedly and is useful when the backing > > file is over a slow network. By default copy-on-read is off. > > > > Signed-off-by: Stefan Hajnoczi > > --- > > blockdev.c | 6 ++++++ > > hmp-commands.hx | 5 +++-- > > qemu-config.c | 4 ++++ > > qemu-options.hx | 9 ++++++++- > > 4 files changed, 21 insertions(+), 3 deletions(-) > > > > diff --git a/blockdev.c b/blockdev.c > > index 0827bf7..1dd0f23 100644 > > --- a/blockdev.c > > +++ b/blockdev.c > > @@ -236,6 +236,7 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi) > > const char *devaddr; > > DriveInfo *dinfo; > > int snapshot = 0; > > + int copy_on_read; > > Another s/int/bool/ :-) In general I use bool but in this case I hesitated since the other variables are int I tried to stick with the style. I'm happy to change it if you prefer bool. Stefan