[PATCH 13/18] qemuDiskConfigBlkdeviotuneEnabled: Make 'disk' argument const

Peter Krempa posted 18 patches 1 year, 7 months ago
[PATCH 13/18] qemuDiskConfigBlkdeviotuneEnabled: Make 'disk' argument const
Posted by Peter Krempa 1 year, 7 months ago
The function doesn't modify it. Fix the argument declaration so that the
function can be used in a context where we have a 'const' disk
definition.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/qemu/qemu_command.c | 2 +-
 src/qemu/qemu_command.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 15383f646a..cdaa77dcbc 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1550,7 +1550,7 @@ qemuBuildChardevCommand(virCommand *cmd,


 bool
-qemuDiskConfigBlkdeviotuneEnabled(virDomainDiskDef *disk)
+qemuDiskConfigBlkdeviotuneEnabled(const virDomainDiskDef *disk)
 {
     return !!disk->blkdeviotune.group_name ||
            virDomainBlockIoTuneInfoHasAny(&disk->blkdeviotune);
diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
index 5fdb138030..55efa45601 100644
--- a/src/qemu/qemu_command.h
+++ b/src/qemu/qemu_command.h
@@ -208,7 +208,7 @@ qemuBuildZPCIDevProps(virDomainDeviceInfo *dev);
 int qemuNetworkPrepareDevices(virDomainDef *def);

 bool
-qemuDiskConfigBlkdeviotuneEnabled(virDomainDiskDef *disk);
+qemuDiskConfigBlkdeviotuneEnabled(const virDomainDiskDef *disk);

 virJSONValue *qemuBuildHotpluggableCPUProps(const virDomainVcpuDef *vcpu)
     ATTRIBUTE_NONNULL(1);
-- 
2.40.1
Re: [PATCH 13/18] qemuDiskConfigBlkdeviotuneEnabled: Make 'disk' argument const
Posted by Ján Tomko 1 year, 6 months ago
On a Thursday in 2023, Peter Krempa wrote:
>The function doesn't modify it. Fix the argument declaration so that the
>function can be used in a context where we have a 'const' disk
>definition.
>
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> src/qemu/qemu_command.c | 2 +-
> src/qemu/qemu_command.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano