From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34216) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5hts-0006ME-SZ for qemu-devel@nongnu.org; Thu, 08 Mar 2012 13:17:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5htl-0008SJ-O1 for qemu-devel@nongnu.org; Thu, 08 Mar 2012 13:17:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:16370) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5htl-0008S8-GE for qemu-devel@nongnu.org; Thu, 08 Mar 2012 13:17:09 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q28IH8Zt019012 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 8 Mar 2012 13:17:08 -0500 Message-ID: <4F58F7A2.1070705@redhat.com> Date: Thu, 08 Mar 2012 20:17:06 +0200 From: Avi Kivity MIME-Version: 1.0 References: <1331226917-6658-1-git-send-email-pbonzini@redhat.com> <1331226917-6658-13-git-send-email-pbonzini@redhat.com> In-Reply-To: <1331226917-6658-13-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 12/17] ide/scsi: turn on discard List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On 03/08/2012 07:15 PM, Paolo Bonzini wrote: > Turn on discard support in the device models by default, with > compatibility properties for older machine types. > > Signed-off-by: Paolo Bonzini > --- > block.h | 4 +- > hw/pc_piix.c | 224 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 226 insertions(+), 2 deletions(-) > > diff --git a/block.h b/block.h > index aa224d3..1a8fd2d 100644 > --- a/block.h > +++ b/block.h > @@ -449,9 +449,9 @@ static inline unsigned int get_physical_block_exp(BlockConf *conf) > DEFINE_PROP_UINT32("opt_io_size", _state, _conf.opt_io_size, 0), \ > DEFINE_PROP_INT32("bootindex", _state, _conf.bootindex, -1), \ > DEFINE_PROP_BIT("discard_zeroes_data", _state, \ > - _conf.discard_zeroes_data, 0, false), \ > + _conf.discard_zeroes_data, 0, true), \ > DEFINE_PROP_INT32("discard_granularity", _state, \ > - _conf.discard_granularity, 0) > + _conf.discard_granularity, -1) > > #endif > > diff --git a/hw/pc_piix.c b/hw/pc_piix.c > index 6c5c40f..0356424 100644 > --- a/hw/pc_piix.c > +++ b/hw/pc_piix.c > @@ -381,6 +381,38 @@ static QEMUMachine pc_machine_v1_0 = { > .max_cpus = 255, > .compat_props = (GlobalProperty[]) { > { > + .driver = "ide-drive", > + .property = "discard_granularity", > + .value = stringify(0), > + }, { > + .driver = "ide-drive", > + .property = "discard_zeroes_data", > + .value = "off", > + }, { > + .driver = "ide-hd", > + .property = "discard_granularity", > + .value = stringify(0), > + }, { > + .driver = "ide-hd", > + .property = "discard_zeroes_data", > + .value = "off", > + }, { > + .driver = "scsi-disk", > + .property = "discard_granularity", > + .value = stringify(0), > + }, { > + .driver = "scsi-disk", > + .property = "discard_zeroes_data", > + .value = "off", > + }, { > + .driver = "scsi-hd", > + .property = "discard_granularity", > + .value = stringify(0), > + }, { > + .driver = "scsi-hd", > + .property = "discard_zeroes_data", > + .value = "off", > + }, { > .driver = "pc-sysfw", > .property = "rom_only", > .value = stringify(1), > @@ -400,6 +432,38 @@ static QEMUMachine pc_machine_v0_15 = { > .max_cpus = 255, > .compat_props = (GlobalProperty[]) { > { > + .driver = "ide-drive", > + .property = "discard_granularity", > + .value = stringify(0), > We should define machines differentially. 0.15 is 1.0, with the following differences: { }. -- error compiling committee.c: too many arguments to function