summary refs log tree commit diff stats
path: root/include/ui/qemu-spice.h
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-02-05 11:11:56 +0000
committerPeter Maydell <peter.maydell@linaro.org>2015-02-05 11:11:56 +0000
commit2c918a245ca2a0b3339b8ded926b3f887d6d409e (patch)
tree99730f909f4446a5f5390731a78cf2e1e6536831 /include/ui/qemu-spice.h
parent32193cb421cecb98b48715e0740b2d948cda0779 (diff)
parent2ad28a088d2cc8fd404dfa58fa1b80f9225425ff (diff)
downloadfocaccia-qemu-2c918a245ca2a0b3339b8ded926b3f887d6d409e.tar.gz
focaccia-qemu-2c918a245ca2a0b3339b8ded926b3f887d6d409e.zip
Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2015-02-05' into staging
qmp hmp balloon: Cleanups around error reporting

# gpg: Signature made Thu 05 Feb 2015 07:15:11 GMT using RSA key ID EB918653
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"

* remotes/armbru/tags/pull-error-2015-02-05:
  balloon: Eliminate silly QERR_ macros
  balloon: Factor out common "is balloon active" test
  balloon: Inline qemu_balloon(), qemu_balloon_status()
  qmp: Eliminate silly QERR_COMMAND_NOT_FOUND macro
  qmp: Simplify recognition of capability negotiation command
  qmp: Clean up qmp_query_spice() #ifndef !CONFIG_SPICE dummy
  hmp: Compile hmp_info_spice() only with CONFIG_SPICE
  qmp hmp: Improve error messages when SPICE is not in use
  qmp hmp: Factor out common "using spice" test

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/ui/qemu-spice.h')
-rw-r--r--include/ui/qemu-spice.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h
index a93b4b2572..762e063125 100644
--- a/include/ui/qemu-spice.h
+++ b/include/ui/qemu-spice.h
@@ -88,4 +88,14 @@ static inline int qemu_spice_display_add_client(int csock, int skipauth,
 
 #endif /* CONFIG_SPICE */
 
+static inline bool qemu_using_spice(Error **errp)
+{
+    if (!using_spice) {
+        error_set(errp, ERROR_CLASS_DEVICE_NOT_ACTIVE,
+                  "SPICE is not in use");
+        return false;
+    }
+    return true;
+}
+
 #endif /* QEMU_SPICE_H */