Re: [PATCH 2/5] qemu: add support for discard_granularity

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

 



On Wed, Aug 02, 2023 at 13:47:15 +0200, Kristina Hanicova wrote:
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1849570
> 
> Signed-off-by: Kristina Hanicova <khanicov@xxxxxxxxxx>
> ---
>  src/qemu/qemu_command.c                                | 2 ++
>  src/vz/vz_utils.c                                      | 3 ++-
>  tests/qemuxml2argvdata/disk-blockio.x86_64-latest.args | 2 +-
>  tests/qemuxml2argvdata/disk-blockio.xml                | 2 +-
>  4 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index 64af0b5ea9..23810bc067 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -1760,6 +1760,7 @@ qemuBuildDiskDeviceProps(const virDomainDef *def,
>      unsigned int bootindex = 0;
>      unsigned int logical_block_size = disk->blockio.logical_block_size;
>      unsigned int physical_block_size = disk->blockio.physical_block_size;
> +    unsigned int discard_granularity = disk->blockio.discard_granularity;
>      g_autoptr(virJSONValue) wwn = NULL;
>      g_autofree char *serial = NULL;
>      virTristateSwitch removable = VIR_TRISTATE_SWITCH_ABSENT;
> @@ -1939,6 +1940,7 @@ qemuBuildDiskDeviceProps(const virDomainDef *def,
>                                "p:bootindex", bootindex,
>                                "p:logical_block_size", logical_block_size,
>                                "p:physical_block_size", physical_block_size,
> +                              "p:discard_granularity", discard_granularity,

This is a device frontend property, so you'll also need to add it to the
ABI stability check and make sure it doesn't differ between cases when
same ABI is required.

See virDomainDiskDefCheckABIStability

Note that logical_block_size and physical_block_size ought to have the
same treatment.




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux