qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] monitor: vnc: Fix compilation error if CONFIG_VNC is disable
@ 2019-07-02 19:01 Julio Montes
  2019-07-03  1:40 ` no-reply
  2019-07-03  8:21 ` Stefano Garzarella
  0 siblings, 2 replies; 4+ messages in thread
From: Julio Montes @ 2019-07-02 19:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: Julio Montes, dgilbert

How to reproduce it?
===

```
$ ./configure --disable-spice --disable-vte --disable-vnc \
    --disable-vnc-jpeg --disable-vnc-png --disable-vnc-sasl
$ make
...
monitor/hmp-cmds.c: In function ‘hmp_change’:
monitor/hmp-cmds.c:1985:17: error: unused variable ‘hmp_mon’
     [-Werror=unused-variable]
     MonitorHMP *hmp_mon = container_of(mon, MonitorHMP, common);
```

Fix
===

Move `hmp_mon` variable within the `CONFIG_VNC` block

Signed-off-by: Julio Montes <julio.montes@intel.com>
---
 monitor/hmp-cmds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
index 9de35387c3..5ed564683e 100644
--- a/monitor/hmp-cmds.c
+++ b/monitor/hmp-cmds.c
@@ -1982,7 +1982,6 @@ static void hmp_change_read_arg(void *opaque, const char *password,
 
 void hmp_change(Monitor *mon, const QDict *qdict)
 {
-    MonitorHMP *hmp_mon = container_of(mon, MonitorHMP, common);
     const char *device = qdict_get_str(qdict, "device");
     const char *target = qdict_get_str(qdict, "target");
     const char *arg = qdict_get_try_str(qdict, "arg");
@@ -1991,6 +1990,7 @@ void hmp_change(Monitor *mon, const QDict *qdict)
     Error *err = NULL;
 
 #ifdef CONFIG_VNC
+    MonitorHMP *hmp_mon = container_of(mon, MonitorHMP, common);
     if (strcmp(device, "vnc") == 0) {
         if (read_only) {
             monitor_printf(mon,
-- 
2.17.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-07-03 13:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-02 19:01 [Qemu-devel] [PATCH] monitor: vnc: Fix compilation error if CONFIG_VNC is disable Julio Montes
2019-07-03  1:40 ` no-reply
2019-07-03  8:21 ` Stefano Garzarella
2019-07-03 13:23   ` Montes, Julio

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).