On 08/05/2011 10:11 AM, Daniel P. Berrange wrote:
On Fri, Aug 05, 2011 at 05:24:13PM +0530, Srivatsa S. Bhat wrote:
> This patch exports KVM Host Power Management capabilities as XML so that
> higher-level systems management software can make use of these features
> available in the host.
>
Exposing info in the capabilities is great, if applications can actually
do something with this info. There are no APIs in libvirt for controlling
the host OS power management state, so I don't see what use this XML
addition is on its own. ie, if an application using libvirt has to resort
to spawning '/usr/sbin/pm-suspend' to actually do anything, then there's
no real benefit to having this info in libvirt, so they have to go outside
of libvirt anyway.
So while the XML design/proposal may well be fine, until we actually have
some host power management control APIs in libvirt, I'm inclined to NACK
this addition to capabilities.
Does that mean that we need to add a new API:
int virNodeSuspend(virConnectPtr conn, unsigned int flags)
that returns 0 if the host will be suspended after a short delay (note
that this must return before the suspend actually takes place, because
after the suspend, the connection cannot return data until it resumes),
and -1 where unsupported? Also, do we need to probe if the connection
has a wake-on-lan capability or some other way to kick it back out of S3
or S4 when it is time to start using the node again?
I tend to agree with Dan's assessment that until there is something in
libvirt that can make use of this information, then exposing it through
libvirt is pointless. That is, if the only way to make use of the
information is to call other programs, and since the information was
obtained by another program, you haven't cut any other programs out of
the loop by exposing the capability through libvirt. But if libvirt
itself can be remotely told to suspend a host, then you've removed the
need for external programs, and libvirt would indeed need to expose
whether it supports the new feature of suspending a host.
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org