qemu no-shutdown feature in libvirt

Martin Kletzander mkletzan at redhat.com
Thu Dec 3 11:49:05 UTC 2020


On Tue, Dec 01, 2020 at 03:34:05PM +0100, Peter Krempa wrote:
>On Mon, Nov 30, 2020 at 14:45:18 -0500, Luna Xu wrote:
>> Hi developers,
>
>Hi,
>
>[...]
>
>> When I start a VM with the qemu command I can specify the -no-shutdown
>> flag so that my qemu process doesn't quit even if I shutdown the VM
>> from the inside (issue shutdown or halt command inside VM). The VM is
>> shutdown but the qemu process is not killed so that the jobs I
>> submitted before for example backup (drive-backup) can continue to run
>> even after VM gets shutdown by the user, and I'm able to check the
>> status of the job through qmp commands (by communicating with the qemu
>> process).
>
>As I've noted in my reply on libvirt-users, we currently don't support
>this on the shutdown part of the VM lifecycle.
>
>On the startup part you can use VIR_DOMAIN_START_PAUSED for a VM which
>didn't yet excecute any guest instructions.
>
>> Is anyone aware of any project that is currently implementing this
>> functionality? Thanks for reading.
>
>I don't think that there's anybody working on it.
>
>If you are interested in implementing the feature the idea would be to
>add a 'pause' action for <on_poweroff>pause</on_poweroff> along with a
>new 'virDomainPausedReason' such as VIR_DOMAIN_PAUSED_POWEROFF and
>implement the lifecycle transition from PAUSED -> RUNNING via
>qemuDomainResume, which would in this case have to issue a
>'system-reset' qmp command and emit the appropriate events.
>

Couldn't this mechanism be used to add support for non-transient jobs on
non-transient domains?  The way I read the email that's exactly what the request
is about.  And that way libvirt APIs could be used for the block jobs without
needing to mess with the domain definition.  Maybe we don't even need to expose
<on_poweroff/>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20201203/e9b502c8/attachment-0001.sig>


More information about the libvir-list mailing list