[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] S4 event, states and caveats



Hi everybody,

I'm going to add support for S4 event for libvirt and I'm thinking for a
while now how to do that, so I'd like to discuss this here on the list
before doing something wrong and mainly to eliminate bothering you guys
with reviews of PATCH v5 etc.

QEMU emits SUSPEND_DISK event before SHUTDOWN and then shuts down as
usual when the guest is powering off.  At first I wanted to add it the
same way the support for SUSPEND was added, but when I come to think of
it, this needs a little bit more.

My main questions are:
 - What state should the machine have after it stops?
    a) pmsuspended (optionally with new reason)
    b) shutoff (ditto)
    c) new state (pmsuspended-disk for example)
 - How should we behave when dompmwakeup is called for such domain?
 - How should we behave when destroy is called for such domain?
 - How do we store the domain state persistently between restarts?
 - Should there be new lifecycle event to distinguish suspend to disk
   from poweroff?

Plus you might have some additional things what to care about.  In that
case please let me know so it's been dealt with at the start.

I'm inclining to new state for the domain (just because suspend to disk
doesn't seem like a new "reason" to me) which can be woken up by the
pmwakeup call (that would be basically the same as starting it).

It's hard for me to say if destroy should reset the state.  Even when it
is prohibited, the machine can be recreated with the same disk and thus
achieving the same result with a workaround.

We can probably allow removing and changing devices connected as well as
other settings of the domain.  It is then problem of QEMU, it's BIOS and
mainly the guest OS to deal with it, so basically it can be blamed on
the user who did that :)  If we don't allow that, the same rule with the
workaround applies here anyway.

I know Michal was thinking about how to store the data for the domain
state because of transient devices etc.  His idea was to save the files
somewhere else than /var/run. I'd do that, but just for those suspended
to disk.

I'd add a lifecycle event with lifecycle control in the domain XML (now
supported for poweroff, reboot and crash).

Thanks for any remarks, additions, hints and replies.

Have a nice day,
Martin


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]