[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/9] qmp hmp: Factor out common "using spice" te
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH 1/9] qmp hmp: Factor out common "using spice" test |
Date: |
Wed, 14 Jan 2015 14:53:01 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Eric Blake <address@hidden> writes:
> On 01/13/2015 10:50 AM, Markus Armbruster wrote:
>> 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 <address@hidden>
>> ---
>> include/ui/qemu-spice.h | 10 ++++++++++
>> monitor.c | 5 +++--
>> qmp.c | 11 +++--------
>> 3 files changed, 16 insertions(+), 10 deletions(-)
>>
>> diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h
>> index a93b4b2..b3f2679 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 int qemu_using_spice(Error **errp)
>
> Why not s/int/bool/
>
>> +{
>> + if (!using_spice) {
>> + /* correct one? spice isn't a device ,,, */
>> + error_set(errp, QERR_DEVICE_NOT_ACTIVE, "spice");
>> + return 0;
>> + }
>> + return 1;
>
> and use true/false here? All callers use it only in a boolean context.
I wrapped around using_spice, which is int, and didn't think of
switching to bool. Old habits die hard...
Luiz, would you be willing to fix this up on commit?
> Either way,
> Reviewed-by: Eric Blake <address@hidden>
Thanks!
- [Qemu-devel] [PATCH 0/9] qmp hmp balloon: Cleanups around error reporting, Markus Armbruster, 2015/01/13
- [Qemu-devel] [PATCH 1/9] qmp hmp: Factor out common "using spice" test, Markus Armbruster, 2015/01/13
- [Qemu-devel] [PATCH 4/9] qmp: Clean up qmp_query_spice() #ifndef !CONFIG_SPICE dummy, Markus Armbruster, 2015/01/13
- [Qemu-devel] [PATCH 3/9] hmp: Compile hmp_info_spice() only with CONFIG_SPICE, Markus Armbruster, 2015/01/13
- [Qemu-devel] [PATCH 6/9] qmp: Eliminate silly QERR_COMMAND_NOT_FOUND macro, Markus Armbruster, 2015/01/13
- [Qemu-devel] [PATCH 2/9] qmp hmp: Improve error messages when SPICE is not in use, Markus Armbruster, 2015/01/13
- [Qemu-devel] [PATCH 7/9] balloon: Inline qemu_balloon(), qemu_balloon_status(), Markus Armbruster, 2015/01/13
- [Qemu-devel] [PATCH 8/9] balloon: Factor out common "is balloon active" test, Markus Armbruster, 2015/01/13