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/replay > if such devices are included into the configuration. > > Signed-off-by: Pavel Dovgalyuk <pavel.dovga...@ispras.ru> > --- > 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(-) >
> @@ -2189,6 +2193,9 @@ struct HCIInfo *bt_new_hci(struct bt_scatternet_s *net) > > s->device.handle_destroy = bt_hci_destroy; > > + error_set(&s->replay_blocker, ERROR_CLASS_REPLAY_NOT_SUPPORTED, "bt > 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" > > +#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' ] } -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature