[libvirt] [PATCH] graphics: add support for action_if_connected in qemu
Eric Blake
eblake at redhat.com
Tue May 31 21:09:42 UTC 2011
On 05/30/2011 09:45 AM, Michal Privoznik wrote:
> This option accepts 3 values:
> -keep, to keep current client connected (Spice+VNC)
> -disconnect, to disconnect client (Spice)
> -fail, to fail setting password if there is a client connected (Spice)
> ---
> docs/schemas/domain.rng | 16 ++++++++++++++++
> src/conf/domain_conf.c | 44 +++++++++++++++++++++++++++++++++++++++++---
> src/conf/domain_conf.h | 11 +++++++++++
> src/libvirt_private.syms | 2 ++
> src/qemu/qemu_hotplug.c | 11 ++++++++---
> 5 files changed, 78 insertions(+), 6 deletions(-)
In addition to Matthias' correct note that we need a patch to
docs/formatdomain.html.in,
> +virDomainGraphicsAuthDefParseXML(xmlNodePtr node,
> + virDomainGraphicsAuthDefPtr def,
> + int type)
> {
> char *validTo = NULL;
> + char *connected = virXMLPropString(node, "connected");
>
> def->passwd = virXMLPropString(node, "passwd");
>
> @@ -3846,6 +3856,28 @@ virDomainGraphicsAuthDefParseXML(xmlNodePtr node, virDomainGraphicsAuthDefPtr de
> def->expires = 1;
> }
>
> + if (connected) {
> + int action = virDomainGraphicsAuthConnectedTypeFromString(connected);
> + if (action < 0) {
> + virDomainReportError(VIR_ERR_CONFIG_UNSUPPORTED,
> + _("unknown connected value %s"),
Do we want to allow parsing "default"? If not, then change this to 'if
(action <= 0)'.
> @@ -1755,7 +1760,7 @@ qemuDomainChangeGraphicsPasswords(struct qemud_driver *driver,
> ret = qemuMonitorSetPassword(priv->mon,
> type,
> auth->passwd ? auth->passwd : defaultPasswd,
> - NULL);
> + auth->connected ? virDomainGraphicsAuthConnectedTypeToString(auth->connected) : NULL);
Style - this results in a long line. It might be nicer to do:
const char *connected = NULL;
if (auth->connected)
connected = virDomainGraphicsAuthConnectedTypeToString(auth->connected);
...
qemuMonitorSetPassword(priv->mon, type,
auth->passwd ? auth->passwd : defaultPasswd,
connected);
This is a new XML feature, but has missed the rc1 freeze, so v2 should
not be applied until after the 0.9.2 release, although you can post it
for review before then.
--
Eric Blake eblake at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110531/e6186142/attachment-0001.sig>
More information about the libvir-list
mailing list