[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH 12/17] ide/scsi: turn on discard
From: |
Avi Kivity |
Subject: |
Re: [Qemu-devel] [RFC PATCH 12/17] ide/scsi: turn on discard |
Date: |
Thu, 08 Mar 2012 20:17:06 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1 |
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 <address@hidden>
> ---
> 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),
>
<snip>
We should define machines differentially. 0.15 is 1.0, with the
following differences: { }.
--
error compiling committee.c: too many arguments to function
- Re: [Qemu-devel] [RFC PATCH 06/17] block: use bdrv_{co, aio}_discard for write_zeroes operations, (continued)
- [Qemu-devel] [RFC PATCH 04/17] qed: implement bdrv_aio_discard, Paolo Bonzini, 2012/03/08
- [Qemu-devel] [RFC PATCH 10/17] ide/scsi: add discard_zeroes_data property, Paolo Bonzini, 2012/03/08
- [Qemu-devel] [RFC PATCH 09/17] ide: issue discard asynchronously but serialize the pieces, Paolo Bonzini, 2012/03/08
- [Qemu-devel] [RFC PATCH 05/17] block: pass around qiov for write_zeroes operation, Paolo Bonzini, 2012/03/08
- [Qemu-devel] [RFC PATCH 12/17] ide/scsi: turn on discard, Paolo Bonzini, 2012/03/08
- Re: [Qemu-devel] [RFC PATCH 12/17] ide/scsi: turn on discard,
Avi Kivity <=
- [Qemu-devel] [RFC PATCH 01/17] qemu-iotests: add a simple test for write_zeroes, Paolo Bonzini, 2012/03/08
- [Qemu-devel] [RFC PATCH 11/17] ide/scsi: prepare for flipping the discard defaults, Paolo Bonzini, 2012/03/08
- [Qemu-devel] [RFC PATCH 16/17] qemu-io: fix the alloc command, Paolo Bonzini, 2012/03/08
- [Qemu-devel] [RFC PATCH 07/17] block: make high level discard operation always zero, Paolo Bonzini, 2012/03/08
[Qemu-devel] [RFC PATCH 08/17] block: kill the write zeroes operation, Paolo Bonzini, 2012/03/08