summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJán Tomko <jtomko@redhat.com>2023-04-25 11:11:59 +0200
committerJán Tomko <jtomko@redhat.com>2023-04-25 11:19:37 +0200
commit03ca889b153f190c8a4ac6950cb93b7cb06cbddc (patch)
tree337b3f5bf3832048944ab2748091dd34946e8274 /src
parente3d95a1eba78f2b797dbdce7d8bd604a8e004961 (diff)
downloadlibvirt-03ca889b153f190c8a4ac6950cb93b7cb06cbddc.tar.gz
qemu: allow forcing emulated maxphysaddr
Treat: <maxphysaddr mode="emulate"/> as a request not to take the maximum address size from the host. This is useful if QEMU changes the default. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/qemu/qemu_command.c5
-rw-r--r--src/qemu/qemu_validate.c7
2 files changed, 4 insertions, 8 deletions
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 77e39d2b79..58a0484b33 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6531,7 +6531,10 @@ qemuBuildCpuCommandLine(virCommand *cmd,
break;
case VIR_CPU_MAX_PHYS_ADDR_MODE_EMULATE:
- virBufferAsprintf(&buf, ",phys-bits=%d", addr->bits);
+ if (addr->bits > 0)
+ virBufferAsprintf(&buf, ",phys-bits=%d", addr->bits);
+ else
+ virBufferAddLit(&buf, ",host-phys-bits=off");
break;
case VIR_CPU_MAX_PHYS_ADDR_MODE_LAST:
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index fdfb4c6407..da4b9a3b35 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -269,13 +269,6 @@ qemuValidateDomainDefCpu(virQEMUDriver *driver,
break;
case VIR_CPU_MAX_PHYS_ADDR_MODE_EMULATE:
- if (addr->bits == -1) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("if using CPU maximum physical address mode='%1$s', bits= must be specified too"),
- virCPUMaxPhysAddrModeTypeToString(VIR_CPU_MAX_PHYS_ADDR_MODE_EMULATE));
- return -1;
- }
-
if (driver->hostcpu &&
driver->hostcpu->addr &&
cpu->addr->bits > driver->hostcpu->addr->bits) {