From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBO14-0006mF-TV for qemu-devel@nongnu.org; Wed, 14 Jan 2015 08:29:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YBO11-0007Nf-Lg for qemu-devel@nongnu.org; Wed, 14 Jan 2015 08:29:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45058) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBO11-0007Nb-DO for qemu-devel@nongnu.org; Wed, 14 Jan 2015 08:29:43 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0EDTgIb007609 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 14 Jan 2015 08:29:43 -0500 Message-ID: <54B66F45.3020102@redhat.com> Date: Wed, 14 Jan 2015 06:29:41 -0700 From: Eric Blake MIME-Version: 1.0 References: <1421171432-8733-1-git-send-email-armbru@redhat.com> <1421171432-8733-9-git-send-email-armbru@redhat.com> In-Reply-To: <1421171432-8733-9-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pSrWGsBlAXWgvoicmSgNXBBofP6UIbkXP" Subject: Re: [Qemu-devel] [PATCH 8/9] balloon: Factor out common "is balloon active" test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: kraxel@redhat.com, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --pSrWGsBlAXWgvoicmSgNXBBofP6UIbkXP Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/13/2015 10:50 AM, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster > --- > balloon.c | 29 +++++++++++++++-------------- > 1 file changed, 15 insertions(+), 14 deletions(-) >=20 > diff --git a/balloon.c b/balloon.c > index 2884c2d..aa30617 100644 > --- a/balloon.c > +++ b/balloon.c > @@ -36,6 +36,19 @@ static QEMUBalloonEvent *balloon_event_fn; > static QEMUBalloonStatus *balloon_stat_fn; > static void *balloon_opaque; > =20 > +static int have_ballon(Error **errp) > +{ > + if (kvm_enabled() && !kvm_has_sync_mmu()) { > + error_set(errp, QERR_KVM_MISSING_CAP, "synchronous MMU", "ball= oon"); > + return 0; > + } > + if (!balloon_event_fn) { > + error_set(errp, QERR_DEVICE_NOT_ACTIVE, "balloon"); > + return 0; > + } > + return 1; Another case where I would have used bool, true, false. Either way, Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --pSrWGsBlAXWgvoicmSgNXBBofP6UIbkXP Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJUtm9FAAoJEKeha0olJ0NqM0oIAJLkAjhYEVdgPnx4+Dipfo05 Wqszc+Dg8Io510n3fhmH+2pm3UKGLLbnoAg0wkehj4hM3IY8LrYkkcEbnHCZvagu DiAmVnbhociXeuhAZKJf9cQVcXvOr3v7MuRakOdMMdVQXdK3EWvC5OLWp4etqZrQ QwLZuC9mhXiZfGPc4RpEAZWlJb8j3h0ImqwPPWBlThNYfVZNBQ3FTXw//2AU3BrY Py8qFHCD6e090iC3zGIModUUDMxd/92hyXsb5Vf3ssrn9TJ6jzy/0vGKVbI51F9Z ABjj1EOHX5EVjwDvJpCUPkpe3em2m8CbLi8rm76KfzBODKiTP3kPU4r34FrjSnw= =wWQR -----END PGP SIGNATURE----- --pSrWGsBlAXWgvoicmSgNXBBofP6UIbkXP--