Patchwork Make spice dummy functions inline to fix calls not checking return values

login
register
mail settings
Submitter Jes Sorensen
Date Feb. 1, 2011, 2:53 p.m.
Message ID <1296572003-13732-1-git-send-email-Jes.Sorensen@redhat.com>
Download mbox | patch
Permalink /patch/81327/
State New
Headers show

Comments

Jes Sorensen - Feb. 1, 2011, 2:53 p.m.
From: Jes Sorensen <Jes.Sorensen@redhat.com>

qemu_spice_set_passwd() and qemu_spice_set_pw_expire() dummy functions
needs to be inline, in order to handle the case where they are called
without checking the return value.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
 ui/qemu-spice.h |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
Gerd Hoffmann - Feb. 18, 2011, 4:03 p.m.
On 02/01/11 15:53, Jes.Sorensen@redhat.com wrote:
> From: Jes Sorensen<Jes.Sorensen@redhat.com>
>
> qemu_spice_set_passwd() and qemu_spice_set_pw_expire() dummy functions
> needs to be inline, in order to handle the case where they are called
> without checking the return value.

picked into spice patch queue.

thanks,
   Gerd

Patch

diff --git a/ui/qemu-spice.h b/ui/qemu-spice.h
index 48239c3..920d501 100644
--- a/ui/qemu-spice.h
+++ b/ui/qemu-spice.h
@@ -42,8 +42,16 @@  void do_info_spice(Monitor *mon, QObject **ret_data);
 #else  /* CONFIG_SPICE */
 
 #define using_spice 0
-#define qemu_spice_set_passwd(_p, _f1, _f2) (-1)
-#define qemu_spice_set_pw_expire(_e) (-1)
+static inline int qemu_spice_set_passwd(const char *passwd,
+                                        bool fail_if_connected,
+                                        bool disconnect_if_connected)
+{
+    return -1;
+}
+static inline int qemu_spice_set_pw_expire(time_t expires)
+{
+    return -1;
+}
 
 #endif /* CONFIG_SPICE */