On 01/26/2012 07:06 AM, Michal Privoznik wrote:
define these flags:
VIR_DOMAIN_SUSPEND_SLEEP = 0, /* Suspend to RAM */
VIR_DOMAIN_SUSPEND_HIBERNATE = (1 << 0), /* Suspend to disk */
Not quite right. Our policy when fixing old APIs that forgot a flags
argument is that the new API with flags 0 must be identical to the old
API. Which means you need:
VIR_DOMAIN_SUSPEND_PAUSE = 0, /* pause CPUs */
VIR_DOMAIN_SUSPEND_SLEEP = 1<<0, /* Suspend to RAM, power stays on */
VIR_DOMAIN_SUSPEND_HIBERNATE = 1<<1, /* Suspend to disk, power off */
and you might as well make things convenient:
VIR_DOMAIN_SUSPEND_HYBRID = 3, /* Suspend to disk but leave power on */
Then, you should also provide a stub virDomainSuspendFlags for all other
hypervisors that only takes flags == 0, forwarding the old
virDomainSuspend to the new callback name.
--
Eric Blake eblake(a)redhat.com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org