]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: validate: Allow 'preserve' action for on_crash lifecycle action
authorPeter Krempa <pkrempa@redhat.com>
Wed, 15 Sep 2021 11:11:40 +0000 (13:11 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 15 Sep 2021 12:40:51 +0000 (14:40 +0200)
In fact keeping the VM around for debugging is a desirable configuration
and actually the implementation has no code as we keep the VM around.

Remove the validation and add a note that it's actually used.

Fixes: b1b85a475fb251b9068b75f629479f5c452f1b43
Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
src/qemu/qemu_driver.c
src/qemu/qemu_validate.c

index dfc27572c461d8c81eeeb658b9c42af414b453dd..6ae678b165a485d3610ba05e3beff43acfb6cc7f 100644 (file)
@@ -3647,6 +3647,7 @@ processGuestPanicEvent(virQEMUDriver *driver,
         break;
 
     case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE:
+        /* the VM is kept around for debugging */
         break;
 
     default:
index 9d93f373ab50f92bacec3c7df6f0f9987163fbf7..6b685881a83f6719a97acb0b74b2d51e8ff353e1 100644 (file)
@@ -1083,10 +1083,9 @@ qemuValidateLifecycleAction(virDomainLifecycleAction onPoweroff,
     /* The qemu driver doesn't yet implement any meaningful handling for
      * VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE */
     if (onPoweroff == VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE ||
-        onReboot == VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE ||
-        onCrash == VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE) {
+        onReboot == VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("qemu driver doesn't support the 'preserve' action for 'on_reboot'/'on_poweroff'/'on_crash'"));
+                       _("qemu driver doesn't support the 'preserve' action for 'on_reboot'/'on_poweroff'"));
         return -1;
     }