mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-10-04 18:20:06 +00:00
replay: replay blockers for devices
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.dovgaluk@ispras.ru> Message-Id: <20150917162512.8676.11367.stgit@PASHA-ISP.def.inno> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
This commit is contained in:
parent
7615936ebf
commit
0194749ac4
|
@ -23,6 +23,8 @@
|
||||||
#include "hw/usb.h"
|
#include "hw/usb.h"
|
||||||
#include "sysemu/bt.h"
|
#include "sysemu/bt.h"
|
||||||
#include "hw/bt.h"
|
#include "hw/bt.h"
|
||||||
|
#include "qapi/qmp/qerror.h"
|
||||||
|
#include "sysemu/replay.h"
|
||||||
|
|
||||||
struct bt_hci_s {
|
struct bt_hci_s {
|
||||||
uint8_t *(*evt_packet)(void *opaque);
|
uint8_t *(*evt_packet)(void *opaque);
|
||||||
|
@ -72,6 +74,8 @@ struct bt_hci_s {
|
||||||
|
|
||||||
struct HCIInfo info;
|
struct HCIInfo info;
|
||||||
struct bt_device_s device;
|
struct bt_device_s device;
|
||||||
|
|
||||||
|
Error *replay_blocker;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define DEFAULT_RSSI_DBM 20
|
#define DEFAULT_RSSI_DBM 20
|
||||||
|
@ -2189,6 +2193,9 @@ struct HCIInfo *bt_new_hci(struct bt_scatternet_s *net)
|
||||||
|
|
||||||
s->device.handle_destroy = bt_hci_destroy;
|
s->device.handle_destroy = bt_hci_destroy;
|
||||||
|
|
||||||
|
error_setg(&s->replay_blocker, QERR_REPLAY_NOT_SUPPORTED, "-bt hci");
|
||||||
|
replay_add_blocker(s->replay_blocker);
|
||||||
|
|
||||||
return &s->info;
|
return &s->info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,4 +106,7 @@
|
||||||
#define QERR_UNSUPPORTED \
|
#define QERR_UNSUPPORTED \
|
||||||
"this feature or command is not currently supported"
|
"this feature or command is not currently supported"
|
||||||
|
|
||||||
|
#define QERR_REPLAY_NOT_SUPPORTED \
|
||||||
|
"Record/replay feature is not supported for '%s'"
|
||||||
|
|
||||||
#endif /* QERROR_H */
|
#endif /* QERROR_H */
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "qapi-types.h"
|
#include "qapi-types.h"
|
||||||
|
#include "qapi/error.h"
|
||||||
#include "qemu/typedefs.h"
|
#include "qemu/typedefs.h"
|
||||||
|
|
||||||
/* replay clock kinds */
|
/* replay clock kinds */
|
||||||
|
@ -51,6 +52,8 @@ void replay_configure(struct QemuOpts *opts);
|
||||||
void replay_start(void);
|
void replay_start(void);
|
||||||
/*! Closes replay log file and frees other resources. */
|
/*! Closes replay log file and frees other resources. */
|
||||||
void replay_finish(void);
|
void replay_finish(void);
|
||||||
|
/*! Adds replay blocker with the specified error description */
|
||||||
|
void replay_add_blocker(Error *reason);
|
||||||
|
|
||||||
/* Processing the instructions */
|
/* Processing the instructions */
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@ ReplayMode replay_mode = REPLAY_MODE_NONE;
|
||||||
/* Name of replay file */
|
/* Name of replay file */
|
||||||
static char *replay_filename;
|
static char *replay_filename;
|
||||||
ReplayState replay_state;
|
ReplayState replay_state;
|
||||||
|
static GSList *replay_blockers;
|
||||||
|
|
||||||
bool replay_next_event_is(int event)
|
bool replay_next_event_is(int event)
|
||||||
{
|
{
|
||||||
|
@ -289,6 +290,12 @@ void replay_start(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (replay_blockers) {
|
||||||
|
error_report("Record/replay: %s",
|
||||||
|
error_get_pretty(replay_blockers->data));
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
/* Timer for snapshotting will be set up here. */
|
/* Timer for snapshotting will be set up here. */
|
||||||
|
|
||||||
replay_enable_events();
|
replay_enable_events();
|
||||||
|
@ -324,3 +331,8 @@ void replay_finish(void)
|
||||||
replay_finish_events();
|
replay_finish_events();
|
||||||
replay_mutex_destroy();
|
replay_mutex_destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void replay_add_blocker(Error *reason)
|
||||||
|
{
|
||||||
|
replay_blockers = g_slist_prepend(replay_blockers, reason);
|
||||||
|
}
|
||||||
|
|
10
vl.c
10
vl.c
|
@ -123,6 +123,7 @@ int main(int argc, char **argv)
|
||||||
#include "exec/semihost.h"
|
#include "exec/semihost.h"
|
||||||
#include "crypto/init.h"
|
#include "crypto/init.h"
|
||||||
#include "sysemu/replay.h"
|
#include "sysemu/replay.h"
|
||||||
|
#include "qapi/qmp/qerror.h"
|
||||||
|
|
||||||
#define MAX_VIRTIO_CONSOLES 1
|
#define MAX_VIRTIO_CONSOLES 1
|
||||||
#define MAX_SCLP_CONSOLES 1
|
#define MAX_SCLP_CONSOLES 1
|
||||||
|
@ -847,7 +848,11 @@ static void configure_rtc(QemuOpts *opts)
|
||||||
if (!strcmp(value, "utc")) {
|
if (!strcmp(value, "utc")) {
|
||||||
rtc_utc = 1;
|
rtc_utc = 1;
|
||||||
} else if (!strcmp(value, "localtime")) {
|
} else if (!strcmp(value, "localtime")) {
|
||||||
|
Error *blocker = NULL;
|
||||||
rtc_utc = 0;
|
rtc_utc = 0;
|
||||||
|
error_setg(&blocker, QERR_REPLAY_NOT_SUPPORTED,
|
||||||
|
"-rtc base=localtime");
|
||||||
|
replay_add_blocker(blocker);
|
||||||
} else {
|
} else {
|
||||||
configure_rtc_date_offset(value, 0);
|
configure_rtc_date_offset(value, 0);
|
||||||
}
|
}
|
||||||
|
@ -1256,6 +1261,11 @@ static void smp_parse(QemuOpts *opts)
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (smp_cpus > 1 || smp_cores > 1 || smp_threads > 1) {
|
||||||
|
Error *blocker = NULL;
|
||||||
|
error_setg(&blocker, QERR_REPLAY_NOT_SUPPORTED, "smp");
|
||||||
|
replay_add_blocker(blocker);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void realtime_init(void)
|
static void realtime_init(void)
|
||||||
|
|
Loading…
Reference in a new issue