]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Remove host-passthrough validation check for host-phys-bits=on
authorLin Ma <lma@suse.com>
Thu, 8 Sep 2022 07:07:22 +0000 (15:07 +0800)
committerJim Fehlig <jfehlig@suse.com>
Thu, 29 Sep 2022 14:45:03 +0000 (08:45 -0600)
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 <lma@suse.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
src/qemu/qemu_validate.c
tests/qemuxml2argvdata/cpu-phys-bits-passthrough2.err
tests/qemuxml2argvdata/cpu-phys-bits-passthrough2.xml
tests/qemuxml2argvdata/cpu-phys-bits-passthrough3.err [deleted file]
tests/qemuxml2argvdata/cpu-phys-bits-passthrough3.xml [deleted file]
tests/qemuxml2argvtest.c

index 3327f6e24f0f37cb8c960975ad76e3454a9cc582..34fa10ae323b22a1436f897e32e8dfb86e155b05 100644 (file)
@@ -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'"),
index 22009cc6e64e4053abe00d839a3f55da505bf5cb..28f2e434323b2627b36f731106583203cf99a762 100644 (file)
@@ -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'
index 511bbf9949c4daf1a6647da1163fe1d1212b7abe..a94e567dcb51afe5e0412e3f12ff2f9544b1a5c3 100644 (file)
@@ -8,8 +8,8 @@
     <type arch='x86_64' machine='pc'>hvm</type>
     <boot dev='hd'/>
   </os>
-  <cpu mode='host-model'>
-    <maxphysaddr mode='passthrough'/>
+  <cpu mode='host-passthrough'>
+    <maxphysaddr mode='passthrough' bits='42'/>
   </cpu>
   <clock offset='utc'/>
   <on_poweroff>destroy</on_poweroff>
diff --git a/tests/qemuxml2argvdata/cpu-phys-bits-passthrough3.err b/tests/qemuxml2argvdata/cpu-phys-bits-passthrough3.err
deleted file mode 100644 (file)
index 28f2e43..0000000
+++ /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 (file)
index a94e567..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<domain type='kvm'>
-  <name>foo</name>
-  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
-  <memory unit='KiB'>219136</memory>
-  <currentMemory unit='KiB'>219136</currentMemory>
-  <vcpu placement='static'>1</vcpu>
-  <os>
-    <type arch='x86_64' machine='pc'>hvm</type>
-    <boot dev='hd'/>
-  </os>
-  <cpu mode='host-passthrough'>
-    <maxphysaddr mode='passthrough' bits='42'/>
-  </cpu>
-  <clock offset='utc'/>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>destroy</on_crash>
-  <devices>
-  </devices>
-</domain>
index b7c3bc0e2d1b560b2bf9bb63d9df52c45f788af2..c8b69bbd7a7173e3e9712014d14e033445756cb7 100644 (file)
@@ -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);