Received: from eggs.gnu.org ([2001:4830:134:3::10]:39949) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBONg-0002ul-OF for qemu-devel@nongnu.org; Wed, 14 Jan 2015 08:53:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YBONd-0006ch-Ic for qemu-devel@nongnu.org; Wed, 14 Jan 2015 08:53:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55094) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBONd-0006bv-AI for qemu-devel@nongnu.org; Wed, 14 Jan 2015 08:53:05 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0EDr3LG000914 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 14 Jan 2015 08:53:04 -0500 From: Markus Armbruster References: <1421171432-8733-1-git-send-email-armbru@redhat.com> <1421171432-8733-2-git-send-email-armbru@redhat.com> <54B66AE0.1060408@redhat.com> Date: Wed, 14 Jan 2015 14:53:01 +0100 In-Reply-To: <54B66AE0.1060408@redhat.com> (Eric Blake's message of "Wed, 14 Jan 2015 06:10:56 -0700") Message-ID: <87d26hfozm.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 1/9] qmp hmp: Factor out common "using spice" test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: lcapitulino@redhat.com, qemu-devel@nongnu.org, kraxel@redhat.com Eric Blake 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 >> --- >> 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 Thanks!