* [Qemu-devel] [PATCH] monitor: Don't change VNC server when disabled
@ 2009-02-10 19:13 Jan Kiszka
2009-02-11 21:01 ` [Qemu-devel] " Anthony Liguori
0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2009-02-10 19:13 UTC (permalink / raw)
To: Anthony Liguori; +Cc: qemu-devel
[ As requested, broken out of the monitor rework series. ]
Avoid a segfault when the user issues 'change vnc' without having vnc
enabled on startup.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
vnc.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/vnc.c b/vnc.c
index 68df599..bdfc79b 100644
--- a/vnc.c
+++ b/vnc.c
@@ -2333,6 +2333,8 @@ void vnc_display_close(DisplayState *ds)
{
VncState *vs = ds ? (VncState *)ds->opaque : vnc_state;
+ if (!vs)
+ return;
if (vs->display) {
qemu_free(vs->display);
vs->display = NULL;
@@ -2392,6 +2394,8 @@ int vnc_display_open(DisplayState *ds, const char *display)
int tls = 0, x509 = 0;
#endif
+ if (!vnc_state)
+ return -1;
vnc_display_close(ds);
if (strcmp(display, "none") == 0)
return 0;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Qemu-devel] Re: [PATCH] monitor: Don't change VNC server when disabled
2009-02-10 19:13 [Qemu-devel] [PATCH] monitor: Don't change VNC server when disabled Jan Kiszka
@ 2009-02-11 21:01 ` Anthony Liguori
0 siblings, 0 replies; 2+ messages in thread
From: Anthony Liguori @ 2009-02-11 21:01 UTC (permalink / raw)
To: Jan Kiszka; +Cc: qemu-devel
Jan Kiszka wrote:
> [ As requested, broken out of the monitor rework series. ]
>
> Avoid a segfault when the user issues 'change vnc' without having vnc
> enabled on startup.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>
Applied. Thanks.
Regards,
Anthony Liguori
> ---
>
> vnc.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/vnc.c b/vnc.c
> index 68df599..bdfc79b 100644
> --- a/vnc.c
> +++ b/vnc.c
> @@ -2333,6 +2333,8 @@ void vnc_display_close(DisplayState *ds)
> {
> VncState *vs = ds ? (VncState *)ds->opaque : vnc_state;
>
> + if (!vs)
> + return;
> if (vs->display) {
> qemu_free(vs->display);
> vs->display = NULL;
> @@ -2392,6 +2394,8 @@ int vnc_display_open(DisplayState *ds, const char *display)
> int tls = 0, x509 = 0;
> #endif
>
> + if (!vnc_state)
> + return -1;
> vnc_display_close(ds);
> if (strcmp(display, "none") == 0)
> return 0;
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-02-11 21:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-10 19:13 [Qemu-devel] [PATCH] monitor: Don't change VNC server when disabled Jan Kiszka
2009-02-11 21:01 ` [Qemu-devel] " Anthony Liguori
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).