virDomainIOMMUDef *iommu = def->iommus[i];
g_autoptr(virJSONValue) props = NULL;
g_autoptr(virJSONValue) wrapperProps = NULL;
+ g_autofree char *granule_mode = NULL;
switch (iommu->model) {
case VIR_DOMAIN_IOMMU_MODEL_INTEL:
break;
case VIR_DOMAIN_IOMMU_MODEL_VIRTIO:
+ if (iommu->granule != 0) {
+ if (iommu->granule == -1) {
+ granule_mode = g_strdup("host");
+ } else {
+ granule_mode = g_strdup_printf("%dk", iommu->granule);
+ }
+ }
+
if (virJSONValueObjectAdd(&props,
"s:driver", "virtio-iommu",
"s:id", iommu->info.alias,
"p:aw-bits", iommu->aw_bits,
+ "S:granule", granule_mode,
NULL) < 0) {
return -1;
}
-rtc base=utc \
-no-shutdown \
-boot strict=on \
--device '{"driver":"virtio-iommu","id":"iommu0","aw-bits":48,"bus":"pcie.0","addr":"0x1"}' \
+-device '{"driver":"virtio-iommu","id":"iommu0","aw-bits":48,"granule":"64k","bus":"pcie.0","addr":"0x1"}' \
-audiodev '{"id":"audio1","driver":"none"}' \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on
-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","granule":"host","bus":"pcie.0","addr":"0x1"}' \
-audiodev '{"id":"audio1","driver":"none"}' \
-global ICH9-LPC.noreboot=off \
-watchdog-action reset \