guest.
<span class="since">Since 1.2.1, QEMU and KVM only</span>
</p>
+ <p>
+ For pSeries guests, this feature is always enabled since it's
+ implemented by the guest firmware, thus libvirt automatically
+ adds the <code>panic</code> element to the domain XML.
+ </p>
<p>
Example: usage of panic configuration
</p>
bool addDefaultMemballoon = true;
bool addDefaultUSBKBD = false;
bool addDefaultUSBMouse = false;
+ bool addPanicDevice = false;
if (def->os.bootloader || def->os.bootloaderArgs) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
addPCIRoot = true;
addDefaultUSBKBD = true;
addDefaultUSBMouse = true;
+ /* For pSeries guests, the firmware provides the same
+ * functionality as the pvpanic device, so automatically
+ * add the definition if not already present */
+ if (STRPREFIX(def->os.machine, "pseries"))
+ addPanicDevice = true;
break;
case VIR_ARCH_ALPHA:
VIR_DOMAIN_INPUT_BUS_USB) < 0)
return -1;
+ if (addPanicDevice && !def->panic) {
+ virDomainPanicDefPtr panic;
+ if (VIR_ALLOC(panic) < 0)
+ return -1;
+
+ def->panic = panic;
+ }
+
return 0;
}
<model type='cirrus' vram='16384' heads='1'/>
</video>
<memballoon model='none'/>
+ <panic/>
</devices>
</domain>
<nvram>
<address type='spapr-vio' reg='0x4000'/>
</nvram>
+ <panic/>
</devices>
</domain>
--- /dev/null
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-ppc64 -S -M pseries -m 512 -smp 1 -nographic \
+-nodefconfig -nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=readline -no-acpi -boot c -usb \
+-chardev pty,id=charserial0 \
+-device spapr-vty,chardev=charserial0,reg=0x30000000
--- /dev/null
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+ <memory unit='KiB'>524288</memory>
+ <currentMemory unit='KiB'>524288</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='ppc64' machine='pseries'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-ppc64</emulator>
+ <controller type='usb' index='0'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <serial type='pty'>
+ <target port='0'/>
+ <address type='spapr-vio'/>
+ </serial>
+ <console type='pty'>
+ <target type='serial' port='0'/>
+ <address type='spapr-vio'/>
+ </console>
+ <memballoon model='none'/>
+ </devices>
+</domain>
QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("pseries-cpu-le", QEMU_CAPS_KVM, QEMU_CAPS_CPU_HOST,
QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
+ DO_TEST("pseries-panic-missing",
+ QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("pseries-panic-no-address",
QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST_FAILURE("pseries-panic-address",
--- /dev/null
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+ <memory unit='KiB'>524288</memory>
+ <currentMemory unit='KiB'>524288</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='ppc64' machine='pseries'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-ppc64</emulator>
+ <controller type='usb' index='0'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <serial type='pty'>
+ <target port='0'/>
+ <address type='spapr-vio'/>
+ </serial>
+ <console type='pty'>
+ <target type='serial' port='0'/>
+ <address type='spapr-vio'/>
+ </console>
+ <memballoon model='none'/>
+ <panic/>
+ </devices>
+</domain>
DO_TEST("virtio-rng-egd");
DO_TEST("pseries-nvram");
+ DO_TEST_DIFFERENT("pseries-panic-missing");
DO_TEST("pseries-panic-no-address");
/* These tests generate different XML */