[libvirt] [PATCH 3/3 v3] qemu: add ', share=<policy>' to qemu commandline
Ján Tomko
jtomko at redhat.com
Tue May 21 12:49:23 UTC 2013
On 05/16/2013 03:00 PM, Guannan Ren wrote:
> example: qemu ${otherargs} \
> -vnc 127.0.0.1:0,share=allow-exclusive
> ---
> src/qemu/qemu_command.c | 36 ++++++++++++++++++++++++++++++++++++
> tests/qemuargv2xmltest.c | 1 +
> tests/qemuxml2argvtest.c | 1 +
You forgot to add the .args and .xml files.
> 3 files changed, 38 insertions(+)
>
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index 5b95c07..a462153 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -6098,6 +6098,19 @@ qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfigPtr cfg,
> virBufferAsprintf(&opt, ",websocket=%d", graphics->data.vnc.websocket);
> }
>
> + if (graphics->data.vnc.sharePolicy) {
> + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VNC_SHARE_POLICY)) {
> + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> + _("vnc display sharing policy is not "
> + "supported with this QEMU"));
> + goto error;
> + }
> +
> + virBufferAsprintf(&opt, ",share=%s",
> + virDomainGraphicsVNCSharePolicyTypeToString(
> + graphics->data.vnc.sharePolicy));
> + }
> +
> if (graphics->data.vnc.auth.passwd || cfg->vncPassword)
> virBufferAddLit(&opt, ",password");
>
> @@ -10013,6 +10026,29 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr qemuCaps,
> vnc->data.vnc.websocket =
> vnc->data.vnc.port + 5700;
> }
> + } else if (STRPREFIX(opts, "share=")) {
> + char *sharePolicy = opts + strlen("share=");
> + if (sharePolicy && *sharePolicy) {
sharePolicy is definitely non-NULL here.
> + int policy =
> + virDomainGraphicsVNCSharePolicyTypeFromString(sharePolicy);
> +
> + if (policy < 0) {
> + virReportError(VIR_ERR_INTERNAL_ERROR,
> + _("unknown vnc display sharing policy '%s'"),
> + sharePolicy);
> + virDomainGraphicsDefFree(vnc);
> + VIR_FREE(orig_opts);
> + goto error;
> + } else {
> + vnc->data.vnc.sharePolicy = policy;
> + }
> + } else {
> + virReportError(VIR_ERR_INTERNAL_ERROR,
missing "%s" breaks syntax-check
> + _("missing vnc sharing policy"));
> + virDomainGraphicsDefFree(vnc);
> + VIR_FREE(orig_opts);
> + goto error;
> + }
> }
>
> opts = nextopt;
Jan
More information about the libvir-list
mailing list