Re: [Qemu-devel] [PATCH] Fix build error when VNC is configured out
Hi Christophe, On 6/25/19 11:24 AM, Christophe de Dinechin wrote: > In hmp_change(), the variable hmp_mon is only used > by code under #ifdef CONFIG_VNC. This results in a build > error when VNC is configured out with the default of > treating warnings as errors: > > monitor/hmp-cmds.c: In function ‘hmp_change’: > monitor/hmp-cmds.c:1946:17: error: unused variable ‘hmp_mon’ > [-Werror=unused-variable] > 1946 | MonitorHMP *hmp_mon = container_of(mon, MonitorHMP, common); > | ^~~ > > Signed-off-by: Christophe de Dinechin > --- > 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 c283dde0e9..038614da8e 100644 > --- a/monitor/hmp-cmds.c > +++ b/monitor/hmp-cmds.c > @@ -1943,7 +1943,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"); > @@ -1952,6 +1951,7 @@ void hmp_change(Monitor *mon, const QDict *qdict) > Error *err = NULL; > > #ifdef CONFIG_VNC > +MonitorHMP *hmp_mon = container_of(mon, MonitorHMP, common); Can you move it after 'if (!arg) {', the sole place where it is used? Regardless: Reviewed-by: Philippe Mathieu-Daudé > if (strcmp(device, "vnc") == 0) { > if (read_only) { > monitor_printf(mon, >
Re: [Qemu-devel] [PATCH] Fix build error when VNC is configured out
Cc: David Gilbert Christophe de Dinechin writes: > In hmp_change(), the variable hmp_mon is only used > by code under #ifdef CONFIG_VNC. This results in a build > error when VNC is configured out with the default of > treating warnings as errors: > > monitor/hmp-cmds.c: In function ‘hmp_change’: > monitor/hmp-cmds.c:1946:17: error: unused variable ‘hmp_mon’ > [-Werror=unused-variable] > 1946 | MonitorHMP *hmp_mon = container_of(mon, MonitorHMP, common); > | ^~~ > > Signed-off-by: Christophe de Dinechin > --- > 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 c283dde0e9..038614da8e 100644 > --- a/monitor/hmp-cmds.c > +++ b/monitor/hmp-cmds.c > @@ -1943,7 +1943,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"); > @@ -1952,6 +1951,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,
[Qemu-devel] [PATCH] Fix build error when VNC is configured out
In hmp_change(), the variable hmp_mon is only used by code under #ifdef CONFIG_VNC. This results in a build error when VNC is configured out with the default of treating warnings as errors: monitor/hmp-cmds.c: In function ‘hmp_change’: monitor/hmp-cmds.c:1946:17: error: unused variable ‘hmp_mon’ [-Werror=unused-variable] 1946 | MonitorHMP *hmp_mon = container_of(mon, MonitorHMP, common); | ^~~ Signed-off-by: Christophe de Dinechin --- 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 c283dde0e9..038614da8e 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -1943,7 +1943,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"); @@ -1952,6 +1951,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.20.1
[Qemu-devel] [PATCH] Fix build error in virtfs-proxy-helper
I don't have a kernel with the necessary syscalls so this is completely untested. Cc: M. Mohan Kumar mo...@in.ibm.com Cc: Gerhard Wiesinger li...@wiesinger.com Reported-by: Gerhard Wiesinger li...@wiesinger.com Signed-off-by: Anthony Liguori aligu...@us.ibm.com --- fsdev/virtfs-proxy-helper.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c index f9a8270..bc50e3e3 100644 --- a/fsdev/virtfs-proxy-helper.c +++ b/fsdev/virtfs-proxy-helper.c @@ -286,12 +286,16 @@ static int setfsugid(int uid, int gid) * We still need DAC_OVERRIDE because we don't change * supplementary group ids, and hence may be subjected DAC rules */ +int ret; cap_value_t cap_list[] = { CAP_DAC_OVERRIDE, }; -setfsgid(gid); -setfsuid(uid); +ret = setfsgid(gid); +g_assert(ret != -1); + +ret = setfsuid(uid); +g_assert(ret != -1); if (uid != 0 || gid != 0) { return do_cap_set(cap_list, ARRAY_SIZE(cap_list), 0); -- 1.8.0
Re: [Qemu-devel] [PATCH] Fix build error in virtfs-proxy-helper
On 11/01/2012 03:06 PM, Anthony Liguori wrote: I don't have a kernel with the necessary syscalls so this is completely untested. Cc: M. Mohan Kumar mo...@in.ibm.com Cc: Gerhard Wiesinger li...@wiesinger.com Reported-by: Gerhard Wiesinger li...@wiesinger.com Signed-off-by: Anthony Liguori aligu...@us.ibm.com --- fsdev/virtfs-proxy-helper.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c index f9a8270..bc50e3e3 100644 --- a/fsdev/virtfs-proxy-helper.c +++ b/fsdev/virtfs-proxy-helper.c @@ -286,12 +286,16 @@ static int setfsugid(int uid, int gid) * We still need DAC_OVERRIDE because we don't change * supplementary group ids, and hence may be subjected DAC rules */ +int ret; cap_value_t cap_list[] = { CAP_DAC_OVERRIDE, }; -setfsgid(gid); -setfsuid(uid); +ret = setfsgid(gid); +g_assert(ret != -1); This has been reported several times now, with several different patches proposed. Can we get consensus on which one to use? https://lists.gnu.org/archive/html/qemu-devel/2012-10/msg02013.html -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature
Re: [Qemu-devel] [PATCH] Fix build error in usb-ccid code
On 4 April 2011 13:31, Dmitry Eremin-Solenikov dbarysh...@gmail.com wrote: W/o this fix I'm getting the following error: cc1: warnings being treated as errors hw/usb-ccid.c: In function ‘ccid_card_card_error’: hw/usb-ccid.c:1202:5: error: format ‘%lX’ expects type ‘long unsigned int’, but argument 2 has type ‘uint64_t’ David Gibson posted a patch for that earlier this morning: http://patchwork.ozlabs.org/patch/89577/ -- PMM
Re: [Qemu-devel] [PATCH] Fix build error in usb-ccid code
On 4/4/11, Peter Maydell peter.mayd...@linaro.org wrote: On 4 April 2011 13:31, Dmitry Eremin-Solenikov dbarysh...@gmail.com wrote: W/o this fix I'm getting the following error: cc1: warnings being treated as errors hw/usb-ccid.c: In function ‘ccid_card_card_error’: hw/usb-ccid.c:1202:5: error: format ‘%lX’ expects type ‘long unsigned int’, but argument 2 has type ‘uint64_t’ David Gibson posted a patch for that earlier this morning: http://patchwork.ozlabs.org/patch/89577/ Sorry for the noise then. -- With best wishes Dmitry
[Qemu-devel] [PATCH] fix build error
This appears to be a remnant of when kqemu was non-free. It broke build for me (not sure under which conditions it can be reproduced, but the fix is obvious, see the patch). -- Robert Millan My spam trap is [EMAIL PROTECTED] Note: this address is only intended for spam harvesters. Writing to it will get you added to my black list. diff -ur kqemu-1.3.0~pre11.old/Makefile kqemu-1.3.0~pre11/Makefile --- kqemu-1.3.0~pre11.old/Makefile 2007-07-17 19:37:57.0 +0200 +++ kqemu-1.3.0~pre11/Makefile 2007-07-17 19:36:52.0 +0200 @@ -90,9 +90,9 @@ # called from 2.6 kernel kbuild obj-m:= kqemu.o -kqemu-objs:= kqemu-linux.o kqemu-mod.o +kqemu-objs:= kqemu-linux.o kqemu-mod-$(ARCH).o -$(obj)/kqemu-mod.o: $(src)/kqemu-mod-$(ARCH).o - cp $ $@ +$(obj)/kqemu-mod-$(ARCH).o: + $(MAKE) -C $(obj)/common endif endif # PATCHLEVEL