[libvirt] [PATCHv2] Error out when using SPICE TLS with spice_tls=0
Christophe Fergeau
cfergeau at redhat.com
Wed Feb 29 12:32:04 UTC 2012
On Tue, Feb 28, 2012 at 05:04:57PM +0100, Michal Privoznik wrote:
> On 24.02.2012 11:34, Christophe Fergeau wrote:
> > src/qemu/qemu_command.c | 12 +++++++++++-
> > 1 files changed, 11 insertions(+), 1 deletions(-)
> >
> > diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> > index 5a34504..4f3e61e 100644
> > --- a/src/qemu/qemu_command.c
> > +++ b/src/qemu/qemu_command.c
> > @@ -5231,7 +5231,12 @@ qemuBuildCommandLine(virConnectPtr conn,
> >
> > virBufferAsprintf(&opt, "port=%u", def->graphics[0]->data.spice.port);
> >
> > - if (driver->spiceTLS && def->graphics[0]->data.spice.tlsPort != -1)
> > + if (def->graphics[0]->data.spice.tlsPort != -1)
> > + if (!driver->spiceTLS) {
> > + qemuReportError(VIR_ERR_XML_ERROR,
> > + _("spice TLS port set in XML configuration, but TLS is disabled in qemu.conf"));
> > + goto error;
> > + }
> > virBufferAsprintf(&opt, ",tls-port=%u", def->graphics[0]->data.spice.tlsPort);
>
> In fact, this needs to be wrapped with curly braces as the check for
> tlsPort != -1 is meant to protect virBufferAsprintf() in the first
> place. Sorry for not catching this earlier.
Ugh, sorry about that silly bug, thanks for catching it.
Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120229/21f8c65c/attachment-0001.sig>
More information about the libvir-list
mailing list