diff options
author | Markus Armbruster <armbru@redhat.com> | 2015-01-13 17:07:15 +0100 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2015-01-29 09:58:56 +0100 |
commit | b25d81ba332dc06757d40ffe64944ba27082de0a (patch) | |
tree | fe7ca152bebf917ff97ddcbb1b4e01d4e5d47f5f /include | |
parent | 83761b9244ad2ed39d3cfabe8a0e901ab906f7bf (diff) | |
download | hqemu-b25d81ba332dc06757d40ffe64944ba27082de0a.zip hqemu-b25d81ba332dc06757d40ffe64944ba27082de0a.tar.gz |
qmp hmp: Factor out common "using spice" test
Into qemu_using_spice(). For want of a better place, put it next the
existing monitor command handler dummies in qemu-spice.h.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/ui/qemu-spice.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h index a93b4b2..db7926d 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) { + /* correct one? spice isn't a device ,,, */ + error_set(errp, QERR_DEVICE_NOT_ACTIVE, "spice"); + return false; + } + return true; +} + #endif /* QEMU_SPICE_H */ |