From 718721f0f9d33aa8abafd71bfb9ac1cfef95dc3e Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Tue, 8 Nov 2022 08:08:16 +0100 Subject: [PATCH] qemu: Assume QEMU_CAPS_BLOCKIO MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Introduced in QEMU's commit of v0.13.0-rc0~1072 the .logical_block_size attribute of virtio-blk device is always available for all QEMU versions we support (4.2.0, currently). Therefore, we can assume the capability is always set and thus doesn't need to be checked for. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa Reviewed-by: Ján Tomko --- src/qemu/qemu_command.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 256ef4912c..b0c9fb7059 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1751,8 +1751,8 @@ qemuBuildDiskDeviceProps(const virDomainDef *def, g_autofree char *chardev = NULL; g_autofree char *drive = NULL; unsigned int bootindex = 0; - unsigned int logical_block_size = 0; - unsigned int physical_block_size = 0; + unsigned int logical_block_size = disk->blockio.logical_block_size; + unsigned int physical_block_size = disk->blockio.physical_block_size; g_autoptr(virJSONValue) wwn = NULL; g_autofree char *serial = NULL; virTristateSwitch removable = VIR_TRISTATE_SWITCH_ABSENT; @@ -1886,11 +1886,6 @@ qemuBuildDiskDeviceProps(const virDomainDef *def, if (disk->device != VIR_DOMAIN_DISK_DEVICE_FLOPPY) bootindex = disk->info.effectiveBootIndex; - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKIO)) { - logical_block_size = disk->blockio.logical_block_size; - physical_block_size = disk->blockio.physical_block_size; - } - if (disk->wwn) { unsigned long long w = 0; -- 2.39.5