From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45367) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjYfM-0007m6-FL for qemu-devel@nongnu.org; Tue, 06 Oct 2015 16:17:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZjYeS-00061x-HO for qemu-devel@nongnu.org; Tue, 06 Oct 2015 16:16:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55608) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjYeQ-00060W-Ef for qemu-devel@nongnu.org; Tue, 06 Oct 2015 16:15:55 -0400 References: <20150917162322.8676.29314.stgit@PASHA-ISP.def.inno> <20150917162512.8676.11367.stgit@PASHA-ISP.def.inno> From: Eric Blake Message-ID: <56142BF7.50402@redhat.com> Date: Tue, 6 Oct 2015 14:15:51 -0600 MIME-Version: 1.0 In-Reply-To: <20150917162512.8676.11367.stgit@PASHA-ISP.def.inno> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IbcEdJcUvMVpW9kPnLvkECgUA4pi2bRfM" Subject: Re: [Qemu-devel] [PATCH v18 19/21] replay: replay blockers for devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Dovgalyuk , qemu-devel@nongnu.org Cc: edgar.iglesias@xilinx.com, peter.maydell@linaro.org, igor.rubinov@gmail.com, mark.burton@greensocs.com, real@ispras.ru, batuzovk@ispras.ru, maria.klimushenkova@ispras.ru, pbonzini@redhat.com, hines@cert.org, alex.bennee@linaro.org, fred.konrad@greensocs.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --IbcEdJcUvMVpW9kPnLvkECgUA4pi2bRfM Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/17/2015 10:25 AM, Pavel Dovgalyuk wrote: > Some devices are not supported by record/replay subsystem. > This patch introduces replay blocker which denies starting record/repla= y > if such devices are included into the configuration. >=20 > Signed-off-by: Pavel Dovgalyuk > --- > hw/bt/hci.c | 7 +++++++ > include/qapi/qmp/qerror.h | 3 +++ > qapi/common.json | 6 +++++- > replay/replay.c | 13 +++++++++++++ > replay/replay.h | 3 +++ > vl.c | 10 ++++++++++ > 6 files changed, 41 insertions(+), 1 deletions(-) >=20 > @@ -2189,6 +2193,9 @@ struct HCIInfo *bt_new_hci(struct bt_scatternet_s= *net) > =20 > s->device.handle_destroy =3D bt_hci_destroy; > =20 > + error_set(&s->replay_blocker, ERROR_CLASS_REPLAY_NOT_SUPPORTED, "b= t hci"); New code should favor error_setg(). > +++ b/include/qapi/qmp/qerror.h > @@ -106,4 +106,7 @@ > #define QERR_UNSUPPORTED \ > "this feature or command is not currently supported" > =20 > +#define QERR_REPLAY_NOT_SUPPORTED \ > + ERROR_CLASS_GENERIC_ERROR, "Record/replay feature is not supported= for '%s'" We very strongly discourage the addition of new error classes. Most new errors should be part of ERROR_CLASS_GENERIC_ERROR, in which case error_setg() should be used with the message directly inline instead of hidden behind a macro. > + > #endif /* QERROR_H */ > diff --git a/qapi/common.json b/qapi/common.json > index bad56bf..d80e3d4 100644 > --- a/qapi/common.json > +++ b/qapi/common.json > @@ -22,11 +22,15 @@ > # @KVMMissingCap: the requested operation can't be fulfilled because a= > # required KVM capability is missing > # > +# @ReplayNotSupported: the requested feature is not supported with > +# record/replay mode enabled > +# Again, this should not be added. But even if it were acceptable to add, it is missing a 'since 2.5' designation. > # Since: 1.2 > ## > { 'enum': 'ErrorClass', > 'data': [ 'GenericError', 'CommandNotFound', 'DeviceEncrypted', > - 'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap' ] } > + 'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap', > + 'ReplayNotSupported' ] } --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --IbcEdJcUvMVpW9kPnLvkECgUA4pi2bRfM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWFCv4AAoJEKeha0olJ0Nq3OYH/j38CYcmpLyyzhZ77FHJUg+Q NgAjKZxg2vOKXeahJuJd1sf6ho5d9DwTFXekOcHiy6sYda0ZiJ6jbmbCDOTGkFUd r7tf+JaE9WAWxc3qsE9EREra4hd76KYJ/N0K31Qyt5rloM2Kxua+d1Ttr4C+cNSz +Vz+Xk26oPLbv7sluVwCs+bk7ujZf6To/MpDARyP8oKcEL+ShBHDWnI2NkRdFIRk TgRNppfVO4UnRJmaPrxLUSBKxebQOlmb6CdL3VseeDOg3/7n9l+ULBCr1kYgEoCs BLjWpBl+14aIC/cOVj2H9XnwBjS92zAaV1lPXdRU24aqR+UtDRzGXNowBWyykPk= =Zynk -----END PGP SIGNATURE----- --IbcEdJcUvMVpW9kPnLvkECgUA4pi2bRfM--