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

Re: [libvirt] PATCH: Support VNC password for QEMU guests



"Daniel P. Berrange" <berrange redhat com> wrote:
> This patch adds support for using the monitor interface to set the VNC
> password
>
>   (qemu) change vnc password
>   Password: ********
>
> A minor tricky thing is that we can't just send the command and password
> all in one go, we must wait for the 'Password' prompt before sending the
> password.
>
> When doing this I noticed that virsh dumpxml has no way to request a
> secure XML dump (required to see the password element), nor did the
> virsh edit command set the SECURE or INACTIVE flags when changing
> the XML.
...
> diff --git a/src/qemu_conf.c b/src/qemu_conf.c
> --- a/src/qemu_conf.c
> +++ b/src/qemu_conf.c
> @@ -1138,37 +1138,42 @@ int qemudBuildCommandLine(virConnectPtr
>
>      if (vm->def->graphics &&
>          vm->def->graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
> -        char vncdisplay[PATH_MAX];
> -        int ret;
> +        virBuffer opt = VIR_BUFFER_INITIALIZER;
> +        char *optstr;
...
> +        optstr = virBufferContentAndReset(&opt);
>
>          ADD_ARG_LIT("-vnc");
> -        ADD_ARG_LIT(vncdisplay);
> +        ADD_ARG(optstr);

Looks fine.
Just be sure to add this:

           VIR_FREE(optstr);

Also, there are a few new lines longer than 80.

BTW, can you outline what you do to test this?
and I'll see about adding something to exercise the new code.


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