[virt-tools-list] [PATCH] virtinst: add <vmcoreinfo/> feature support

marcandre.lureau at redhat.com marcandre.lureau at redhat.com
Tue Feb 20 19:30:41 UTC 2018


From: Marc-André Lureau <marcandre.lureau at redhat.com>

The <vmcoreinfo> feature allows a guest to provide debug details when
producing dump. It's useful in particular for Linux guests with KASLR
enabled, as otherwise the dump are difficult to analyze.

This patch adds virt-install support for vmcoreinfo domain
feature. Whenever the host libvirt/qemu is recent enough, and the VM
is x86 or arm-virt, we can assume <vmcoreinfo/> is supported and
enable it safely by default (unless --feature vmcoreinfo=on/off is
given, or changed via API)

Note: I am not quite sure if the tests update require
compare_check=support.SUPPORT_CONN_VMCOREINFO has was done for vmport
in commit 2d572e02bd619bbbb460f9db3bd671147600926d.

Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
---
 tests/cli-test-xml/compare/virt-convert-ovf-compare.xml             | 1 +
 tests/cli-test-xml/compare/virt-convert-vmx-compare.xml             | 1 +
 tests/cli-test-xml/compare/virt-install-aarch64-cdrom.xml           | 6 ++++++
 tests/cli-test-xml/compare/virt-install-aarch64-graphics.xml        | 3 +++
 tests/cli-test-xml/compare/virt-install-aarch64-kvm-gic.xml         | 1 +
 tests/cli-test-xml/compare/virt-install-aarch64-kvm-import.xml      | 3 +++
 tests/cli-test-xml/compare/virt-install-aarch64-machdefault.xml     | 3 +++
 tests/cli-test-xml/compare/virt-install-aarch64-machvirt.xml        | 3 +++
 tests/cli-test-xml/compare/virt-install-arm-defaultmach-f20.xml     | 3 +++
 tests/cli-test-xml/compare/virt-install-arm-kvm-import.xml          | 3 +++
 tests/cli-test-xml/compare/virt-install-arm-virt-f20.xml            | 3 +++
 tests/cli-test-xml/compare/virt-install-boot-uefi.xml               | 1 +
 tests/cli-test-xml/compare/virt-install-f21-kvm-remote.xml          | 1 +
 tests/cli-test-xml/compare/virt-install-kvm-centos7.xml             | 2 ++
 tests/cli-test-xml/compare/virt-install-kvm-f14-url.xml             | 2 ++
 tests/cli-test-xml/compare/virt-install-kvm-rhel6.xml               | 2 ++
 tests/cli-test-xml/compare/virt-install-kvm-rhel7.xml               | 2 ++
 tests/cli-test-xml/compare/virt-install-kvm-session-defaults.xml    | 2 ++
 tests/cli-test-xml/compare/virt-install-kvm-win2k3-cdrom.xml        | 2 ++
 tests/cli-test-xml/compare/virt-install-location-iso.xml            | 2 ++
 tests/cli-test-xml/compare/virt-install-location-nfs.xml            | 2 ++
 tests/cli-test-xml/compare/virt-install-many-devices.xml            | 1 +
 tests/cli-test-xml/compare/virt-install-panic-default.xml           | 1 +
 tests/cli-test-xml/compare/virt-install-panic-isa-iobase.xml        | 1 +
 tests/cli-test-xml/compare/virt-install-panic-isa.xml               | 1 +
 tests/cli-test-xml/compare/virt-install-q35-defaults.xml            | 2 ++
 tests/cli-test-xml/compare/virt-install-qemu-32-on-64.xml           | 1 +
 tests/cli-test-xml/compare/virt-install-qemu-plain.xml              | 1 +
 tests/cli-test-xml/compare/virt-install-singleton-config-1.xml      | 1 +
 tests/cli-test-xml/compare/virt-install-solaris10-defaults.xml      | 1 +
 tests/cli-test-xml/compare/virt-install-spice-gl.xml                | 1 +
 tests/cli-test-xml/compare/virt-install-win7-uefi.xml               | 2 ++
 tests/clitest.py                                                    | 2 +-
 .../virtconv-files/libvirt_output/ovf2libvirt_ovf_directory.libvirt | 1 +
 tests/virtconv-files/libvirt_output/ovf2libvirt_test1.libvirt       | 1 +
 .../libvirt_output/ovf2libvirt_test1.libvirt.disk_qcow2             | 1 +
 tests/virtconv-files/libvirt_output/ovf2libvirt_test2.libvirt       | 1 +
 tests/virtconv-files/libvirt_output/ovf2libvirt_test_gzip.libvirt   | 1 +
 .../libvirt_output/ovf2libvirt_test_gzip.libvirt.disk_raw           | 1 +
 .../virtconv-files/libvirt_output/vmx2libvirt_test-nodisks.libvirt  | 1 +
 .../virtconv-files/libvirt_output/vmx2libvirt_test-vmx-zip.libvirt  | 1 +
 tests/virtconv-files/libvirt_output/vmx2libvirt_test1.libvirt       | 1 +
 .../libvirt_output/vmx2libvirt_test1.libvirt.disk_raw               | 1 +
 tests/virtconv-files/libvirt_output/vmx2libvirt_vmx-dir.libvirt     | 1 +
 tests/xmlparse-xml/change-guest-out.xml                             | 1 +
 tests/xmlparse.py                                                   | 1 +
 virtinst/cli.py                                                     | 1 +
 virtinst/domainfeatures.py                                          | 2 ++
 virtinst/guest.py                                                   | 5 +++++
 virtinst/support.py                                                 | 2 ++
 50 files changed, 85 insertions(+), 1 deletion(-)

diff --git a/tests/cli-test-xml/compare/virt-convert-ovf-compare.xml b/tests/cli-test-xml/compare/virt-convert-ovf-compare.xml
index 2d90abfc..b42452e9 100644
--- a/tests/cli-test-xml/compare/virt-convert-ovf-compare.xml
+++ b/tests/cli-test-xml/compare/virt-convert-ovf-compare.xml
@@ -13,6 +13,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/cli-test-xml/compare/virt-convert-vmx-compare.xml b/tests/cli-test-xml/compare/virt-convert-vmx-compare.xml
index 21dbcd65..deafc161 100644
--- a/tests/cli-test-xml/compare/virt-convert-vmx-compare.xml
+++ b/tests/cli-test-xml/compare/virt-convert-vmx-compare.xml
@@ -12,6 +12,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/cli-test-xml/compare/virt-install-aarch64-cdrom.xml b/tests/cli-test-xml/compare/virt-install-aarch64-cdrom.xml
index 86eebdc0..16849454 100644
--- a/tests/cli-test-xml/compare/virt-install-aarch64-cdrom.xml
+++ b/tests/cli-test-xml/compare/virt-install-aarch64-cdrom.xml
@@ -11,6 +11,9 @@
     <boot dev="cdrom"/>
     <boot dev="hd"/>
   </os>
+  <features>
+    <vmcoreinfo/>
+  </features>
   <clock offset="utc"/>
   <on_poweroff>restart</on_poweroff>
   <on_reboot>destroy</on_reboot>
@@ -50,6 +53,9 @@
     <nvram template="VARS.fd"/>
     <boot dev="hd"/>
   </os>
+  <features>
+    <vmcoreinfo/>
+  </features>
   <clock offset="utc"/>
   <on_poweroff>restart</on_poweroff>
   <on_reboot>destroy</on_reboot>
diff --git a/tests/cli-test-xml/compare/virt-install-aarch64-graphics.xml b/tests/cli-test-xml/compare/virt-install-aarch64-graphics.xml
index 9ee6ced3..092668a9 100644
--- a/tests/cli-test-xml/compare/virt-install-aarch64-graphics.xml
+++ b/tests/cli-test-xml/compare/virt-install-aarch64-graphics.xml
@@ -9,6 +9,9 @@
     <loader readonly="yes" type="pflash">/usr/share/AAVMF/AAVMF_CODE.fd</loader>
     <boot dev="hd"/>
   </os>
+  <features>
+    <vmcoreinfo/>
+  </features>
   <cpu mode="host-passthrough"/>
   <clock offset="utc"/>
   <devices>
diff --git a/tests/cli-test-xml/compare/virt-install-aarch64-kvm-gic.xml b/tests/cli-test-xml/compare/virt-install-aarch64-kvm-gic.xml
index 3a761902..08d84623 100644
--- a/tests/cli-test-xml/compare/virt-install-aarch64-kvm-gic.xml
+++ b/tests/cli-test-xml/compare/virt-install-aarch64-kvm-gic.xml
@@ -11,6 +11,7 @@
   </os>
   <features>
     <gic version="host"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="host-passthrough"/>
   <clock offset="utc"/>
diff --git a/tests/cli-test-xml/compare/virt-install-aarch64-kvm-import.xml b/tests/cli-test-xml/compare/virt-install-aarch64-kvm-import.xml
index 447741f1..0e1faad4 100644
--- a/tests/cli-test-xml/compare/virt-install-aarch64-kvm-import.xml
+++ b/tests/cli-test-xml/compare/virt-install-aarch64-kvm-import.xml
@@ -9,6 +9,9 @@
     <loader readonly="yes" type="pflash">/usr/share/AAVMF/AAVMF_CODE.fd</loader>
     <boot dev="hd"/>
   </os>
+  <features>
+    <vmcoreinfo/>
+  </features>
   <cpu mode="host-passthrough"/>
   <clock offset="utc"/>
   <devices>
diff --git a/tests/cli-test-xml/compare/virt-install-aarch64-machdefault.xml b/tests/cli-test-xml/compare/virt-install-aarch64-machdefault.xml
index 2a60a967..a0b7eaaa 100644
--- a/tests/cli-test-xml/compare/virt-install-aarch64-machdefault.xml
+++ b/tests/cli-test-xml/compare/virt-install-aarch64-machdefault.xml
@@ -10,6 +10,9 @@
     <initrd>/f19-arm.initrd</initrd>
     <cmdline>console=ttyAMA0,1234 rw root=/dev/vda3</cmdline>
   </os>
+  <features>
+    <vmcoreinfo/>
+  </features>
   <cpu mode="custom" match="exact">
     <model>cortex-a57</model>
   </cpu>
diff --git a/tests/cli-test-xml/compare/virt-install-aarch64-machvirt.xml b/tests/cli-test-xml/compare/virt-install-aarch64-machvirt.xml
index 2a60a967..a0b7eaaa 100644
--- a/tests/cli-test-xml/compare/virt-install-aarch64-machvirt.xml
+++ b/tests/cli-test-xml/compare/virt-install-aarch64-machvirt.xml
@@ -10,6 +10,9 @@
     <initrd>/f19-arm.initrd</initrd>
     <cmdline>console=ttyAMA0,1234 rw root=/dev/vda3</cmdline>
   </os>
+  <features>
+    <vmcoreinfo/>
+  </features>
   <cpu mode="custom" match="exact">
     <model>cortex-a57</model>
   </cpu>
diff --git a/tests/cli-test-xml/compare/virt-install-arm-defaultmach-f20.xml b/tests/cli-test-xml/compare/virt-install-arm-defaultmach-f20.xml
index 50ac211b..8daadafc 100644
--- a/tests/cli-test-xml/compare/virt-install-arm-defaultmach-f20.xml
+++ b/tests/cli-test-xml/compare/virt-install-arm-defaultmach-f20.xml
@@ -10,6 +10,9 @@
     <initrd>/f19-arm.initrd</initrd>
     <cmdline>foo</cmdline>
   </os>
+  <features>
+    <vmcoreinfo/>
+  </features>
   <clock offset="utc"/>
   <devices>
     <emulator>/usr/bin/qemu-system-arm</emulator>
diff --git a/tests/cli-test-xml/compare/virt-install-arm-kvm-import.xml b/tests/cli-test-xml/compare/virt-install-arm-kvm-import.xml
index b1a98b75..0b96d19e 100644
--- a/tests/cli-test-xml/compare/virt-install-arm-kvm-import.xml
+++ b/tests/cli-test-xml/compare/virt-install-arm-kvm-import.xml
@@ -8,6 +8,9 @@
     <type arch="armv7l" machine="virt">hvm</type>
     <boot dev="hd"/>
   </os>
+  <features>
+    <vmcoreinfo/>
+  </features>
   <cpu mode="host-passthrough"/>
   <clock offset="utc"/>
   <devices>
diff --git a/tests/cli-test-xml/compare/virt-install-arm-virt-f20.xml b/tests/cli-test-xml/compare/virt-install-arm-virt-f20.xml
index 6744b723..35f418cb 100644
--- a/tests/cli-test-xml/compare/virt-install-arm-virt-f20.xml
+++ b/tests/cli-test-xml/compare/virt-install-arm-virt-f20.xml
@@ -10,6 +10,9 @@
     <initrd>/f19-arm.initrd</initrd>
     <cmdline>console=ttyAMA0,1234 rw root=/dev/vda3</cmdline>
   </os>
+  <features>
+    <vmcoreinfo/>
+  </features>
   <clock offset="utc"/>
   <devices>
     <emulator>/usr/bin/qemu-system-arm</emulator>
diff --git a/tests/cli-test-xml/compare/virt-install-boot-uefi.xml b/tests/cli-test-xml/compare/virt-install-boot-uefi.xml
index 22f31e6b..349ce36c 100644
--- a/tests/cli-test-xml/compare/virt-install-boot-uefi.xml
+++ b/tests/cli-test-xml/compare/virt-install-boot-uefi.xml
@@ -14,6 +14,7 @@
     <apic/>
     <smm state="on"/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/cli-test-xml/compare/virt-install-f21-kvm-remote.xml b/tests/cli-test-xml/compare/virt-install-f21-kvm-remote.xml
index 34f95aaf..7fa445af 100644
--- a/tests/cli-test-xml/compare/virt-install-f21-kvm-remote.xml
+++ b/tests/cli-test-xml/compare/virt-install-f21-kvm-remote.xml
@@ -12,6 +12,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/cli-test-xml/compare/virt-install-kvm-centos7.xml b/tests/cli-test-xml/compare/virt-install-kvm-centos7.xml
index 22c81fde..01eea36a 100644
--- a/tests/cli-test-xml/compare/virt-install-kvm-centos7.xml
+++ b/tests/cli-test-xml/compare/virt-install-kvm-centos7.xml
@@ -13,6 +13,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
@@ -83,6 +84,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/cli-test-xml/compare/virt-install-kvm-f14-url.xml b/tests/cli-test-xml/compare/virt-install-kvm-f14-url.xml
index d8443261..46cd298f 100644
--- a/tests/cli-test-xml/compare/virt-install-kvm-f14-url.xml
+++ b/tests/cli-test-xml/compare/virt-install-kvm-f14-url.xml
@@ -14,6 +14,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="host-model"/>
   <clock offset="utc">
@@ -74,6 +75,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="host-model"/>
   <clock offset="utc">
diff --git a/tests/cli-test-xml/compare/virt-install-kvm-rhel6.xml b/tests/cli-test-xml/compare/virt-install-kvm-rhel6.xml
index 22c81fde..01eea36a 100644
--- a/tests/cli-test-xml/compare/virt-install-kvm-rhel6.xml
+++ b/tests/cli-test-xml/compare/virt-install-kvm-rhel6.xml
@@ -13,6 +13,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
@@ -83,6 +84,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/cli-test-xml/compare/virt-install-kvm-rhel7.xml b/tests/cli-test-xml/compare/virt-install-kvm-rhel7.xml
index 22c81fde..01eea36a 100644
--- a/tests/cli-test-xml/compare/virt-install-kvm-rhel7.xml
+++ b/tests/cli-test-xml/compare/virt-install-kvm-rhel7.xml
@@ -13,6 +13,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
@@ -83,6 +84,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/cli-test-xml/compare/virt-install-kvm-session-defaults.xml b/tests/cli-test-xml/compare/virt-install-kvm-session-defaults.xml
index 423c0680..2889883e 100644
--- a/tests/cli-test-xml/compare/virt-install-kvm-session-defaults.xml
+++ b/tests/cli-test-xml/compare/virt-install-kvm-session-defaults.xml
@@ -13,6 +13,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
@@ -91,6 +92,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/cli-test-xml/compare/virt-install-kvm-win2k3-cdrom.xml b/tests/cli-test-xml/compare/virt-install-kvm-win2k3-cdrom.xml
index 357cbd23..41490737 100644
--- a/tests/cli-test-xml/compare/virt-install-kvm-win2k3-cdrom.xml
+++ b/tests/cli-test-xml/compare/virt-install-kvm-win2k3-cdrom.xml
@@ -13,6 +13,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
     <hyperv>
       <relaxed state="on"/>
       <vapic state="on"/>
@@ -81,6 +82,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
     <hyperv>
       <relaxed state="on"/>
       <vapic state="on"/>
diff --git a/tests/cli-test-xml/compare/virt-install-location-iso.xml b/tests/cli-test-xml/compare/virt-install-location-iso.xml
index 8a627629..896ba620 100644
--- a/tests/cli-test-xml/compare/virt-install-location-iso.xml
+++ b/tests/cli-test-xml/compare/virt-install-location-iso.xml
@@ -13,6 +13,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
@@ -74,6 +75,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/cli-test-xml/compare/virt-install-location-nfs.xml b/tests/cli-test-xml/compare/virt-install-location-nfs.xml
index 5496a1d3..c50415f8 100644
--- a/tests/cli-test-xml/compare/virt-install-location-nfs.xml
+++ b/tests/cli-test-xml/compare/virt-install-location-nfs.xml
@@ -14,6 +14,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
@@ -73,6 +74,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/cli-test-xml/compare/virt-install-many-devices.xml b/tests/cli-test-xml/compare/virt-install-many-devices.xml
index e265b049..dcc559ae 100644
--- a/tests/cli-test-xml/compare/virt-install-many-devices.xml
+++ b/tests/cli-test-xml/compare/virt-install-many-devices.xml
@@ -11,6 +11,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu>
     <topology sockets="4" cores="1" threads="1"/>
diff --git a/tests/cli-test-xml/compare/virt-install-panic-default.xml b/tests/cli-test-xml/compare/virt-install-panic-default.xml
index b391a290..df66e53b 100644
--- a/tests/cli-test-xml/compare/virt-install-panic-default.xml
+++ b/tests/cli-test-xml/compare/virt-install-panic-default.xml
@@ -11,6 +11,7 @@
   <features>
     <acpi/>
     <apic/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/cli-test-xml/compare/virt-install-panic-isa-iobase.xml b/tests/cli-test-xml/compare/virt-install-panic-isa-iobase.xml
index 714cb56b..6cd279e9 100644
--- a/tests/cli-test-xml/compare/virt-install-panic-isa-iobase.xml
+++ b/tests/cli-test-xml/compare/virt-install-panic-isa-iobase.xml
@@ -11,6 +11,7 @@
   <features>
     <acpi/>
     <apic/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/cli-test-xml/compare/virt-install-panic-isa.xml b/tests/cli-test-xml/compare/virt-install-panic-isa.xml
index b391a290..df66e53b 100644
--- a/tests/cli-test-xml/compare/virt-install-panic-isa.xml
+++ b/tests/cli-test-xml/compare/virt-install-panic-isa.xml
@@ -11,6 +11,7 @@
   <features>
     <acpi/>
     <apic/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/cli-test-xml/compare/virt-install-q35-defaults.xml b/tests/cli-test-xml/compare/virt-install-q35-defaults.xml
index 657c5e07..528a57aa 100644
--- a/tests/cli-test-xml/compare/virt-install-q35-defaults.xml
+++ b/tests/cli-test-xml/compare/virt-install-q35-defaults.xml
@@ -13,6 +13,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
@@ -83,6 +84,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/cli-test-xml/compare/virt-install-qemu-32-on-64.xml b/tests/cli-test-xml/compare/virt-install-qemu-32-on-64.xml
index 1597b2cd..971ea5ec 100644
--- a/tests/cli-test-xml/compare/virt-install-qemu-32-on-64.xml
+++ b/tests/cli-test-xml/compare/virt-install-qemu-32-on-64.xml
@@ -12,6 +12,7 @@
     <acpi/>
     <apic/>
     <pae/>
+    <vmcoreinfo/>
   </features>
   <clock offset="utc">
     <timer name="rtc" tickpolicy="catchup"/>
diff --git a/tests/cli-test-xml/compare/virt-install-qemu-plain.xml b/tests/cli-test-xml/compare/virt-install-qemu-plain.xml
index 3273e0e4..249e355a 100644
--- a/tests/cli-test-xml/compare/virt-install-qemu-plain.xml
+++ b/tests/cli-test-xml/compare/virt-install-qemu-plain.xml
@@ -12,6 +12,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Penryn</model>
diff --git a/tests/cli-test-xml/compare/virt-install-singleton-config-1.xml b/tests/cli-test-xml/compare/virt-install-singleton-config-1.xml
index fc22e0ac..da1047b6 100644
--- a/tests/cli-test-xml/compare/virt-install-singleton-config-1.xml
+++ b/tests/cli-test-xml/compare/virt-install-singleton-config-1.xml
@@ -22,6 +22,7 @@
   <features>
     <acpi/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="host-model"/>
   <clock offset="localtime">
diff --git a/tests/cli-test-xml/compare/virt-install-solaris10-defaults.xml b/tests/cli-test-xml/compare/virt-install-solaris10-defaults.xml
index 6d8b9fde..c52f55e7 100644
--- a/tests/cli-test-xml/compare/virt-install-solaris10-defaults.xml
+++ b/tests/cli-test-xml/compare/virt-install-solaris10-defaults.xml
@@ -12,6 +12,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/cli-test-xml/compare/virt-install-spice-gl.xml b/tests/cli-test-xml/compare/virt-install-spice-gl.xml
index 095c43e5..ee60f78a 100644
--- a/tests/cli-test-xml/compare/virt-install-spice-gl.xml
+++ b/tests/cli-test-xml/compare/virt-install-spice-gl.xml
@@ -12,6 +12,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/cli-test-xml/compare/virt-install-win7-uefi.xml b/tests/cli-test-xml/compare/virt-install-win7-uefi.xml
index 796ff73f..5c9256a0 100644
--- a/tests/cli-test-xml/compare/virt-install-win7-uefi.xml
+++ b/tests/cli-test-xml/compare/virt-install-win7-uefi.xml
@@ -15,6 +15,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
@@ -88,6 +89,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/clitest.py b/tests/clitest.py
index abdd9b92..20195eae 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -440,7 +440,7 @@ cache.mode=emulate,cache.level=3 \
 --memtune hard_limit=10,soft_limit=20,swap_hard_limit=30,min_guarantee=40 \
 --blkiotune weight=100,device_path=/home/test/1.img,device_weight=200 \
 --memorybacking size=1,unit='G',nodeset='1,2-5',nosharepages=yes,locked=yes \
---features acpi=off,eoi=on,privnet=on,hyperv_synic=on,hyperv_reset=on,hyperv_spinlocks=on,hyperv_spinlocks_retries=1234,vmport=off,pmu=off \
+--features acpi=off,eoi=on,privnet=on,hyperv_synic=on,hyperv_reset=on,hyperv_spinlocks=on,hyperv_spinlocks_retries=1234,vmport=off,pmu=off,vmcoreinfo=off \
 --clock offset=utc,hpet_present=no,rtc_tickpolicy=merge \
 --sysinfo type=smbios,bios_vendor="Acme LLC",bios_version=1.2.3,bios_date=01/01/1970,bios_release=10.22 \
 --sysinfo type=smbios,system_manufacturer="Acme Inc.",system_product=Computer,system_version=3.2.1,system_serial=123456789,system_uuid=00000000-1111-2222-3333-444444444444,system_sku=abc-123,system_family=Server \
diff --git a/tests/virtconv-files/libvirt_output/ovf2libvirt_ovf_directory.libvirt b/tests/virtconv-files/libvirt_output/ovf2libvirt_ovf_directory.libvirt
index 92629480..37db0860 100644
--- a/tests/virtconv-files/libvirt_output/ovf2libvirt_ovf_directory.libvirt
+++ b/tests/virtconv-files/libvirt_output/ovf2libvirt_ovf_directory.libvirt
@@ -12,6 +12,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/virtconv-files/libvirt_output/ovf2libvirt_test1.libvirt b/tests/virtconv-files/libvirt_output/ovf2libvirt_test1.libvirt
index a3d5b8d7..de252a4f 100644
--- a/tests/virtconv-files/libvirt_output/ovf2libvirt_test1.libvirt
+++ b/tests/virtconv-files/libvirt_output/ovf2libvirt_test1.libvirt
@@ -13,6 +13,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/virtconv-files/libvirt_output/ovf2libvirt_test1.libvirt.disk_qcow2 b/tests/virtconv-files/libvirt_output/ovf2libvirt_test1.libvirt.disk_qcow2
index 60d7818b..16ebab5b 100644
--- a/tests/virtconv-files/libvirt_output/ovf2libvirt_test1.libvirt.disk_qcow2
+++ b/tests/virtconv-files/libvirt_output/ovf2libvirt_test1.libvirt.disk_qcow2
@@ -13,6 +13,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/virtconv-files/libvirt_output/ovf2libvirt_test2.libvirt b/tests/virtconv-files/libvirt_output/ovf2libvirt_test2.libvirt
index b8bd1ab9..72909948 100644
--- a/tests/virtconv-files/libvirt_output/ovf2libvirt_test2.libvirt
+++ b/tests/virtconv-files/libvirt_output/ovf2libvirt_test2.libvirt
@@ -13,6 +13,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/virtconv-files/libvirt_output/ovf2libvirt_test_gzip.libvirt b/tests/virtconv-files/libvirt_output/ovf2libvirt_test_gzip.libvirt
index 76a5b514..5b9f8f2c 100644
--- a/tests/virtconv-files/libvirt_output/ovf2libvirt_test_gzip.libvirt
+++ b/tests/virtconv-files/libvirt_output/ovf2libvirt_test_gzip.libvirt
@@ -12,6 +12,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/virtconv-files/libvirt_output/ovf2libvirt_test_gzip.libvirt.disk_raw b/tests/virtconv-files/libvirt_output/ovf2libvirt_test_gzip.libvirt.disk_raw
index 3fbece09..8b74a867 100644
--- a/tests/virtconv-files/libvirt_output/ovf2libvirt_test_gzip.libvirt.disk_raw
+++ b/tests/virtconv-files/libvirt_output/ovf2libvirt_test_gzip.libvirt.disk_raw
@@ -12,6 +12,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/virtconv-files/libvirt_output/vmx2libvirt_test-nodisks.libvirt b/tests/virtconv-files/libvirt_output/vmx2libvirt_test-nodisks.libvirt
index f00794ce..d63d8d5b 100644
--- a/tests/virtconv-files/libvirt_output/vmx2libvirt_test-nodisks.libvirt
+++ b/tests/virtconv-files/libvirt_output/vmx2libvirt_test-nodisks.libvirt
@@ -12,6 +12,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/virtconv-files/libvirt_output/vmx2libvirt_test-vmx-zip.libvirt b/tests/virtconv-files/libvirt_output/vmx2libvirt_test-vmx-zip.libvirt
index 60055b7d..48dc68bb 100644
--- a/tests/virtconv-files/libvirt_output/vmx2libvirt_test-vmx-zip.libvirt
+++ b/tests/virtconv-files/libvirt_output/vmx2libvirt_test-vmx-zip.libvirt
@@ -12,6 +12,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/virtconv-files/libvirt_output/vmx2libvirt_test1.libvirt b/tests/virtconv-files/libvirt_output/vmx2libvirt_test1.libvirt
index 065df6da..6c3b1479 100644
--- a/tests/virtconv-files/libvirt_output/vmx2libvirt_test1.libvirt
+++ b/tests/virtconv-files/libvirt_output/vmx2libvirt_test1.libvirt
@@ -12,6 +12,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/virtconv-files/libvirt_output/vmx2libvirt_test1.libvirt.disk_raw b/tests/virtconv-files/libvirt_output/vmx2libvirt_test1.libvirt.disk_raw
index 910de78d..8b1bbe3a 100644
--- a/tests/virtconv-files/libvirt_output/vmx2libvirt_test1.libvirt.disk_raw
+++ b/tests/virtconv-files/libvirt_output/vmx2libvirt_test1.libvirt.disk_raw
@@ -12,6 +12,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/virtconv-files/libvirt_output/vmx2libvirt_vmx-dir.libvirt b/tests/virtconv-files/libvirt_output/vmx2libvirt_vmx-dir.libvirt
index e72a7184..cf298478 100644
--- a/tests/virtconv-files/libvirt_output/vmx2libvirt_vmx-dir.libvirt
+++ b/tests/virtconv-files/libvirt_output/vmx2libvirt_vmx-dir.libvirt
@@ -12,6 +12,7 @@
     <acpi/>
     <apic/>
     <vmport state="off"/>
+    <vmcoreinfo/>
   </features>
   <cpu mode="custom" match="exact">
     <model>Opteron_G4</model>
diff --git a/tests/xmlparse-xml/change-guest-out.xml b/tests/xmlparse-xml/change-guest-out.xml
index 6c1b29ee..016eb5ad 100644
--- a/tests/xmlparse-xml/change-guest-out.xml
+++ b/tests/xmlparse-xml/change-guest-out.xml
@@ -22,6 +22,7 @@
     </hyperv>
     <vmport state="on"/>
     <viridian/>
+    <vmcoreinfo/>
     <kvm>
       <hidden state="on"/>
     </kvm>
diff --git a/tests/xmlparse.py b/tests/xmlparse.py
index ef12eb51..bd17bc8e 100644
--- a/tests/xmlparse.py
+++ b/tests/xmlparse.py
@@ -163,6 +163,7 @@ class XMLParseTest(unittest.TestCase):
         check("hyperv_spinlocks", True, True)
         check("hyperv_spinlocks_retries", 12287, 54321)
         check("vmport", False, True)
+        check("vmcoreinfo", False, True)
         check("kvm_hidden", None, True)
         check("pvspinlock", None, True)
         check("gic_version", None, False)
diff --git a/virtinst/cli.py b/virtinst/cli.py
index 2bcd8855..16ad81a9 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -1795,6 +1795,7 @@ ParserFeatures.add_arg("pvspinlock", "pvspinlock", is_onoff=True)
 ParserFeatures.add_arg("gic_version", "gic_version")
 
 ParserFeatures.add_arg("smm", "smm", is_onoff=True, cb=ParserFeatures.set_smm_cb)
+ParserFeatures.add_arg("vmcoreinfo", "vmcoreinfo", is_onoff=True)
 
 
 ###################
diff --git a/virtinst/domainfeatures.py b/virtinst/domainfeatures.py
index e4f3165b..df7fe6cf 100644
--- a/virtinst/domainfeatures.py
+++ b/virtinst/domainfeatures.py
@@ -56,3 +56,5 @@ class DomainFeatures(XMLBuilder):
     pvspinlock = XMLProperty("./pvspinlock/@state", is_onoff=True)
 
     smm = XMLProperty("./smm/@state", is_onoff=True)
+    vmcoreinfo = XMLProperty("./vmcoreinfo", is_bool=True,
+                       default_name="default", default_cb=lambda s: False)
diff --git a/virtinst/guest.py b/virtinst/guest.py
index 04bbcf38..35528f06 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -959,6 +959,11 @@ class Guest(XMLBuilder):
             self.conn.check_support(self.conn.SUPPORT_CONN_VMPORT)):
             self.features.vmport = False
 
+        if (self.features.vmcoreinfo == "default" and
+            (self.os.is_x86() or self.os.is_arm_machvirt()) and
+            self.conn.check_support(self.conn.SUPPORT_CONN_VMCOREINFO)):
+            self.features.vmcoreinfo = True
+
         if (self._os_object.is_windows() and
             self._hyperv_supported() and
             self.conn.check_support(self.conn.SUPPORT_CONN_HYPERV_VAPIC)):
diff --git a/virtinst/support.py b/virtinst/support.py
index fdc1dcb8..5e48cdf0 100644
--- a/virtinst/support.py
+++ b/virtinst/support.py
@@ -326,6 +326,8 @@ SUPPORT_CONN_USB3_PORTS = _make(version="1.3.5")
 SUPPORT_CONN_MACHVIRT_PCI_DEFAULT = _make(version="3.0.0")
 SUPPORT_CONN_QEMU_XHCI = _make(version="3.3.0")
 SUPPORT_CONN_VNC_NONE_AUTH = _make(hv_version={"qemu": "2.9.0"})
+SUPPORT_CONN_VMCOREINFO = _make(
+    version="3.10.0", hv_version={"qemu": "2.11.0"})
 
 
 # This is for disk <driver name=qemu>. xen supports this, but it's
-- 
2.16.1.73.g5832b7e9f2




More information about the virt-tools-list mailing list