[PATCH 3/6] qemu_command: Generate aw_bits prop for virtio-iommu

Michal Privoznik via Devel posted 6 patches 1 week, 4 days ago
There is a newer version of this series
[PATCH 3/6] qemu_command: Generate aw_bits prop for virtio-iommu
Posted by Michal Privoznik via Devel 1 week, 4 days ago
From: Michal Privoznik <mprivozn@redhat.com>

Resolves: https://issues.redhat.com/browse/RHEL-76269
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/qemu/qemu_command.c                                        | 1 +
 tests/qemuxmlconfdata/virtio-iommu-aarch64.aarch64-latest.args | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 0de0a79b46..6a01d647b9 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6309,6 +6309,7 @@ qemuBuildIOMMUCommandLine(virCommand *cmd,
             if (virJSONValueObjectAdd(&props,
                                       "s:driver", "virtio-iommu",
                                       "s:id", iommu->info.alias,
+                                      "z:aw-bits", iommu->aw_bits,
                                       NULL) < 0) {
                 return -1;
             }
diff --git a/tests/qemuxmlconfdata/virtio-iommu-aarch64.aarch64-latest.args b/tests/qemuxmlconfdata/virtio-iommu-aarch64.aarch64-latest.args
index 40b5bf7766..071bc00b34 100644
--- a/tests/qemuxmlconfdata/virtio-iommu-aarch64.aarch64-latest.args
+++ b/tests/qemuxmlconfdata/virtio-iommu-aarch64.aarch64-latest.args
@@ -28,7 +28,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
 -rtc base=utc \
 -no-shutdown \
 -boot strict=on \
--device '{"driver":"virtio-iommu","id":"iommu0","bus":"pcie.0","addr":"0x1"}' \
+-device '{"driver":"virtio-iommu","id":"iommu0","aw-bits":48,"bus":"pcie.0","addr":"0x1"}' \
 -audiodev '{"id":"audio1","driver":"none"}' \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
-- 
2.52.0
Re: [PATCH 3/6] qemu_command: Generate aw_bits prop for virtio-iommu
Posted by Peter Krempa via Devel 1 week, 4 days ago
On Wed, Jan 21, 2026 at 17:27:19 +0100, Michal Privoznik via Devel wrote:
> From: Michal Privoznik <mprivozn@redhat.com>
> 
> Resolves: https://issues.redhat.com/browse/RHEL-76269
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>  src/qemu/qemu_command.c                                        | 1 +
>  tests/qemuxmlconfdata/virtio-iommu-aarch64.aarch64-latest.args | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index 0de0a79b46..6a01d647b9 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -6309,6 +6309,7 @@ qemuBuildIOMMUCommandLine(virCommand *cmd,
>              if (virJSONValueObjectAdd(&props,
>                                        "s:driver", "virtio-iommu",
>                                        "s:id", iommu->info.alias,
> +                                      "z:aw-bits", iommu->aw_bits,

struct _virDomainIOMMUDef {
    virDomainIOMMUModel model;
    virTristateSwitch intremap;
    virTristateSwitch caching_mode;
    virTristateSwitch eim;
    virTristateSwitch iotlb;
    unsigned int aw_bits;

    ^^^^^^^

virJSONValueObjectAddVArgs:

 * k: signed integer value, omitted if negative
 * z: signed integer value, omitted if zero

      ^^^^^^

 * y: signed integer value, omitted if zero, error if negative

 [...]

  * p: unsigned integer value, omitted if zero
Re: [PATCH 3/6] qemu_command: Generate aw_bits prop for virtio-iommu
Posted by Michal Prívozník via Devel 1 week, 3 days ago
On 1/21/26 18:00, Peter Krempa wrote:
> On Wed, Jan 21, 2026 at 17:27:19 +0100, Michal Privoznik via Devel wrote:
>> From: Michal Privoznik <mprivozn@redhat.com>
>>
>> Resolves: https://issues.redhat.com/browse/RHEL-76269
>> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
>> ---
>>  src/qemu/qemu_command.c                                        | 1 +
>>  tests/qemuxmlconfdata/virtio-iommu-aarch64.aarch64-latest.args | 2 +-
>>  2 files changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
>> index 0de0a79b46..6a01d647b9 100644
>> --- a/src/qemu/qemu_command.c
>> +++ b/src/qemu/qemu_command.c
>> @@ -6309,6 +6309,7 @@ qemuBuildIOMMUCommandLine(virCommand *cmd,
>>              if (virJSONValueObjectAdd(&props,
>>                                        "s:driver", "virtio-iommu",
>>                                        "s:id", iommu->info.alias,
>> +                                      "z:aw-bits", iommu->aw_bits,
> 
> struct _virDomainIOMMUDef {
>     virDomainIOMMUModel model;
>     virTristateSwitch intremap;
>     virTristateSwitch caching_mode;
>     virTristateSwitch eim;
>     virTristateSwitch iotlb;
>     unsigned int aw_bits;
> 
>     ^^^^^^^
> 
> virJSONValueObjectAddVArgs:
> 
>  * k: signed integer value, omitted if negative
>  * z: signed integer value, omitted if zero
> 
>       ^^^^^^
> 
>  * y: signed integer value, omitted if zero, error if negative
> 
>  [...]
> 
>   * p: unsigned integer value, omitted if zero
> 
> 

Darn. I've just copied the line over from intel case. Let me post a fix
for that one first. Nice catch!

Michal