diff options
author | Ján Tomko <jtomko@redhat.com> | 2023-04-25 11:11:59 +0200 |
---|---|---|
committer | Ján Tomko <jtomko@redhat.com> | 2023-04-25 11:19:37 +0200 |
commit | 03ca889b153f190c8a4ac6950cb93b7cb06cbddc (patch) | |
tree | 337b3f5bf3832048944ab2748091dd34946e8274 /src | |
parent | e3d95a1eba78f2b797dbdce7d8bd604a8e004961 (diff) | |
download | libvirt-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.c | 5 | ||||
-rw-r--r-- | src/qemu/qemu_validate.c | 7 |
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) { |