From 85aafea4499b20a43d5c208143fc1582ab3d6c84 Mon Sep 17 00:00:00 2001 From: Lin Ma Date: Thu, 8 Sep 2022 15:07:22 +0800 Subject: [PATCH] qemu: Remove host-passthrough validation check for host-phys-bits=on Besides the -cpu host, The host-phys-bits=on applies to custom or max cpu model, So the host-passthrough validation check is unnecessary for maxphysaddr with mode='passthrough'. Signed-off-by: Lin Ma Reviewed-by: Jim Fehlig --- src/qemu/qemu_validate.c | 7 ------- .../cpu-phys-bits-passthrough2.err | 2 +- .../cpu-phys-bits-passthrough2.xml | 4 ++-- .../cpu-phys-bits-passthrough3.err | 1 - .../cpu-phys-bits-passthrough3.xml | 20 ------------------- tests/qemuxml2argvtest.c | 1 - 6 files changed, 3 insertions(+), 32 deletions(-) delete mode 100644 tests/qemuxml2argvdata/cpu-phys-bits-passthrough3.err delete mode 100644 tests/qemuxml2argvdata/cpu-phys-bits-passthrough3.xml diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 3327f6e24f..34fa10ae32 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -344,13 +344,6 @@ qemuValidateDomainDefCpu(virQEMUDriver *driver, switch (addr->mode) { case VIR_CPU_MAX_PHYS_ADDR_MODE_PASSTHROUGH: - if (def->cpu->mode != VIR_CPU_MODE_HOST_PASSTHROUGH) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("CPU maximum physical address bits mode '%s' can only be used with '%s' CPUs"), - virCPUMaxPhysAddrModeTypeToString(addr->mode), - virCPUModeTypeToString(VIR_CPU_MODE_HOST_PASSTHROUGH)); - return -1; - } if (addr->bits != -1) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("CPU maximum physical address bits number specification cannot be used with mode='%s'"), diff --git a/tests/qemuxml2argvdata/cpu-phys-bits-passthrough2.err b/tests/qemuxml2argvdata/cpu-phys-bits-passthrough2.err index 22009cc6e6..28f2e43432 100644 --- a/tests/qemuxml2argvdata/cpu-phys-bits-passthrough2.err +++ b/tests/qemuxml2argvdata/cpu-phys-bits-passthrough2.err @@ -1 +1 @@ -unsupported configuration: CPU maximum physical address bits mode 'passthrough' can only be used with 'host-passthrough' CPUs +unsupported configuration: CPU maximum physical address bits number specification cannot be used with mode='passthrough' diff --git a/tests/qemuxml2argvdata/cpu-phys-bits-passthrough2.xml b/tests/qemuxml2argvdata/cpu-phys-bits-passthrough2.xml index 511bbf9949..a94e567dcb 100644 --- a/tests/qemuxml2argvdata/cpu-phys-bits-passthrough2.xml +++ b/tests/qemuxml2argvdata/cpu-phys-bits-passthrough2.xml @@ -8,8 +8,8 @@ hvm - - + + destroy diff --git a/tests/qemuxml2argvdata/cpu-phys-bits-passthrough3.err b/tests/qemuxml2argvdata/cpu-phys-bits-passthrough3.err deleted file mode 100644 index 28f2e43432..0000000000 --- a/tests/qemuxml2argvdata/cpu-phys-bits-passthrough3.err +++ /dev/null @@ -1 +0,0 @@ -unsupported configuration: CPU maximum physical address bits number specification cannot be used with mode='passthrough' diff --git a/tests/qemuxml2argvdata/cpu-phys-bits-passthrough3.xml b/tests/qemuxml2argvdata/cpu-phys-bits-passthrough3.xml deleted file mode 100644 index a94e567dcb..0000000000 --- a/tests/qemuxml2argvdata/cpu-phys-bits-passthrough3.xml +++ /dev/null @@ -1,20 +0,0 @@ - - foo - c7a5fdbd-edaf-9455-926a-d65c16db1809 - 219136 - 219136 - 1 - - hvm - - - - - - - destroy - restart - destroy - - - diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index b7c3bc0e2d..c8b69bbd7a 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -3240,7 +3240,6 @@ mymain(void) DO_TEST("cpu-phys-bits-emulate2", QEMU_CAPS_KVM); DO_TEST_PARSE_ERROR("cpu-phys-bits-emulate3", QEMU_CAPS_KVM); DO_TEST_PARSE_ERROR("cpu-phys-bits-passthrough2", QEMU_CAPS_KVM); - DO_TEST_PARSE_ERROR("cpu-phys-bits-passthrough3", QEMU_CAPS_KVM); if (getenv("LIBVIRT_SKIP_CLEANUP") == NULL) virFileDeleteTree(fakerootdir);