* [Qemu-devel] [PATCH v5 0/7] Deterministic replay extensions
@ 2016-03-14 7:44 Pavel Dovgalyuk
2016-03-14 7:44 ` [Qemu-devel] [PATCH v5 1/7] replay: character devices Pavel Dovgalyuk
` (8 more replies)
0 siblings, 9 replies; 18+ messages in thread
From: Pavel Dovgalyuk @ 2016-03-14 7:44 UTC (permalink / raw)
To: qemu-devel
Cc: edgar.iglesias, peter.maydell, igor.rubinov, alex.bennee,
mark.burton, real, hines, batuzovk, maria.klimushenkova,
pavel.dovgaluk, pbonzini, kwolf, stefanha, fred.konrad
This set of patches is related to the reverse execution and deterministic
replay of qemu execution. It includes recording and replaying of serial devices
and block devices operations.
With these patches one can record and deterministically replay behavior
of the system with connected disk drives and serial communication ports
(e.g., telnet terminal).
Patches for deterministic replay of the block devices intercept calls of
bdrv coroutine functions at the top of block drivers stack.
To record and replay block operations the drive must be configured
as following:
-drive file=disk.qcow,if=none,id=img-direct
-drive driver=blkreplay,if=none,image=img-direct,id=img-blkreplay
-device ide-hd,drive=img-blkreplay
blkreplay driver should be inserted between disk image and virtual driver
controller. Therefore all disk requests may be recorded and replayed.
v5 changes:
- updated record/replay documentation (as suggested by Paolo Bonzini)
- added record/replay support for qemu_chr_fe_write_all and qemu_chr_fe_read_all functions
- added protection from chardevs unplugging in record/replay mode (as suggested by Paolo Bonzini)
- minor chardevs record/replay changes (as suggested by Paolo Bonzini)
- BH replay bugfix was moved to separate patch (as suggested by Stefan Hajnoczi)
- fixed error message in replay events queue module
v4 changes:
- minor fixes in blkreplay layer (as suggested by Kevin Wolf)
- split qemu_clock_warp into two functions (as suggested by Paolo Bonzini)
v3 changes:
- introduced bdrv_flush callback for block drivers
- introduced block driver for recording block operations (as suggested by Kevin Wolf)
- added documentation for block record/replay
v2 changes:
- removed obsolete call of qemu_clock_warp
- fixed record/replay of aio_cancel
- simplified call sequence for blk_aio_ functions in non-replay mode (as suggested by Kevin Wolf)
---
Pavel Dovgalyuk (7):
replay: character devices
icount: remove obsolete warp call
icount: decouple warp calls
block: add flush callback
replay: bh scheduling fix
replay: fix error message
replay: introduce block devices record/replay
block/Makefile.objs | 2 -
block/blkreplay.c | 159 +++++++++++++++++++++++++++++++++++++++++++
block/io.c | 7 ++
cpus.c | 56 ++++++++-------
docs/replay.txt | 37 +++++++++-
gdbstub.c | 2 -
include/block/block_int.h | 7 ++
include/qemu/timer.h | 14 +++-
include/sysemu/char.h | 26 +++++++
include/sysemu/replay.h | 22 ++++++
main-loop.c | 2 -
qemu-char.c | 138 ++++++++++++++++++++++++++++++-------
qemu-timer.c | 4 +
replay/Makefile.objs | 1
replay/replay-char.c | 167 +++++++++++++++++++++++++++++++++++++++++++++
replay/replay-events.c | 41 ++++++++++-
replay/replay-internal.h | 19 +++++
replay/replay.c | 2 -
stubs/clock-warp.c | 2 -
stubs/replay.c | 4 +
20 files changed, 641 insertions(+), 71 deletions(-)
create mode 100755 block/blkreplay.c
create mode 100755 replay/replay-char.c
--
Pavel Dovgalyuk
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Qemu-devel] [PATCH v5 1/7] replay: character devices
2016-03-14 7:44 [Qemu-devel] [PATCH v5 0/7] Deterministic replay extensions Pavel Dovgalyuk
@ 2016-03-14 7:44 ` Pavel Dovgalyuk
2016-03-14 14:11 ` Paolo Bonzini
2016-03-23 15:45 ` Kevin Wolf
2016-03-14 7:44 ` [Qemu-devel] [PATCH v5 2/7] icount: remove obsolete warp call Pavel Dovgalyuk
` (7 subsequent siblings)
8 siblings, 2 replies; 18+ messages in thread
From: Pavel Dovgalyuk @ 2016-03-14 7:44 UTC (permalink / raw)
To: qemu-devel
Cc: edgar.iglesias, peter.maydell, igor.rubinov, alex.bennee,
mark.burton, real, hines, batuzovk, maria.klimushenkova,
pavel.dovgaluk, pbonzini, kwolf, stefanha, fred.konrad
This patch implements record and replay of character devices.
It records chardevs communication in replay mode. Recorded information
include data read from backend and counter of bytes written
from frontend to backend to preserve frontend internal state.
If character device was configured through the command line in record mode,
then in replay mode it should be also added to command line. Backend of
the character device could be changed in replay mode.
Replaying of devices that perform ioctl and get_msgfd operations is not
supported.
gdbstub which also acts as a backend is not recorded to allow controlling
the replaying through gdb. Monitor backends are also not recorded.
Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
---
gdbstub.c | 2 -
include/sysemu/char.h | 26 +++++++
include/sysemu/replay.h | 17 +++++
qemu-char.c | 138 +++++++++++++++++++++++++++++++-------
replay/Makefile.objs | 1
replay/replay-char.c | 167 ++++++++++++++++++++++++++++++++++++++++++++++
replay/replay-events.c | 17 ++++-
replay/replay-internal.h | 18 +++++
replay/replay.c | 2 -
9 files changed, 358 insertions(+), 30 deletions(-)
create mode 100755 replay/replay-char.c
diff --git a/gdbstub.c b/gdbstub.c
index 61c12b1..fdcb0ee 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1752,7 +1752,7 @@ int gdbserver_start(const char *device)
sigaction(SIGINT, &act, NULL);
}
#endif
- chr = qemu_chr_new("gdb", device, NULL);
+ chr = qemu_chr_new_noreplay("gdb", device, NULL);
if (!chr)
return -1;
diff --git a/include/sysemu/char.h b/include/sysemu/char.h
index e46884f..4c2f777 100644
--- a/include/sysemu/char.h
+++ b/include/sysemu/char.h
@@ -86,6 +86,7 @@ struct CharDriverState {
int is_mux;
guint fd_in_tag;
QemuOpts *opts;
+ bool replay;
QTAILQ_ENTRY(CharDriverState) next;
};
@@ -139,6 +140,22 @@ CharDriverState *qemu_chr_new(const char *label, const char *filename,
void (*init)(struct CharDriverState *s));
/**
+ * @qemu_chr_new_noreplay:
+ *
+ * Create a new character backend from a URI.
+ * Character device communications are not written
+ * into the replay log.
+ *
+ * @label the name of the backend
+ * @filename the URI
+ * @init not sure..
+ *
+ * Returns: a new character backend
+ */
+CharDriverState *qemu_chr_new_noreplay(const char *label, const char *filename,
+ void (*init)(struct CharDriverState *s));
+
+/**
* @qemu_chr_delete:
*
* Destroy a character backend and remove it from the list of
@@ -341,6 +358,15 @@ int qemu_chr_be_can_write(CharDriverState *s);
*/
void qemu_chr_be_write(CharDriverState *s, uint8_t *buf, int len);
+/**
+ * @qemu_chr_be_write_impl:
+ *
+ * Implementation of back end writing. Used by replay module.
+ *
+ * @buf a buffer to receive data from the front end
+ * @len the number of bytes to receive from the front end
+ */
+void qemu_chr_be_write_impl(CharDriverState *s, uint8_t *buf, int len);
/**
* @qemu_chr_be_event:
diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h
index e4108e8..d24d502 100644
--- a/include/sysemu/replay.h
+++ b/include/sysemu/replay.h
@@ -114,4 +114,21 @@ void replay_input_event(QemuConsole *src, InputEvent *evt);
/*! Adds input sync event to the queue */
void replay_input_sync_event(void);
+/* Character device */
+
+/*! Registers char driver to save it's events */
+void replay_register_char_driver(struct CharDriverState *chr);
+/*! Saves write to char device event to the log */
+void replay_chr_be_write(struct CharDriverState *s, uint8_t *buf, int len);
+/*! Writes char write return value to the replay log. */
+void replay_char_write_event_save(int res, int offset);
+/*! Reads char write return value from the replay log. */
+void replay_char_write_event_load(int *res, int *offset);
+/*! Reads information about read_all character event. */
+int replay_char_read_all_load(uint8_t *buf);
+/*! Writes character read_all error code into the replay log. */
+void replay_char_read_all_save_error(int res);
+/*! Writes character read_all execution result into the replay log. */
+void replay_char_read_all_save_buf(uint8_t *buf, int offset);
+
#endif
diff --git a/qemu-char.c b/qemu-char.c
index e0147f3..b418307 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -37,6 +37,7 @@
#include "io/channel-socket.h"
#include "io/channel-file.h"
#include "io/channel-tls.h"
+#include "sysemu/replay.h"
#include <zlib.h>
@@ -234,10 +235,46 @@ static void qemu_chr_fe_write_log(CharDriverState *s,
}
}
+static int qemu_chr_fe_write_buffer(CharDriverState *s, const uint8_t *buf, int len, int *offset)
+{
+ int res = 0;
+ *offset = 0;
+
+ qemu_mutex_lock(&s->chr_write_lock);
+ while (*offset < len) {
+ do {
+ res = s->chr_write(s, buf + *offset, len - *offset);
+ if (res == -1 && errno == EAGAIN) {
+ g_usleep(100);
+ }
+ } while (res == -1 && errno == EAGAIN);
+
+ if (res <= 0) {
+ break;
+ }
+
+ *offset += res;
+ }
+ if (*offset > 0) {
+ qemu_chr_fe_write_log(s, buf, *offset);
+ }
+ qemu_mutex_unlock(&s->chr_write_lock);
+
+ return res;
+}
+
int qemu_chr_fe_write(CharDriverState *s, const uint8_t *buf, int len)
{
int ret;
+ if (s->replay && replay_mode == REPLAY_MODE_PLAY) {
+ int offset;
+ replay_char_write_event_load(&ret, &offset);
+ assert(offset <= len);
+ qemu_chr_fe_write_buffer(s, buf, offset, &offset);
+ return ret;
+ }
+
qemu_mutex_lock(&s->chr_write_lock);
ret = s->chr_write(s, buf, len);
@@ -246,34 +283,31 @@ int qemu_chr_fe_write(CharDriverState *s, const uint8_t *buf, int len)
}
qemu_mutex_unlock(&s->chr_write_lock);
+
+ if (s->replay && replay_mode == REPLAY_MODE_RECORD) {
+ replay_char_write_event_save(ret, ret < 0 ? 0 : ret);
+ }
+
return ret;
}
int qemu_chr_fe_write_all(CharDriverState *s, const uint8_t *buf, int len)
{
- int offset = 0;
- int res = 0;
+ int offset;
+ int res;
- qemu_mutex_lock(&s->chr_write_lock);
- while (offset < len) {
- do {
- res = s->chr_write(s, buf + offset, len - offset);
- if (res == -1 && errno == EAGAIN) {
- g_usleep(100);
- }
- } while (res == -1 && errno == EAGAIN);
+ if (s->replay && replay_mode == REPLAY_MODE_PLAY) {
+ replay_char_write_event_load(&res, &offset);
+ assert(offset <= len);
+ qemu_chr_fe_write_buffer(s, buf, offset, &offset);
+ return res;
+ }
- if (res <= 0) {
- break;
- }
+ res = qemu_chr_fe_write_buffer(s, buf, len, &offset);
- offset += res;
+ if (s->replay && replay_mode == REPLAY_MODE_RECORD) {
+ replay_char_write_event_save(res, offset);
}
- if (offset > 0) {
- qemu_chr_fe_write_log(s, buf, offset);
- }
-
- qemu_mutex_unlock(&s->chr_write_lock);
if (res < 0) {
return res;
@@ -289,6 +323,10 @@ int qemu_chr_fe_read_all(CharDriverState *s, uint8_t *buf, int len)
if (!s->chr_sync_read) {
return 0;
}
+
+ if (s->replay && replay_mode == REPLAY_MODE_PLAY) {
+ return replay_char_read_all_load(buf);
+ }
while (offset < len) {
do {
@@ -303,6 +341,9 @@ int qemu_chr_fe_read_all(CharDriverState *s, uint8_t *buf, int len)
}
if (res < 0) {
+ if (s->replay && replay_mode == REPLAY_MODE_RECORD) {
+ replay_char_read_all_save_error(res);
+ }
return res;
}
@@ -313,14 +354,22 @@ int qemu_chr_fe_read_all(CharDriverState *s, uint8_t *buf, int len)
}
}
+ if (s->replay && replay_mode == REPLAY_MODE_RECORD) {
+ replay_char_read_all_save_buf(buf, offset);
+ }
return offset;
}
int qemu_chr_fe_ioctl(CharDriverState *s, int cmd, void *arg)
{
- if (!s->chr_ioctl)
- return -ENOTSUP;
- return s->chr_ioctl(s, cmd, arg);
+ int res;
+ if (!s->chr_ioctl || s->replay) {
+ res = -ENOTSUP;
+ } else {
+ res = s->chr_ioctl(s, cmd, arg);
+ }
+
+ return res;
}
int qemu_chr_be_can_write(CharDriverState *s)
@@ -330,17 +379,35 @@ int qemu_chr_be_can_write(CharDriverState *s)
return s->chr_can_read(s->handler_opaque);
}
-void qemu_chr_be_write(CharDriverState *s, uint8_t *buf, int len)
+void qemu_chr_be_write_impl(CharDriverState *s, uint8_t *buf, int len)
{
if (s->chr_read) {
s->chr_read(s->handler_opaque, buf, len);
}
}
+void qemu_chr_be_write(CharDriverState *s, uint8_t *buf, int len)
+{
+ if (s->replay) {
+ if (replay_mode == REPLAY_MODE_PLAY) {
+ return;
+ }
+ replay_chr_be_write(s, buf, len);
+ } else {
+ qemu_chr_be_write_impl(s, buf, len);
+ }
+}
+
int qemu_chr_fe_get_msgfd(CharDriverState *s)
{
int fd;
- return (qemu_chr_fe_get_msgfds(s, &fd, 1) == 1) ? fd : -1;
+ int res = (qemu_chr_fe_get_msgfds(s, &fd, 1) == 1) ? fd : -1;
+ if (s->replay) {
+ fprintf(stderr,
+ "Replay: get msgfd is not supported for serial devices yet\n");
+ exit(1);
+ }
+ return res;
}
int qemu_chr_fe_get_msgfds(CharDriverState *s, int *fds, int len)
@@ -3855,7 +3922,8 @@ err:
return NULL;
}
-CharDriverState *qemu_chr_new(const char *label, const char *filename, void (*init)(struct CharDriverState *s))
+CharDriverState *qemu_chr_new_noreplay(const char *label, const char *filename,
+ void (*init)(struct CharDriverState *s))
{
const char *p;
CharDriverState *chr;
@@ -3881,6 +3949,21 @@ CharDriverState *qemu_chr_new(const char *label, const char *filename, void (*in
return chr;
}
+CharDriverState *qemu_chr_new(const char *label, const char *filename, void (*init)(struct CharDriverState *s))
+{
+ CharDriverState *chr;
+ chr = qemu_chr_new_noreplay(label, filename, init);
+ if (chr) {
+ chr->replay = replay_mode != REPLAY_MODE_NONE;
+ if (chr->replay && chr->chr_ioctl) {
+ fprintf(stderr,
+ "Replay: ioctl is not supported for serial devices yet\n");
+ }
+ replay_register_char_driver(chr);
+ }
+ return chr;
+}
+
void qemu_chr_fe_set_echo(struct CharDriverState *chr, bool echo)
{
if (chr->chr_set_echo) {
@@ -4475,6 +4558,11 @@ void qmp_chardev_remove(const char *id, Error **errp)
error_setg(errp, "Chardev '%s' is busy", id);
return;
}
+ if (chr->replay) {
+ error_setg(errp,
+ "Chardev '%s' cannot be unplugged in record/replay mode", id);
+ return;
+ }
qemu_chr_delete(chr);
}
diff --git a/replay/Makefile.objs b/replay/Makefile.objs
index 232193a..70e5572 100644
--- a/replay/Makefile.objs
+++ b/replay/Makefile.objs
@@ -3,3 +3,4 @@ common-obj-y += replay-internal.o
common-obj-y += replay-events.o
common-obj-y += replay-time.o
common-obj-y += replay-input.o
+common-obj-y += replay-char.o
diff --git a/replay/replay-char.c b/replay/replay-char.c
new file mode 100755
index 0000000..bfbaf2e
--- /dev/null
+++ b/replay/replay-char.c
@@ -0,0 +1,167 @@
+/*
+ * replay-char.c
+ *
+ * Copyright (c) 2010-2016 Institute for System Programming
+ * of the Russian Academy of Sciences.
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "qemu/osdep.h"
+#include "sysemu/replay.h"
+#include "replay-internal.h"
+#include "sysemu/sysemu.h"
+#include "sysemu/char.h"
+
+/* Char drivers that generate qemu_chr_be_write events
+ that should be saved into the log. */
+static CharDriverState **char_drivers;
+static int drivers_count;
+
+/* Char event attributes. */
+typedef struct CharEvent {
+ int id;
+ uint8_t *buf;
+ size_t len;
+} CharEvent;
+
+static int find_char_driver(CharDriverState *chr)
+{
+ int i = 0;
+ for ( ; i < drivers_count ; ++i) {
+ if (char_drivers[i] == chr) {
+ return i;
+ }
+ }
+ return -1;
+}
+
+void replay_register_char_driver(CharDriverState *chr)
+{
+ if (replay_mode == REPLAY_MODE_NONE) {
+ return;
+ }
+ char_drivers = g_realloc(char_drivers,
+ sizeof(*char_drivers) * (drivers_count + 1));
+ char_drivers[drivers_count++] = chr;
+}
+
+void replay_chr_be_write(CharDriverState *s, uint8_t *buf, int len)
+{
+ CharEvent *event = g_malloc0(sizeof(CharEvent));
+
+ event->id = find_char_driver(s);
+ if (event->id < 0) {
+ fprintf(stderr, "Replay: cannot find char driver\n");
+ exit(1);
+ }
+ event->buf = g_malloc(len);
+ memcpy(event->buf, buf, len);
+ event->len = len;
+
+ replay_add_event(REPLAY_ASYNC_EVENT_CHAR_READ, event, NULL, 0);
+}
+
+void replay_event_char_read_run(void *opaque)
+{
+ CharEvent *event = (CharEvent *)opaque;
+
+ qemu_chr_be_write_impl(char_drivers[event->id], event->buf,
+ (int)event->len);
+
+ g_free(event->buf);
+ g_free(event);
+}
+
+void replay_event_char_read_save(void *opaque)
+{
+ CharEvent *event = (CharEvent *)opaque;
+
+ replay_put_byte(event->id);
+ replay_put_array(event->buf, event->len);
+}
+
+void *replay_event_char_read_load(void)
+{
+ CharEvent *event = g_malloc0(sizeof(CharEvent));
+
+ event->id = replay_get_byte();
+ replay_get_array_alloc(&event->buf, &event->len);
+
+ return event;
+}
+
+void replay_char_write_event_save(int res, int offset)
+{
+ replay_save_instructions();
+ replay_mutex_lock();
+ replay_put_event(EVENT_CHAR_WRITE);
+ replay_put_dword(res);
+ replay_put_dword(offset);
+ replay_mutex_unlock();
+}
+
+void replay_char_write_event_load(int *res, int *offset)
+{
+ replay_account_executed_instructions();
+ replay_mutex_lock();
+ if (replay_next_event_is(EVENT_CHAR_WRITE)) {
+ *res = replay_get_dword();
+ *offset = replay_get_dword();
+ replay_finish_event();
+ replay_mutex_unlock();
+ } else {
+ replay_mutex_unlock();
+ error_report("Missing character write event in the replay log");
+ exit(1);
+ }
+}
+
+int replay_char_read_all_load(uint8_t *buf)
+{
+ replay_mutex_lock();
+ if (replay_next_event_is(EVENT_CHAR_READ_ALL)) {
+ size_t size;
+ int res;
+ replay_get_array(buf, &size);
+ replay_finish_event();
+ replay_mutex_unlock();
+ res = (int)size;
+ assert(res >= 0);
+ return res;
+ } else if (replay_next_event_is(EVENT_CHAR_READ_ALL_ERROR)) {
+ int res = replay_get_dword();
+ replay_finish_event();
+ replay_mutex_unlock();
+ return res;
+ } else {
+ replay_mutex_unlock();
+ error_report("Missing character read all event in the replay log");
+ exit(1);
+ }
+}
+
+void replay_char_read_all_save_error(int res)
+{
+ assert(res < 0);
+ replay_save_instructions();
+ replay_mutex_lock();
+ replay_put_event(EVENT_CHAR_READ_ALL_ERROR);
+ replay_put_dword(res);
+ replay_mutex_unlock();
+}
+
+void replay_char_read_all_save_buf(uint8_t *buf, int offset)
+{
+ replay_save_instructions();
+ replay_mutex_lock();
+ replay_put_event(EVENT_CHAR_READ_ALL);
+ replay_put_array(buf, offset);
+ replay_mutex_unlock();
+}
diff --git a/replay/replay-events.c b/replay/replay-events.c
index 2628109..ca940f7 100644
--- a/replay/replay-events.c
+++ b/replay/replay-events.c
@@ -48,6 +48,9 @@ static void replay_run_event(Event *event)
case REPLAY_ASYNC_EVENT_INPUT_SYNC:
qemu_input_event_sync_impl();
break;
+ case REPLAY_ASYNC_EVENT_CHAR_READ:
+ replay_event_char_read_run(event->opaque);
+ break;
default:
error_report("Replay: invalid async event ID (%d) in the queue",
event->event_kind);
@@ -102,9 +105,9 @@ void replay_clear_events(void)
}
/*! Adds specified async event to the queue */
-static void replay_add_event(ReplayAsyncEventKind event_kind,
- void *opaque,
- void *opaque2, uint64_t id)
+void replay_add_event(ReplayAsyncEventKind event_kind,
+ void *opaque,
+ void *opaque2, uint64_t id)
{
assert(event_kind < REPLAY_ASYNC_COUNT);
@@ -168,6 +171,9 @@ static void replay_save_event(Event *event, int checkpoint)
break;
case REPLAY_ASYNC_EVENT_INPUT_SYNC:
break;
+ case REPLAY_ASYNC_EVENT_CHAR_READ:
+ replay_event_char_read_save(event->opaque);
+ break;
default:
error_report("Unknown ID %d of replay event", read_event_kind);
exit(1);
@@ -221,6 +227,11 @@ static Event *replay_read_event(int checkpoint)
event->event_kind = read_event_kind;
event->opaque = 0;
return event;
+ case REPLAY_ASYNC_EVENT_CHAR_READ:
+ event = g_malloc0(sizeof(Event));
+ event->event_kind = read_event_kind;
+ event->opaque = replay_event_char_read_load();
+ return event;
default:
error_report("Unknown ID %d of replay event", read_event_kind);
exit(1);
diff --git a/replay/replay-internal.h b/replay/replay-internal.h
index 5438ebd..11f9a85 100644
--- a/replay/replay-internal.h
+++ b/replay/replay-internal.h
@@ -24,6 +24,11 @@ enum ReplayEvents {
EVENT_ASYNC,
/* for shutdown request */
EVENT_SHUTDOWN,
+ /* for character device write event */
+ EVENT_CHAR_WRITE,
+ /* for character device read all event */
+ EVENT_CHAR_READ_ALL,
+ EVENT_CHAR_READ_ALL_ERROR,
/* for clock read/writes */
/* some of greater codes are reserved for clocks */
EVENT_CLOCK,
@@ -43,6 +48,7 @@ enum ReplayAsyncEventKind {
REPLAY_ASYNC_EVENT_BH,
REPLAY_ASYNC_EVENT_INPUT,
REPLAY_ASYNC_EVENT_INPUT_SYNC,
+ REPLAY_ASYNC_EVENT_CHAR_READ,
REPLAY_ASYNC_COUNT
};
@@ -124,6 +130,9 @@ bool replay_has_events(void);
void replay_save_events(int checkpoint);
/*! Read events from the file into the input queue */
void replay_read_events(int checkpoint);
+/*! Adds specified async event to the queue */
+void replay_add_event(ReplayAsyncEventKind event_kind, void *opaque,
+ void *opaque2, uint64_t id);
/* Input events */
@@ -136,4 +145,13 @@ void replay_add_input_event(struct InputEvent *event);
/*! Adds input sync event to the queue */
void replay_add_input_sync_event(void);
+/* Character devices */
+
+/*! Called to run char device read event. */
+void replay_event_char_read_run(void *opaque);
+/*! Writes char read event to the file. */
+void replay_event_char_read_save(void *opaque);
+/*! Reads char event read from the file. */
+void *replay_event_char_read_load(void);
+
#endif
diff --git a/replay/replay.c b/replay/replay.c
index f8739c2..fcfde4f 100644
--- a/replay/replay.c
+++ b/replay/replay.c
@@ -20,7 +20,7 @@
/* Current version of the replay mechanism.
Increase it when file format changes. */
-#define REPLAY_VERSION 0xe02002
+#define REPLAY_VERSION 0xe02003
/* Size of replay log header */
#define HEADER_SIZE (sizeof(uint32_t) + sizeof(uint64_t))
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Qemu-devel] [PATCH v5 2/7] icount: remove obsolete warp call
2016-03-14 7:44 [Qemu-devel] [PATCH v5 0/7] Deterministic replay extensions Pavel Dovgalyuk
2016-03-14 7:44 ` [Qemu-devel] [PATCH v5 1/7] replay: character devices Pavel Dovgalyuk
@ 2016-03-14 7:44 ` Pavel Dovgalyuk
2016-03-14 7:44 ` [Qemu-devel] [PATCH v5 3/7] icount: decouple warp calls Pavel Dovgalyuk
` (6 subsequent siblings)
8 siblings, 0 replies; 18+ messages in thread
From: Pavel Dovgalyuk @ 2016-03-14 7:44 UTC (permalink / raw)
To: qemu-devel
Cc: edgar.iglesias, peter.maydell, igor.rubinov, alex.bennee,
mark.burton, real, hines, batuzovk, maria.klimushenkova,
pavel.dovgaluk, pbonzini, kwolf, stefanha, fred.konrad
qemu_clock_warp call in qemu_tcg_wait_io_event function is not needed
anymore, because it is called in every iteration of main_loop_wait.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
---
cpus.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/cpus.c b/cpus.c
index bc774e2..85d0f87 100644
--- a/cpus.c
+++ b/cpus.c
@@ -995,9 +995,6 @@ static void qemu_wait_io_event_common(CPUState *cpu)
static void qemu_tcg_wait_io_event(CPUState *cpu)
{
while (all_cpu_threads_idle()) {
- /* Start accounting real time to the virtual clock if the CPUs
- are idle. */
- qemu_clock_warp(QEMU_CLOCK_VIRTUAL);
qemu_cond_wait(cpu->halt_cond, &qemu_global_mutex);
}
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Qemu-devel] [PATCH v5 3/7] icount: decouple warp calls
2016-03-14 7:44 [Qemu-devel] [PATCH v5 0/7] Deterministic replay extensions Pavel Dovgalyuk
2016-03-14 7:44 ` [Qemu-devel] [PATCH v5 1/7] replay: character devices Pavel Dovgalyuk
2016-03-14 7:44 ` [Qemu-devel] [PATCH v5 2/7] icount: remove obsolete warp call Pavel Dovgalyuk
@ 2016-03-14 7:44 ` Pavel Dovgalyuk
2016-03-14 7:44 ` [Qemu-devel] [PATCH v5 4/7] block: add flush callback Pavel Dovgalyuk
` (5 subsequent siblings)
8 siblings, 0 replies; 18+ messages in thread
From: Pavel Dovgalyuk @ 2016-03-14 7:44 UTC (permalink / raw)
To: qemu-devel
Cc: edgar.iglesias, peter.maydell, igor.rubinov, alex.bennee,
mark.burton, real, hines, batuzovk, maria.klimushenkova,
pavel.dovgaluk, pbonzini, kwolf, stefanha, fred.konrad
qemu_clock_warp function is called to update virtual clock when CPU
is sleeping. This function includes replay checkpoint to make execution
deterministic in icount mode.
Record/replay module flushes async event queue at checkpoints.
Some of the events (e.g., block devices operations) include interaction
with hardware. E.g., APIC polled by block devices sets one of IRQ flags.
Flag to be set depends on currently executed thread (CPU or iothread).
Therefore in replay mode we have to process the checkpoints in the same thread
as they were recorded.
qemu_clock_warp function (and its checkpoint) may be called from different
thread. This patch decouples two different execution cases of this function:
call when CPU is sleeping from iothread and call from cpu thread to update
virtual clock.
First task is performed by qemu_start_warp_timer function. It sets warp
timer event to the moment of nearest pending virtual timer.
Second function (qemu_account_warp_timer) is called from cpu thread
before execution of the code. It advances virtual clock by adding the length
of period while CPU was sleeping.
Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
---
cpus.c | 53 +++++++++++++++++++++++++++--------------------
docs/replay.txt | 17 +++++++++++----
include/qemu/timer.h | 14 +++++++++---
include/sysemu/replay.h | 3 ++-
main-loop.c | 2 +-
qemu-timer.c | 4 +++-
stubs/clock-warp.c | 2 +-
7 files changed, 60 insertions(+), 35 deletions(-)
diff --git a/cpus.c b/cpus.c
index 85d0f87..3ab9e04 100644
--- a/cpus.c
+++ b/cpus.c
@@ -373,6 +373,7 @@ static void icount_warp_rt(void)
static void icount_dummy_timer(void *opaque)
{
(void)opaque;
+ icount_warp_rt();
}
void qtest_clock_warp(int64_t dest)
@@ -396,17 +397,12 @@ void qtest_clock_warp(int64_t dest)
qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
}
-void qemu_clock_warp(QEMUClockType type)
+void qemu_start_warp_timer(void)
{
int64_t clock;
int64_t deadline;
- /*
- * There are too many global variables to make the "warp" behavior
- * applicable to other clocks. But a clock argument removes the
- * need for if statements all over the place.
- */
- if (type != QEMU_CLOCK_VIRTUAL || !use_icount) {
+ if (!use_icount) {
return;
}
@@ -418,29 +414,17 @@ void qemu_clock_warp(QEMUClockType type)
}
/* warp clock deterministically in record/replay mode */
- if (!replay_checkpoint(CHECKPOINT_CLOCK_WARP)) {
+ if (!replay_checkpoint(CHECKPOINT_CLOCK_WARP_START)) {
return;
}
- if (icount_sleep) {
- /*
- * If the CPUs have been sleeping, advance QEMU_CLOCK_VIRTUAL timer now.
- * This ensures that the deadline for the timer is computed correctly
- * below.
- * This also makes sure that the insn counter is synchronized before
- * the CPU starts running, in case the CPU is woken by an event other
- * than the earliest QEMU_CLOCK_VIRTUAL timer.
- */
- icount_warp_rt();
- timer_del(icount_warp_timer);
- }
if (!all_cpu_threads_idle()) {
return;
}
if (qtest_enabled()) {
/* When testing, qtest commands advance icount. */
- return;
+ return;
}
/* We want to use the earliest deadline from ALL vm_clocks */
@@ -496,6 +480,31 @@ void qemu_clock_warp(QEMUClockType type)
}
}
+void qemu_account_warp_timer(void)
+{
+ int64_t clock;
+ int64_t warp_delta;
+
+ if (!use_icount || !icount_sleep) {
+ return;
+ }
+
+ /* Nothing to do if the VM is stopped: QEMU_CLOCK_VIRTUAL timers
+ * do not fire, so computing the deadline does not make sense.
+ */
+ if (!runstate_is_running()) {
+ return;
+ }
+
+ /* warp clock deterministically in record/replay mode */
+ if (!replay_checkpoint(CHECKPOINT_CLOCK_WARP_ACCOUNT)) {
+ return;
+ }
+
+ timer_del(icount_warp_timer);
+ icount_warp_rt();
+}
+
static bool icount_state_needed(void *opaque)
{
return use_icount;
@@ -1496,7 +1505,7 @@ static void tcg_exec_all(void)
int r;
/* Account partial waits to QEMU_CLOCK_VIRTUAL. */
- qemu_clock_warp(QEMU_CLOCK_VIRTUAL);
+ qemu_account_warp_timer();
if (next_cpu == NULL) {
next_cpu = first_cpu;
diff --git a/docs/replay.txt b/docs/replay.txt
index 149727e..cf13cef 100644
--- a/docs/replay.txt
+++ b/docs/replay.txt
@@ -134,11 +134,18 @@ of time. That's why we do not process a group of timers until the checkpoint
event will be read from the log. Such an event allows synchronizing CPU
execution and timer events.
-Another checkpoints application in record/replay is instruction counting
-while the virtual machine is idle. This function (qemu_clock_warp) is called
-from the wait loop. It changes virtual machine state and must be deterministic
-then. That is why we added checkpoint to this function to prevent its
-operation in replay mode when it does not correspond to record mode.
+Two other checkpoints govern the "warping" of the virtual clock. While
+the virtual machine is idle, the virtual clock increments at 1 ns per
+*real time* nanosecond. This is done by setting up a timer (called the
+warp timer) and then incrementing the virtual clock (called "warping"
+the virtual clock) as soon as the CPUs need to go out of the idle state.
+These actions change virtual machine state and must be deterministic.
+Two functions are used for this purpose, and each of them creates a
+checkpoint. qemu_start_warp_timer checks if the CPUs are idle and if so
+starts accounting real time to virtual clock. qemu_account_warp_timer
+is called when the CPUs get an interrupt or when a virtual clock timer
+fires, and it warps the virtual clock by the amount of real time that
+has passed since qemu_start_warp_timer.
Bottom halves
-------------
diff --git a/include/qemu/timer.h b/include/qemu/timer.h
index d0946cb..21ffec6 100644
--- a/include/qemu/timer.h
+++ b/include/qemu/timer.h
@@ -210,12 +210,18 @@ void qemu_clock_notify(QEMUClockType type);
void qemu_clock_enable(QEMUClockType type, bool enabled);
/**
- * qemu_clock_warp:
- * @type: the clock type
+ * qemu_start_warp_timer:
+ *
+ * Starts a timer for virtual clock update
+ */
+void qemu_start_warp_timer(void);
+
+/**
+ * qemu_account_warp_timer:
*
- * Warp a clock to a new value
+ * Updates virtual clock for the time CPU was sleeping
*/
-void qemu_clock_warp(QEMUClockType type);
+void qemu_account_warp_timer(void);
/**
* qemu_clock_register_reset_notifier:
diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h
index d24d502..e798919 100644
--- a/include/sysemu/replay.h
+++ b/include/sysemu/replay.h
@@ -27,7 +27,8 @@ typedef enum ReplayClockKind ReplayClockKind;
/* IDs of the checkpoints */
enum ReplayCheckpoint {
- CHECKPOINT_CLOCK_WARP,
+ CHECKPOINT_CLOCK_WARP_START,
+ CHECKPOINT_CLOCK_WARP_ACCOUNT,
CHECKPOINT_RESET_REQUESTED,
CHECKPOINT_SUSPEND_REQUESTED,
CHECKPOINT_CLOCK_VIRTUAL,
diff --git a/main-loop.c b/main-loop.c
index 19beae7..3a7f4cd 100644
--- a/main-loop.c
+++ b/main-loop.c
@@ -509,7 +509,7 @@ int main_loop_wait(int nonblocking)
/* CPU thread can infinitely wait for event after
missing the warp */
- qemu_clock_warp(QEMU_CLOCK_VIRTUAL);
+ qemu_start_warp_timer();
qemu_clock_run_all_timers();
return ret;
diff --git a/qemu-timer.c b/qemu-timer.c
index e98ecc9..4441fe6 100644
--- a/qemu-timer.c
+++ b/qemu-timer.c
@@ -394,7 +394,9 @@ static bool timer_mod_ns_locked(QEMUTimerList *timer_list,
static void timerlist_rearm(QEMUTimerList *timer_list)
{
/* Interrupt execution to force deadline recalculation. */
- qemu_clock_warp(timer_list->clock->type);
+ if (timer_list->clock->type == QEMU_CLOCK_VIRTUAL) {
+ qemu_start_warp_timer();
+ }
timerlist_notify(timer_list);
}
diff --git a/stubs/clock-warp.c b/stubs/clock-warp.c
index 5ae32b9..8acb58a 100644
--- a/stubs/clock-warp.c
+++ b/stubs/clock-warp.c
@@ -2,7 +2,7 @@
#include "qemu-common.h"
#include "qemu/timer.h"
-void qemu_clock_warp(QEMUClockType type)
+void qemu_start_warp_timer(void)
{
}
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Qemu-devel] [PATCH v5 4/7] block: add flush callback
2016-03-14 7:44 [Qemu-devel] [PATCH v5 0/7] Deterministic replay extensions Pavel Dovgalyuk
` (2 preceding siblings ...)
2016-03-14 7:44 ` [Qemu-devel] [PATCH v5 3/7] icount: decouple warp calls Pavel Dovgalyuk
@ 2016-03-14 7:44 ` Pavel Dovgalyuk
2016-03-23 15:46 ` Kevin Wolf
2016-03-14 7:44 ` [Qemu-devel] [PATCH v5 5/7] replay: bh scheduling fix Pavel Dovgalyuk
` (4 subsequent siblings)
8 siblings, 1 reply; 18+ messages in thread
From: Pavel Dovgalyuk @ 2016-03-14 7:44 UTC (permalink / raw)
To: qemu-devel
Cc: edgar.iglesias, peter.maydell, igor.rubinov, alex.bennee,
mark.burton, real, hines, batuzovk, maria.klimushenkova,
pavel.dovgaluk, pbonzini, kwolf, stefanha, fred.konrad
This patch adds callback for flush request. This callback is responsible
for flushing whole block devices stack. bdrv_flush function does not
proceed to underlying devices. It should be performed by this callback
function, if needed.
Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
---
block/io.c | 7 +++++++
include/block/block_int.h | 7 +++++++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/block/io.c b/block/io.c
index a69bfc4..242ee0c 100644
--- a/block/io.c
+++ b/block/io.c
@@ -2369,6 +2369,13 @@ int coroutine_fn bdrv_co_flush(BlockDriverState *bs)
}
tracked_request_begin(&req, bs, 0, 0, BDRV_TRACKED_FLUSH);
+
+ /* Write back all layers by calling one driver function */
+ if (bs->drv->bdrv_co_flush) {
+ ret = bs->drv->bdrv_co_flush(bs);
+ goto out;
+ }
+
/* Write back cached data to the OS even with cache=unsafe */
BLKDBG_EVENT(bs->file, BLKDBG_FLUSH_TO_OS);
if (bs->drv->bdrv_co_flush_to_os) {
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 9ef823a..8f72037 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -176,6 +176,13 @@ struct BlockDriver {
int (*bdrv_inactivate)(BlockDriverState *bs);
/*
+ * Flushes all data for all layers by calling bdrv_co_flush for underlying
+ * layers, if needed. This function is needed for deterministic
+ * synchronization of the flush finishing callback.
+ */
+ int coroutine_fn (*bdrv_co_flush)(BlockDriverState *bs);
+
+ /*
* Flushes all data that was already written to the OS all the way down to
* the disk (for example raw-posix calls fsync()).
*/
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Qemu-devel] [PATCH v5 5/7] replay: bh scheduling fix
2016-03-14 7:44 [Qemu-devel] [PATCH v5 0/7] Deterministic replay extensions Pavel Dovgalyuk
` (3 preceding siblings ...)
2016-03-14 7:44 ` [Qemu-devel] [PATCH v5 4/7] block: add flush callback Pavel Dovgalyuk
@ 2016-03-14 7:44 ` Pavel Dovgalyuk
2016-03-14 7:45 ` [Qemu-devel] [PATCH v5 6/7] replay: fix error message Pavel Dovgalyuk
` (3 subsequent siblings)
8 siblings, 0 replies; 18+ messages in thread
From: Pavel Dovgalyuk @ 2016-03-14 7:44 UTC (permalink / raw)
To: qemu-devel
Cc: edgar.iglesias, peter.maydell, igor.rubinov, alex.bennee,
mark.burton, real, hines, batuzovk, maria.klimushenkova,
pavel.dovgaluk, pbonzini, kwolf, stefanha, fred.konrad
This patch fixes scheduling of bottom halves when record/replay is enabled.
Now BH are not added to replay queue when asynchronous events are disabled.
This may happen in startup and loadvm/savevm phases of execution.
Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
---
replay/replay-events.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/replay/replay-events.c b/replay/replay-events.c
index ca940f7..4aa8034 100644
--- a/replay/replay-events.c
+++ b/replay/replay-events.c
@@ -135,7 +135,7 @@ void replay_add_event(ReplayAsyncEventKind event_kind,
void replay_bh_schedule_event(QEMUBH *bh)
{
- if (replay_mode != REPLAY_MODE_NONE) {
+ if (replay_mode != REPLAY_MODE_NONE && events_enabled) {
uint64_t id = replay_get_current_step();
replay_add_event(REPLAY_ASYNC_EVENT_BH, bh, NULL, id);
} else {
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Qemu-devel] [PATCH v5 6/7] replay: fix error message
2016-03-14 7:44 [Qemu-devel] [PATCH v5 0/7] Deterministic replay extensions Pavel Dovgalyuk
` (4 preceding siblings ...)
2016-03-14 7:44 ` [Qemu-devel] [PATCH v5 5/7] replay: bh scheduling fix Pavel Dovgalyuk
@ 2016-03-14 7:45 ` Pavel Dovgalyuk
2016-03-24 11:56 ` Kevin Wolf
2016-03-14 7:45 ` [Qemu-devel] [PATCH v5 7/7] replay: introduce block devices record/replay Pavel Dovgalyuk
` (2 subsequent siblings)
8 siblings, 1 reply; 18+ messages in thread
From: Pavel Dovgalyuk @ 2016-03-14 7:45 UTC (permalink / raw)
To: qemu-devel
Cc: edgar.iglesias, peter.maydell, igor.rubinov, alex.bennee,
mark.burton, real, hines, batuzovk, maria.klimushenkova,
pavel.dovgaluk, pbonzini, kwolf, stefanha, fred.konrad
This patch fixes error message in saving loop of the asynchronous events queue.
Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
---
replay/replay-events.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/replay/replay-events.c b/replay/replay-events.c
index 4aa8034..b6b8a64 100644
--- a/replay/replay-events.c
+++ b/replay/replay-events.c
@@ -175,7 +175,7 @@ static void replay_save_event(Event *event, int checkpoint)
replay_event_char_read_save(event->opaque);
break;
default:
- error_report("Unknown ID %d of replay event", read_event_kind);
+ error_report("Unknown ID %d of replay event", event->id);
exit(1);
}
}
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [Qemu-devel] [PATCH v5 7/7] replay: introduce block devices record/replay
2016-03-14 7:44 [Qemu-devel] [PATCH v5 0/7] Deterministic replay extensions Pavel Dovgalyuk
` (5 preceding siblings ...)
2016-03-14 7:45 ` [Qemu-devel] [PATCH v5 6/7] replay: fix error message Pavel Dovgalyuk
@ 2016-03-14 7:45 ` Pavel Dovgalyuk
2016-03-23 15:52 ` Kevin Wolf
2016-03-15 20:04 ` [Qemu-devel] [PATCH v5 0/7] Deterministic replay extensions Igor R
2016-03-24 11:59 ` Kevin Wolf
8 siblings, 1 reply; 18+ messages in thread
From: Pavel Dovgalyuk @ 2016-03-14 7:45 UTC (permalink / raw)
To: qemu-devel
Cc: edgar.iglesias, peter.maydell, igor.rubinov, alex.bennee,
mark.burton, real, hines, batuzovk, maria.klimushenkova,
pavel.dovgaluk, pbonzini, kwolf, stefanha, fred.konrad
This patch introduces block driver that implement recording
and replaying of block devices' operations.
All block completion operations are added to the queue.
Queue is flushed at checkpoints and information about processed requests
is recorded to the log. In replay phase the queue is matched with
events read from the log. Therefore block devices requests are processed
deterministically.
Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
---
block/Makefile.objs | 2 -
block/blkreplay.c | 159 ++++++++++++++++++++++++++++++++++++++++++++++
docs/replay.txt | 20 ++++++
include/sysemu/replay.h | 2 +
replay/replay-events.c | 20 ++++++
replay/replay-internal.h | 1
replay/replay.c | 2 -
stubs/replay.c | 4 +
8 files changed, 208 insertions(+), 2 deletions(-)
create mode 100755 block/blkreplay.c
diff --git a/block/Makefile.objs b/block/Makefile.objs
index 58ef2ef..38fea16 100644
--- a/block/Makefile.objs
+++ b/block/Makefile.objs
@@ -4,7 +4,7 @@ block-obj-y += qed.o qed-gencb.o qed-l2-cache.o qed-table.o qed-cluster.o
block-obj-y += qed-check.o
block-obj-$(CONFIG_VHDX) += vhdx.o vhdx-endian.o vhdx-log.o
block-obj-y += quorum.o
-block-obj-y += parallels.o blkdebug.o blkverify.o
+block-obj-y += parallels.o blkdebug.o blkverify.o blkreplay.o
block-obj-y += block-backend.o snapshot.o qapi.o
block-obj-$(CONFIG_WIN32) += raw-win32.o win32-aio.o
block-obj-$(CONFIG_POSIX) += raw-posix.o
diff --git a/block/blkreplay.c b/block/blkreplay.c
new file mode 100755
index 0000000..56024a6
--- /dev/null
+++ b/block/blkreplay.c
@@ -0,0 +1,159 @@
+/*
+ * Block protocol for record/replay
+ *
+ * Copyright (c) 2010-2016 Institute for System Programming
+ * of the Russian Academy of Sciences.
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+
+#include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "block/block_int.h"
+#include "sysemu/replay.h"
+
+typedef struct Request {
+ Coroutine *co;
+ QEMUBH *bh;
+} Request;
+
+/* Next request id.
+ This counter is global, because requests from different
+ block devices should not get overlapping ids. */
+static uint64_t request_id;
+
+static int blkreplay_open(BlockDriverState *bs, QDict *options, int flags,
+ Error **errp)
+{
+ Error *local_err = NULL;
+ int ret;
+
+ /* Open the image file */
+ bs->file = bdrv_open_child(NULL, options, "image",
+ bs, &child_file, false, &local_err);
+ if (local_err) {
+ ret = -EINVAL;
+ error_propagate(errp, local_err);
+ goto fail;
+ }
+
+ ret = 0;
+fail:
+ if (ret < 0) {
+ bdrv_unref_child(bs, bs->file);
+ }
+ return ret;
+}
+
+static void blkreplay_close(BlockDriverState *bs)
+{
+}
+
+static int64_t blkreplay_getlength(BlockDriverState *bs)
+{
+ return bdrv_getlength(bs->file->bs);
+}
+
+/* This bh is used for synchronization of return from coroutines.
+ It continues yielded coroutine which then finishes its execution.
+ BH is called adjusted to some replay checkpoint, therefore
+ record and replay will always finish coroutines deterministically.
+*/
+static void blkreplay_bh_cb(void *opaque)
+{
+ Request *req = opaque;
+ qemu_coroutine_enter(req->co, NULL);
+ qemu_bh_delete(req->bh);
+ g_free(req);
+}
+
+static void block_request_create(uint64_t reqid, BlockDriverState *bs,
+ Coroutine *co)
+{
+ Request *req = g_new(Request, 1);
+ *req = (Request) {
+ .co = co,
+ .bh = aio_bh_new(bdrv_get_aio_context(bs), blkreplay_bh_cb, req),
+ };
+ replay_block_event(req->bh, reqid);
+}
+
+static int coroutine_fn blkreplay_co_readv(BlockDriverState *bs,
+ int64_t sector_num, int nb_sectors, QEMUIOVector *qiov)
+{
+ uint64_t reqid = request_id++;
+ int ret = bdrv_co_readv(bs->file->bs, sector_num, nb_sectors, qiov);
+ block_request_create(reqid, bs, qemu_coroutine_self());
+ qemu_coroutine_yield();
+
+ return ret;
+}
+
+static int coroutine_fn blkreplay_co_writev(BlockDriverState *bs,
+ int64_t sector_num, int nb_sectors, QEMUIOVector *qiov)
+{
+ uint64_t reqid = request_id++;
+ int ret = bdrv_co_writev(bs->file->bs, sector_num, nb_sectors, qiov);
+ block_request_create(reqid, bs, qemu_coroutine_self());
+ qemu_coroutine_yield();
+
+ return ret;
+}
+
+static int coroutine_fn blkreplay_co_write_zeroes(BlockDriverState *bs,
+ int64_t sector_num, int nb_sectors, BdrvRequestFlags flags)
+{
+ uint64_t reqid = request_id++;
+ int ret = bdrv_co_write_zeroes(bs->file->bs, sector_num, nb_sectors, flags);
+ block_request_create(reqid, bs, qemu_coroutine_self());
+ qemu_coroutine_yield();
+
+ return ret;
+}
+
+static int coroutine_fn blkreplay_co_discard(BlockDriverState *bs,
+ int64_t sector_num, int nb_sectors)
+{
+ uint64_t reqid = request_id++;
+ int ret = bdrv_co_discard(bs->file->bs, sector_num, nb_sectors);
+ block_request_create(reqid, bs, qemu_coroutine_self());
+ qemu_coroutine_yield();
+
+ return ret;
+}
+
+static int coroutine_fn blkreplay_co_flush(BlockDriverState *bs)
+{
+ uint64_t reqid = request_id++;
+ int ret = bdrv_co_flush(bs->file->bs);
+ block_request_create(reqid, bs, qemu_coroutine_self());
+ qemu_coroutine_yield();
+
+ return ret;
+}
+
+static BlockDriver bdrv_blkreplay = {
+ .format_name = "blkreplay",
+ .protocol_name = "blkreplay",
+ .instance_size = 0,
+
+ .bdrv_file_open = blkreplay_open,
+ .bdrv_close = blkreplay_close,
+ .bdrv_getlength = blkreplay_getlength,
+
+ .bdrv_co_readv = blkreplay_co_readv,
+ .bdrv_co_writev = blkreplay_co_writev,
+
+ .bdrv_co_write_zeroes = blkreplay_co_write_zeroes,
+ .bdrv_co_discard = blkreplay_co_discard,
+ .bdrv_co_flush = blkreplay_co_flush,
+};
+
+static void bdrv_blkreplay_init(void)
+{
+ bdrv_register(&bdrv_blkreplay);
+}
+
+block_init(bdrv_blkreplay_init);
diff --git a/docs/replay.txt b/docs/replay.txt
index cf13cef..3da0a4f 100644
--- a/docs/replay.txt
+++ b/docs/replay.txt
@@ -173,3 +173,23 @@ Sometimes the block layer uses asynchronous callbacks for its internal purposes
(like reading or writing VM snapshots or disk image cluster tables). In this
case bottom halves are not marked as "replayable" and do not saved
into the log.
+
+Block devices
+-------------
+
+Block devices record/replay module intercepts calls of
+bdrv coroutine functions at the top of block drivers stack.
+To record and replay block operations the drive must be configured
+as following:
+ -drive file=disk.qcow,if=none,id=img-direct
+ -drive driver=blkreplay,if=none,image=img-direct,id=img-blkreplay
+ -device ide-hd,drive=img-blkreplay
+
+blkreplay driver should be inserted between disk image and virtual driver
+controller. Therefore all disk requests may be recorded and replayed.
+
+All block completion operations are added to the queue in the coroutines.
+Queue is flushed at checkpoints and information about processed requests
+is recorded to the log. In replay phase the queue is matched with
+events read from the log. Therefore block devices requests are processed
+deterministically.
diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h
index e798919..57492da 100644
--- a/include/sysemu/replay.h
+++ b/include/sysemu/replay.h
@@ -114,6 +114,8 @@ void replay_bh_schedule_event(QEMUBH *bh);
void replay_input_event(QemuConsole *src, InputEvent *evt);
/*! Adds input sync event to the queue */
void replay_input_sync_event(void);
+/*! Adds block layer event to the queue */
+void replay_block_event(QEMUBH *bh, uint64_t id);
/* Character device */
diff --git a/replay/replay-events.c b/replay/replay-events.c
index b6b8a64..c797489 100644
--- a/replay/replay-events.c
+++ b/replay/replay-events.c
@@ -51,6 +51,9 @@ static void replay_run_event(Event *event)
case REPLAY_ASYNC_EVENT_CHAR_READ:
replay_event_char_read_run(event->opaque);
break;
+ case REPLAY_ASYNC_EVENT_BLOCK:
+ aio_bh_call(event->opaque);
+ break;
default:
error_report("Replay: invalid async event ID (%d) in the queue",
event->event_kind);
@@ -153,6 +156,15 @@ void replay_add_input_sync_event(void)
replay_add_event(REPLAY_ASYNC_EVENT_INPUT_SYNC, NULL, NULL, 0);
}
+void replay_block_event(QEMUBH *bh, uint64_t id)
+{
+ if (replay_mode != REPLAY_MODE_NONE && events_enabled) {
+ replay_add_event(REPLAY_ASYNC_EVENT_BLOCK, bh, NULL, id);
+ } else {
+ qemu_bh_schedule(bh);
+ }
+}
+
static void replay_save_event(Event *event, int checkpoint)
{
if (replay_mode != REPLAY_MODE_PLAY) {
@@ -174,6 +186,9 @@ static void replay_save_event(Event *event, int checkpoint)
case REPLAY_ASYNC_EVENT_CHAR_READ:
replay_event_char_read_save(event->opaque);
break;
+ case REPLAY_ASYNC_EVENT_BLOCK:
+ replay_put_qword(event->id);
+ break;
default:
error_report("Unknown ID %d of replay event", event->id);
exit(1);
@@ -232,6 +247,11 @@ static Event *replay_read_event(int checkpoint)
event->event_kind = read_event_kind;
event->opaque = replay_event_char_read_load();
return event;
+ case REPLAY_ASYNC_EVENT_BLOCK:
+ if (read_id == -1) {
+ read_id = replay_get_qword();
+ }
+ break;
default:
error_report("Unknown ID %d of replay event", read_event_kind);
exit(1);
diff --git a/replay/replay-internal.h b/replay/replay-internal.h
index 11f9a85..efbf14c 100644
--- a/replay/replay-internal.h
+++ b/replay/replay-internal.h
@@ -49,6 +49,7 @@ enum ReplayAsyncEventKind {
REPLAY_ASYNC_EVENT_INPUT,
REPLAY_ASYNC_EVENT_INPUT_SYNC,
REPLAY_ASYNC_EVENT_CHAR_READ,
+ REPLAY_ASYNC_EVENT_BLOCK,
REPLAY_ASYNC_COUNT
};
diff --git a/replay/replay.c b/replay/replay.c
index fcfde4f..810db14 100644
--- a/replay/replay.c
+++ b/replay/replay.c
@@ -20,7 +20,7 @@
/* Current version of the replay mechanism.
Increase it when file format changes. */
-#define REPLAY_VERSION 0xe02003
+#define REPLAY_VERSION 0xe02004
/* Size of replay log header */
#define HEADER_SIZE (sizeof(uint32_t) + sizeof(uint64_t))
diff --git a/stubs/replay.c b/stubs/replay.c
index 00ca01f..6f4a8e8 100644
--- a/stubs/replay.c
+++ b/stubs/replay.c
@@ -29,3 +29,7 @@ bool replay_events_enabled(void)
void replay_finish(void)
{
}
+
+void replay_block_event(QEMUBH *bh, uint64_t id)
+{
+}
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH v5 1/7] replay: character devices
2016-03-14 7:44 ` [Qemu-devel] [PATCH v5 1/7] replay: character devices Pavel Dovgalyuk
@ 2016-03-14 14:11 ` Paolo Bonzini
2016-03-23 15:45 ` Kevin Wolf
1 sibling, 0 replies; 18+ messages in thread
From: Paolo Bonzini @ 2016-03-14 14:11 UTC (permalink / raw)
To: Pavel Dovgalyuk, qemu-devel
Cc: edgar.iglesias, peter.maydell, igor.rubinov, mark.burton, real,
batuzovk, maria.klimushenkova, stefanha, kwolf, hines,
alex.bennee, fred.konrad
On 14/03/2016 08:44, Pavel Dovgalyuk wrote:
> This patch implements record and replay of character devices.
> It records chardevs communication in replay mode. Recorded information
> include data read from backend and counter of bytes written
> from frontend to backend to preserve frontend internal state.
> If character device was configured through the command line in record mode,
> then in replay mode it should be also added to command line. Backend of
> the character device could be changed in replay mode.
> Replaying of devices that perform ioctl and get_msgfd operations is not
> supported.
> gdbstub which also acts as a backend is not recorded to allow controlling
> the replaying through gdb. Monitor backends are also not recorded.
>
> Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
Thanks, this looks good.
Paolo
> ---
> gdbstub.c | 2 -
> include/sysemu/char.h | 26 +++++++
> include/sysemu/replay.h | 17 +++++
> qemu-char.c | 138 +++++++++++++++++++++++++++++++-------
> replay/Makefile.objs | 1
> replay/replay-char.c | 167 ++++++++++++++++++++++++++++++++++++++++++++++
> replay/replay-events.c | 17 ++++-
> replay/replay-internal.h | 18 +++++
> replay/replay.c | 2 -
> 9 files changed, 358 insertions(+), 30 deletions(-)
> create mode 100755 replay/replay-char.c
>
> diff --git a/gdbstub.c b/gdbstub.c
> index 61c12b1..fdcb0ee 100644
> --- a/gdbstub.c
> +++ b/gdbstub.c
> @@ -1752,7 +1752,7 @@ int gdbserver_start(const char *device)
> sigaction(SIGINT, &act, NULL);
> }
> #endif
> - chr = qemu_chr_new("gdb", device, NULL);
> + chr = qemu_chr_new_noreplay("gdb", device, NULL);
> if (!chr)
> return -1;
>
> diff --git a/include/sysemu/char.h b/include/sysemu/char.h
> index e46884f..4c2f777 100644
> --- a/include/sysemu/char.h
> +++ b/include/sysemu/char.h
> @@ -86,6 +86,7 @@ struct CharDriverState {
> int is_mux;
> guint fd_in_tag;
> QemuOpts *opts;
> + bool replay;
> QTAILQ_ENTRY(CharDriverState) next;
> };
>
> @@ -139,6 +140,22 @@ CharDriverState *qemu_chr_new(const char *label, const char *filename,
> void (*init)(struct CharDriverState *s));
>
> /**
> + * @qemu_chr_new_noreplay:
> + *
> + * Create a new character backend from a URI.
> + * Character device communications are not written
> + * into the replay log.
> + *
> + * @label the name of the backend
> + * @filename the URI
> + * @init not sure..
> + *
> + * Returns: a new character backend
> + */
> +CharDriverState *qemu_chr_new_noreplay(const char *label, const char *filename,
> + void (*init)(struct CharDriverState *s));
> +
> +/**
> * @qemu_chr_delete:
> *
> * Destroy a character backend and remove it from the list of
> @@ -341,6 +358,15 @@ int qemu_chr_be_can_write(CharDriverState *s);
> */
> void qemu_chr_be_write(CharDriverState *s, uint8_t *buf, int len);
>
> +/**
> + * @qemu_chr_be_write_impl:
> + *
> + * Implementation of back end writing. Used by replay module.
> + *
> + * @buf a buffer to receive data from the front end
> + * @len the number of bytes to receive from the front end
> + */
> +void qemu_chr_be_write_impl(CharDriverState *s, uint8_t *buf, int len);
>
> /**
> * @qemu_chr_be_event:
> diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h
> index e4108e8..d24d502 100644
> --- a/include/sysemu/replay.h
> +++ b/include/sysemu/replay.h
> @@ -114,4 +114,21 @@ void replay_input_event(QemuConsole *src, InputEvent *evt);
> /*! Adds input sync event to the queue */
> void replay_input_sync_event(void);
>
> +/* Character device */
> +
> +/*! Registers char driver to save it's events */
> +void replay_register_char_driver(struct CharDriverState *chr);
> +/*! Saves write to char device event to the log */
> +void replay_chr_be_write(struct CharDriverState *s, uint8_t *buf, int len);
> +/*! Writes char write return value to the replay log. */
> +void replay_char_write_event_save(int res, int offset);
> +/*! Reads char write return value from the replay log. */
> +void replay_char_write_event_load(int *res, int *offset);
> +/*! Reads information about read_all character event. */
> +int replay_char_read_all_load(uint8_t *buf);
> +/*! Writes character read_all error code into the replay log. */
> +void replay_char_read_all_save_error(int res);
> +/*! Writes character read_all execution result into the replay log. */
> +void replay_char_read_all_save_buf(uint8_t *buf, int offset);
> +
> #endif
> diff --git a/qemu-char.c b/qemu-char.c
> index e0147f3..b418307 100644
> --- a/qemu-char.c
> +++ b/qemu-char.c
> @@ -37,6 +37,7 @@
> #include "io/channel-socket.h"
> #include "io/channel-file.h"
> #include "io/channel-tls.h"
> +#include "sysemu/replay.h"
>
> #include <zlib.h>
>
> @@ -234,10 +235,46 @@ static void qemu_chr_fe_write_log(CharDriverState *s,
> }
> }
>
> +static int qemu_chr_fe_write_buffer(CharDriverState *s, const uint8_t *buf, int len, int *offset)
> +{
> + int res = 0;
> + *offset = 0;
> +
> + qemu_mutex_lock(&s->chr_write_lock);
> + while (*offset < len) {
> + do {
> + res = s->chr_write(s, buf + *offset, len - *offset);
> + if (res == -1 && errno == EAGAIN) {
> + g_usleep(100);
> + }
> + } while (res == -1 && errno == EAGAIN);
> +
> + if (res <= 0) {
> + break;
> + }
> +
> + *offset += res;
> + }
> + if (*offset > 0) {
> + qemu_chr_fe_write_log(s, buf, *offset);
> + }
> + qemu_mutex_unlock(&s->chr_write_lock);
> +
> + return res;
> +}
> +
> int qemu_chr_fe_write(CharDriverState *s, const uint8_t *buf, int len)
> {
> int ret;
>
> + if (s->replay && replay_mode == REPLAY_MODE_PLAY) {
> + int offset;
> + replay_char_write_event_load(&ret, &offset);
> + assert(offset <= len);
> + qemu_chr_fe_write_buffer(s, buf, offset, &offset);
> + return ret;
> + }
> +
> qemu_mutex_lock(&s->chr_write_lock);
> ret = s->chr_write(s, buf, len);
>
> @@ -246,34 +283,31 @@ int qemu_chr_fe_write(CharDriverState *s, const uint8_t *buf, int len)
> }
>
> qemu_mutex_unlock(&s->chr_write_lock);
> +
> + if (s->replay && replay_mode == REPLAY_MODE_RECORD) {
> + replay_char_write_event_save(ret, ret < 0 ? 0 : ret);
> + }
> +
> return ret;
> }
>
> int qemu_chr_fe_write_all(CharDriverState *s, const uint8_t *buf, int len)
> {
> - int offset = 0;
> - int res = 0;
> + int offset;
> + int res;
>
> - qemu_mutex_lock(&s->chr_write_lock);
> - while (offset < len) {
> - do {
> - res = s->chr_write(s, buf + offset, len - offset);
> - if (res == -1 && errno == EAGAIN) {
> - g_usleep(100);
> - }
> - } while (res == -1 && errno == EAGAIN);
> + if (s->replay && replay_mode == REPLAY_MODE_PLAY) {
> + replay_char_write_event_load(&res, &offset);
> + assert(offset <= len);
> + qemu_chr_fe_write_buffer(s, buf, offset, &offset);
> + return res;
> + }
>
> - if (res <= 0) {
> - break;
> - }
> + res = qemu_chr_fe_write_buffer(s, buf, len, &offset);
>
> - offset += res;
> + if (s->replay && replay_mode == REPLAY_MODE_RECORD) {
> + replay_char_write_event_save(res, offset);
> }
> - if (offset > 0) {
> - qemu_chr_fe_write_log(s, buf, offset);
> - }
> -
> - qemu_mutex_unlock(&s->chr_write_lock);
>
> if (res < 0) {
> return res;
> @@ -289,6 +323,10 @@ int qemu_chr_fe_read_all(CharDriverState *s, uint8_t *buf, int len)
> if (!s->chr_sync_read) {
> return 0;
> }
> +
> + if (s->replay && replay_mode == REPLAY_MODE_PLAY) {
> + return replay_char_read_all_load(buf);
> + }
>
> while (offset < len) {
> do {
> @@ -303,6 +341,9 @@ int qemu_chr_fe_read_all(CharDriverState *s, uint8_t *buf, int len)
> }
>
> if (res < 0) {
> + if (s->replay && replay_mode == REPLAY_MODE_RECORD) {
> + replay_char_read_all_save_error(res);
> + }
> return res;
> }
>
> @@ -313,14 +354,22 @@ int qemu_chr_fe_read_all(CharDriverState *s, uint8_t *buf, int len)
> }
> }
>
> + if (s->replay && replay_mode == REPLAY_MODE_RECORD) {
> + replay_char_read_all_save_buf(buf, offset);
> + }
> return offset;
> }
>
> int qemu_chr_fe_ioctl(CharDriverState *s, int cmd, void *arg)
> {
> - if (!s->chr_ioctl)
> - return -ENOTSUP;
> - return s->chr_ioctl(s, cmd, arg);
> + int res;
> + if (!s->chr_ioctl || s->replay) {
> + res = -ENOTSUP;
> + } else {
> + res = s->chr_ioctl(s, cmd, arg);
> + }
> +
> + return res;
> }
>
> int qemu_chr_be_can_write(CharDriverState *s)
> @@ -330,17 +379,35 @@ int qemu_chr_be_can_write(CharDriverState *s)
> return s->chr_can_read(s->handler_opaque);
> }
>
> -void qemu_chr_be_write(CharDriverState *s, uint8_t *buf, int len)
> +void qemu_chr_be_write_impl(CharDriverState *s, uint8_t *buf, int len)
> {
> if (s->chr_read) {
> s->chr_read(s->handler_opaque, buf, len);
> }
> }
>
> +void qemu_chr_be_write(CharDriverState *s, uint8_t *buf, int len)
> +{
> + if (s->replay) {
> + if (replay_mode == REPLAY_MODE_PLAY) {
> + return;
> + }
> + replay_chr_be_write(s, buf, len);
> + } else {
> + qemu_chr_be_write_impl(s, buf, len);
> + }
> +}
> +
> int qemu_chr_fe_get_msgfd(CharDriverState *s)
> {
> int fd;
> - return (qemu_chr_fe_get_msgfds(s, &fd, 1) == 1) ? fd : -1;
> + int res = (qemu_chr_fe_get_msgfds(s, &fd, 1) == 1) ? fd : -1;
> + if (s->replay) {
> + fprintf(stderr,
> + "Replay: get msgfd is not supported for serial devices yet\n");
> + exit(1);
> + }
> + return res;
> }
>
> int qemu_chr_fe_get_msgfds(CharDriverState *s, int *fds, int len)
> @@ -3855,7 +3922,8 @@ err:
> return NULL;
> }
>
> -CharDriverState *qemu_chr_new(const char *label, const char *filename, void (*init)(struct CharDriverState *s))
> +CharDriverState *qemu_chr_new_noreplay(const char *label, const char *filename,
> + void (*init)(struct CharDriverState *s))
> {
> const char *p;
> CharDriverState *chr;
> @@ -3881,6 +3949,21 @@ CharDriverState *qemu_chr_new(const char *label, const char *filename, void (*in
> return chr;
> }
>
> +CharDriverState *qemu_chr_new(const char *label, const char *filename, void (*init)(struct CharDriverState *s))
> +{
> + CharDriverState *chr;
> + chr = qemu_chr_new_noreplay(label, filename, init);
> + if (chr) {
> + chr->replay = replay_mode != REPLAY_MODE_NONE;
> + if (chr->replay && chr->chr_ioctl) {
> + fprintf(stderr,
> + "Replay: ioctl is not supported for serial devices yet\n");
> + }
> + replay_register_char_driver(chr);
> + }
> + return chr;
> +}
> +
> void qemu_chr_fe_set_echo(struct CharDriverState *chr, bool echo)
> {
> if (chr->chr_set_echo) {
> @@ -4475,6 +4558,11 @@ void qmp_chardev_remove(const char *id, Error **errp)
> error_setg(errp, "Chardev '%s' is busy", id);
> return;
> }
> + if (chr->replay) {
> + error_setg(errp,
> + "Chardev '%s' cannot be unplugged in record/replay mode", id);
> + return;
> + }
> qemu_chr_delete(chr);
> }
>
> diff --git a/replay/Makefile.objs b/replay/Makefile.objs
> index 232193a..70e5572 100644
> --- a/replay/Makefile.objs
> +++ b/replay/Makefile.objs
> @@ -3,3 +3,4 @@ common-obj-y += replay-internal.o
> common-obj-y += replay-events.o
> common-obj-y += replay-time.o
> common-obj-y += replay-input.o
> +common-obj-y += replay-char.o
> diff --git a/replay/replay-char.c b/replay/replay-char.c
> new file mode 100755
> index 0000000..bfbaf2e
> --- /dev/null
> +++ b/replay/replay-char.c
> @@ -0,0 +1,167 @@
> +/*
> + * replay-char.c
> + *
> + * Copyright (c) 2010-2016 Institute for System Programming
> + * of the Russian Academy of Sciences.
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
> + *
> + */
> +
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <string.h>
> +
> +#include "qemu/osdep.h"
> +#include "sysemu/replay.h"
> +#include "replay-internal.h"
> +#include "sysemu/sysemu.h"
> +#include "sysemu/char.h"
> +
> +/* Char drivers that generate qemu_chr_be_write events
> + that should be saved into the log. */
> +static CharDriverState **char_drivers;
> +static int drivers_count;
> +
> +/* Char event attributes. */
> +typedef struct CharEvent {
> + int id;
> + uint8_t *buf;
> + size_t len;
> +} CharEvent;
> +
> +static int find_char_driver(CharDriverState *chr)
> +{
> + int i = 0;
> + for ( ; i < drivers_count ; ++i) {
> + if (char_drivers[i] == chr) {
> + return i;
> + }
> + }
> + return -1;
> +}
> +
> +void replay_register_char_driver(CharDriverState *chr)
> +{
> + if (replay_mode == REPLAY_MODE_NONE) {
> + return;
> + }
> + char_drivers = g_realloc(char_drivers,
> + sizeof(*char_drivers) * (drivers_count + 1));
> + char_drivers[drivers_count++] = chr;
> +}
> +
> +void replay_chr_be_write(CharDriverState *s, uint8_t *buf, int len)
> +{
> + CharEvent *event = g_malloc0(sizeof(CharEvent));
> +
> + event->id = find_char_driver(s);
> + if (event->id < 0) {
> + fprintf(stderr, "Replay: cannot find char driver\n");
> + exit(1);
> + }
> + event->buf = g_malloc(len);
> + memcpy(event->buf, buf, len);
> + event->len = len;
> +
> + replay_add_event(REPLAY_ASYNC_EVENT_CHAR_READ, event, NULL, 0);
> +}
> +
> +void replay_event_char_read_run(void *opaque)
> +{
> + CharEvent *event = (CharEvent *)opaque;
> +
> + qemu_chr_be_write_impl(char_drivers[event->id], event->buf,
> + (int)event->len);
> +
> + g_free(event->buf);
> + g_free(event);
> +}
> +
> +void replay_event_char_read_save(void *opaque)
> +{
> + CharEvent *event = (CharEvent *)opaque;
> +
> + replay_put_byte(event->id);
> + replay_put_array(event->buf, event->len);
> +}
> +
> +void *replay_event_char_read_load(void)
> +{
> + CharEvent *event = g_malloc0(sizeof(CharEvent));
> +
> + event->id = replay_get_byte();
> + replay_get_array_alloc(&event->buf, &event->len);
> +
> + return event;
> +}
> +
> +void replay_char_write_event_save(int res, int offset)
> +{
> + replay_save_instructions();
> + replay_mutex_lock();
> + replay_put_event(EVENT_CHAR_WRITE);
> + replay_put_dword(res);
> + replay_put_dword(offset);
> + replay_mutex_unlock();
> +}
> +
> +void replay_char_write_event_load(int *res, int *offset)
> +{
> + replay_account_executed_instructions();
> + replay_mutex_lock();
> + if (replay_next_event_is(EVENT_CHAR_WRITE)) {
> + *res = replay_get_dword();
> + *offset = replay_get_dword();
> + replay_finish_event();
> + replay_mutex_unlock();
> + } else {
> + replay_mutex_unlock();
> + error_report("Missing character write event in the replay log");
> + exit(1);
> + }
> +}
> +
> +int replay_char_read_all_load(uint8_t *buf)
> +{
> + replay_mutex_lock();
> + if (replay_next_event_is(EVENT_CHAR_READ_ALL)) {
> + size_t size;
> + int res;
> + replay_get_array(buf, &size);
> + replay_finish_event();
> + replay_mutex_unlock();
> + res = (int)size;
> + assert(res >= 0);
> + return res;
> + } else if (replay_next_event_is(EVENT_CHAR_READ_ALL_ERROR)) {
> + int res = replay_get_dword();
> + replay_finish_event();
> + replay_mutex_unlock();
> + return res;
> + } else {
> + replay_mutex_unlock();
> + error_report("Missing character read all event in the replay log");
> + exit(1);
> + }
> +}
> +
> +void replay_char_read_all_save_error(int res)
> +{
> + assert(res < 0);
> + replay_save_instructions();
> + replay_mutex_lock();
> + replay_put_event(EVENT_CHAR_READ_ALL_ERROR);
> + replay_put_dword(res);
> + replay_mutex_unlock();
> +}
> +
> +void replay_char_read_all_save_buf(uint8_t *buf, int offset)
> +{
> + replay_save_instructions();
> + replay_mutex_lock();
> + replay_put_event(EVENT_CHAR_READ_ALL);
> + replay_put_array(buf, offset);
> + replay_mutex_unlock();
> +}
> diff --git a/replay/replay-events.c b/replay/replay-events.c
> index 2628109..ca940f7 100644
> --- a/replay/replay-events.c
> +++ b/replay/replay-events.c
> @@ -48,6 +48,9 @@ static void replay_run_event(Event *event)
> case REPLAY_ASYNC_EVENT_INPUT_SYNC:
> qemu_input_event_sync_impl();
> break;
> + case REPLAY_ASYNC_EVENT_CHAR_READ:
> + replay_event_char_read_run(event->opaque);
> + break;
> default:
> error_report("Replay: invalid async event ID (%d) in the queue",
> event->event_kind);
> @@ -102,9 +105,9 @@ void replay_clear_events(void)
> }
>
> /*! Adds specified async event to the queue */
> -static void replay_add_event(ReplayAsyncEventKind event_kind,
> - void *opaque,
> - void *opaque2, uint64_t id)
> +void replay_add_event(ReplayAsyncEventKind event_kind,
> + void *opaque,
> + void *opaque2, uint64_t id)
> {
> assert(event_kind < REPLAY_ASYNC_COUNT);
>
> @@ -168,6 +171,9 @@ static void replay_save_event(Event *event, int checkpoint)
> break;
> case REPLAY_ASYNC_EVENT_INPUT_SYNC:
> break;
> + case REPLAY_ASYNC_EVENT_CHAR_READ:
> + replay_event_char_read_save(event->opaque);
> + break;
> default:
> error_report("Unknown ID %d of replay event", read_event_kind);
> exit(1);
> @@ -221,6 +227,11 @@ static Event *replay_read_event(int checkpoint)
> event->event_kind = read_event_kind;
> event->opaque = 0;
> return event;
> + case REPLAY_ASYNC_EVENT_CHAR_READ:
> + event = g_malloc0(sizeof(Event));
> + event->event_kind = read_event_kind;
> + event->opaque = replay_event_char_read_load();
> + return event;
> default:
> error_report("Unknown ID %d of replay event", read_event_kind);
> exit(1);
> diff --git a/replay/replay-internal.h b/replay/replay-internal.h
> index 5438ebd..11f9a85 100644
> --- a/replay/replay-internal.h
> +++ b/replay/replay-internal.h
> @@ -24,6 +24,11 @@ enum ReplayEvents {
> EVENT_ASYNC,
> /* for shutdown request */
> EVENT_SHUTDOWN,
> + /* for character device write event */
> + EVENT_CHAR_WRITE,
> + /* for character device read all event */
> + EVENT_CHAR_READ_ALL,
> + EVENT_CHAR_READ_ALL_ERROR,
> /* for clock read/writes */
> /* some of greater codes are reserved for clocks */
> EVENT_CLOCK,
> @@ -43,6 +48,7 @@ enum ReplayAsyncEventKind {
> REPLAY_ASYNC_EVENT_BH,
> REPLAY_ASYNC_EVENT_INPUT,
> REPLAY_ASYNC_EVENT_INPUT_SYNC,
> + REPLAY_ASYNC_EVENT_CHAR_READ,
> REPLAY_ASYNC_COUNT
> };
>
> @@ -124,6 +130,9 @@ bool replay_has_events(void);
> void replay_save_events(int checkpoint);
> /*! Read events from the file into the input queue */
> void replay_read_events(int checkpoint);
> +/*! Adds specified async event to the queue */
> +void replay_add_event(ReplayAsyncEventKind event_kind, void *opaque,
> + void *opaque2, uint64_t id);
>
> /* Input events */
>
> @@ -136,4 +145,13 @@ void replay_add_input_event(struct InputEvent *event);
> /*! Adds input sync event to the queue */
> void replay_add_input_sync_event(void);
>
> +/* Character devices */
> +
> +/*! Called to run char device read event. */
> +void replay_event_char_read_run(void *opaque);
> +/*! Writes char read event to the file. */
> +void replay_event_char_read_save(void *opaque);
> +/*! Reads char event read from the file. */
> +void *replay_event_char_read_load(void);
> +
> #endif
> diff --git a/replay/replay.c b/replay/replay.c
> index f8739c2..fcfde4f 100644
> --- a/replay/replay.c
> +++ b/replay/replay.c
> @@ -20,7 +20,7 @@
>
> /* Current version of the replay mechanism.
> Increase it when file format changes. */
> -#define REPLAY_VERSION 0xe02002
> +#define REPLAY_VERSION 0xe02003
> /* Size of replay log header */
> #define HEADER_SIZE (sizeof(uint32_t) + sizeof(uint64_t))
>
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH v5 0/7] Deterministic replay extensions
2016-03-14 7:44 [Qemu-devel] [PATCH v5 0/7] Deterministic replay extensions Pavel Dovgalyuk
` (6 preceding siblings ...)
2016-03-14 7:45 ` [Qemu-devel] [PATCH v5 7/7] replay: introduce block devices record/replay Pavel Dovgalyuk
@ 2016-03-15 20:04 ` Igor R
2016-03-17 8:06 ` Pavel Dovgalyuk
2016-03-24 11:59 ` Kevin Wolf
8 siblings, 1 reply; 18+ messages in thread
From: Igor R @ 2016-03-15 20:04 UTC (permalink / raw)
To: Pavel Dovgalyuk, QEMU Developers
> This set of patches is related to the reverse execution and deterministic
> replay of qemu execution. It includes recording and replaying of serial devices
> and block devices operations.
>
> With these patches one can record and deterministically replay behavior
> of the system with connected disk drives and serial communication ports
> (e.g., telnet terminal).
>
> Patches for deterministic replay of the block devices intercept calls of
> bdrv coroutine functions at the top of block drivers stack.
> To record and replay block operations the drive must be configured
> as following:
> -drive file=disk.qcow,if=none,id=img-direct
> -drive driver=blkreplay,if=none,image=img-direct,id=img-blkreplay
> -device ide-hd,drive=img-blkreplay
Thanks for the great feature.
A couple of questions:
* Is it possible to enable/disable recording when QEMU is already
running? I.e. is it ok to call replay_configure() or replay_enable()
from the monitor? Would it be possible to replay such a log?
* Currently, when running QEMU with the above drive configuration
(even w/o icount), savevm command doesn't seem to work correctly, and
subsequent loavm crashes QEMU. Is it just a bug or this feature
doesn't support snapshots?
* The replaying is much slower than the original scenario. Is it
affected by icount shift? What shift values would allow "real time"
speed?
Thanks!
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH v5 0/7] Deterministic replay extensions
2016-03-15 20:04 ` [Qemu-devel] [PATCH v5 0/7] Deterministic replay extensions Igor R
@ 2016-03-17 8:06 ` Pavel Dovgalyuk
0 siblings, 0 replies; 18+ messages in thread
From: Pavel Dovgalyuk @ 2016-03-17 8:06 UTC (permalink / raw)
To: 'Igor R', 'Pavel Dovgalyuk',
'QEMU Developers'
> From: igor.rubinov@gmail.com [mailto:igor.rubinov@gmail.com] On Behalf Of Igor R
> > This set of patches is related to the reverse execution and deterministic
> > replay of qemu execution. It includes recording and replaying of serial devices
> > and block devices operations.
>
> Thanks for the great feature.
>
> A couple of questions:
> * Is it possible to enable/disable recording when QEMU is already
> running? I.e. is it ok to call replay_configure() or replay_enable()
> from the monitor? Would it be possible to replay such a log?
Our internal code base does not include this feature.
But we plan to implement this after submitting all already existing patches.
> * Currently, when running QEMU with the above drive configuration
> (even w/o icount), savevm command doesn't seem to work correctly, and
> subsequent loavm crashes QEMU. Is it just a bug or this feature
> doesn't support snapshots?
Supporting snapshots includes much more work in addition to correct interaction
with replay. Therefore this feature is not supported yet, but we will add it later.
> * The replaying is much slower than the original scenario. Is it
> affected by icount shift? What shift values would allow "real time"
> speed?
icount shows how many guest instructions correspond to one guest clock tick.
"Real speed" may differ from machine to machine.
However, replaying speed was not the subject of our investigations yet.
Recording speed is more important, because it may affect the behavior of the system.
Pavel Dovgalyuk
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH v5 1/7] replay: character devices
2016-03-14 7:44 ` [Qemu-devel] [PATCH v5 1/7] replay: character devices Pavel Dovgalyuk
2016-03-14 14:11 ` Paolo Bonzini
@ 2016-03-23 15:45 ` Kevin Wolf
2016-03-23 16:54 ` Paolo Bonzini
1 sibling, 1 reply; 18+ messages in thread
From: Kevin Wolf @ 2016-03-23 15:45 UTC (permalink / raw)
To: Pavel Dovgalyuk
Cc: edgar.iglesias, peter.maydell, igor.rubinov, mark.burton, real,
hines, qemu-devel, maria.klimushenkova, stefanha, pbonzini,
batuzovk, alex.bennee, fred.konrad
Am 14.03.2016 um 08:44 hat Pavel Dovgalyuk geschrieben:
> This patch implements record and replay of character devices.
> It records chardevs communication in replay mode. Recorded information
> include data read from backend and counter of bytes written
> from frontend to backend to preserve frontend internal state.
> If character device was configured through the command line in record mode,
> then in replay mode it should be also added to command line. Backend of
> the character device could be changed in replay mode.
> Replaying of devices that perform ioctl and get_msgfd operations is not
> supported.
> gdbstub which also acts as a backend is not recorded to allow controlling
> the replaying through gdb. Monitor backends are also not recorded.
>
> Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
This patch contains three lines with trailing whitespace. (Didn't
actually check anything but what the patch touches, but git show marked
it in red, so I couldn't not notice this.)
Kevin
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH v5 4/7] block: add flush callback
2016-03-14 7:44 ` [Qemu-devel] [PATCH v5 4/7] block: add flush callback Pavel Dovgalyuk
@ 2016-03-23 15:46 ` Kevin Wolf
0 siblings, 0 replies; 18+ messages in thread
From: Kevin Wolf @ 2016-03-23 15:46 UTC (permalink / raw)
To: Pavel Dovgalyuk
Cc: edgar.iglesias, peter.maydell, igor.rubinov, mark.burton, real,
hines, qemu-devel, maria.klimushenkova, stefanha, pbonzini,
batuzovk, alex.bennee, fred.konrad
Am 14.03.2016 um 08:44 hat Pavel Dovgalyuk geschrieben:
> This patch adds callback for flush request. This callback is responsible
> for flushing whole block devices stack. bdrv_flush function does not
> proceed to underlying devices. It should be performed by this callback
> function, if needed.
>
> Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH v5 7/7] replay: introduce block devices record/replay
2016-03-14 7:45 ` [Qemu-devel] [PATCH v5 7/7] replay: introduce block devices record/replay Pavel Dovgalyuk
@ 2016-03-23 15:52 ` Kevin Wolf
0 siblings, 0 replies; 18+ messages in thread
From: Kevin Wolf @ 2016-03-23 15:52 UTC (permalink / raw)
To: Pavel Dovgalyuk
Cc: edgar.iglesias, peter.maydell, igor.rubinov, mark.burton, real,
hines, qemu-devel, maria.klimushenkova, stefanha, pbonzini,
batuzovk, alex.bennee, fred.konrad
Am 14.03.2016 um 08:45 hat Pavel Dovgalyuk geschrieben:
> This patch introduces block driver that implement recording
> and replaying of block devices' operations.
> All block completion operations are added to the queue.
> Queue is flushed at checkpoints and information about processed requests
> is recorded to the log. In replay phase the queue is matched with
> events read from the log. Therefore block devices requests are processed
> deterministically.
>
> Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
Acked-by: Kevin Wolf <kwolf@redhat.com>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH v5 1/7] replay: character devices
2016-03-23 15:45 ` Kevin Wolf
@ 2016-03-23 16:54 ` Paolo Bonzini
0 siblings, 0 replies; 18+ messages in thread
From: Paolo Bonzini @ 2016-03-23 16:54 UTC (permalink / raw)
To: Kevin Wolf, Pavel Dovgalyuk
Cc: edgar.iglesias, peter.maydell, igor.rubinov, mark.burton, real,
hines, qemu-devel, maria.klimushenkova, stefanha, batuzovk,
alex.bennee, fred.konrad
On 23/03/2016 16:45, Kevin Wolf wrote:
> Am 14.03.2016 um 08:44 hat Pavel Dovgalyuk geschrieben:
>> This patch implements record and replay of character devices.
>> It records chardevs communication in replay mode. Recorded information
>> include data read from backend and counter of bytes written
>> from frontend to backend to preserve frontend internal state.
>> If character device was configured through the command line in record mode,
>> then in replay mode it should be also added to command line. Backend of
>> the character device could be changed in replay mode.
>> Replaying of devices that perform ioctl and get_msgfd operations is not
>> supported.
>> gdbstub which also acts as a backend is not recorded to allow controlling
>> the replaying through gdb. Monitor backends are also not recorded.
>>
>> Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
>
> This patch contains three lines with trailing whitespace. (Didn't
> actually check anything but what the patch touches, but git show marked
> it in red, so I couldn't not notice this.)
It's merged anyway now. :)
Paolo
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH v5 6/7] replay: fix error message
2016-03-14 7:45 ` [Qemu-devel] [PATCH v5 6/7] replay: fix error message Pavel Dovgalyuk
@ 2016-03-24 11:56 ` Kevin Wolf
0 siblings, 0 replies; 18+ messages in thread
From: Kevin Wolf @ 2016-03-24 11:56 UTC (permalink / raw)
To: Pavel Dovgalyuk
Cc: edgar.iglesias, peter.maydell, igor.rubinov, mark.burton, real,
hines, qemu-devel, maria.klimushenkova, stefanha, pbonzini,
batuzovk, alex.bennee, fred.konrad
Am 14.03.2016 um 08:45 hat Pavel Dovgalyuk geschrieben:
> This patch fixes error message in saving loop of the asynchronous events queue.
>
> Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
> ---
> replay/replay-events.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/replay/replay-events.c b/replay/replay-events.c
> index 4aa8034..b6b8a64 100644
> --- a/replay/replay-events.c
> +++ b/replay/replay-events.c
> @@ -175,7 +175,7 @@ static void replay_save_event(Event *event, int checkpoint)
> replay_event_char_read_save(event->opaque);
> break;
> default:
> - error_report("Unknown ID %d of replay event", read_event_kind);
> + error_report("Unknown ID %d of replay event", event->id);
replay/replay-events.c: In function 'replay_save_event':
replay/replay-events.c:178:13: error: format '%d' expects argument of type 'int', but argument 2 has type 'uint64_t' [-Werror=format=]
Fixing this into %" PRId64 ".
Kevin
> exit(1);
> }
> }
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH v5 0/7] Deterministic replay extensions
2016-03-14 7:44 [Qemu-devel] [PATCH v5 0/7] Deterministic replay extensions Pavel Dovgalyuk
` (7 preceding siblings ...)
2016-03-15 20:04 ` [Qemu-devel] [PATCH v5 0/7] Deterministic replay extensions Igor R
@ 2016-03-24 11:59 ` Kevin Wolf
2016-03-24 19:24 ` Pavel Dovgalyuk
8 siblings, 1 reply; 18+ messages in thread
From: Kevin Wolf @ 2016-03-24 11:59 UTC (permalink / raw)
To: Pavel Dovgalyuk
Cc: edgar.iglesias, peter.maydell, igor.rubinov, mark.burton, real,
hines, qemu-devel, maria.klimushenkova, stefanha, pbonzini,
batuzovk, alex.bennee, fred.konrad
Am 14.03.2016 um 08:44 hat Pavel Dovgalyuk geschrieben:
> This set of patches is related to the reverse execution and deterministic
> replay of qemu execution. It includes recording and replaying of serial devices
> and block devices operations.
>
> With these patches one can record and deterministically replay behavior
> of the system with connected disk drives and serial communication ports
> (e.g., telnet terminal).
>
> Patches for deterministic replay of the block devices intercept calls of
> bdrv coroutine functions at the top of block drivers stack.
> To record and replay block operations the drive must be configured
> as following:
> -drive file=disk.qcow,if=none,id=img-direct
> -drive driver=blkreplay,if=none,image=img-direct,id=img-blkreplay
> -device ide-hd,drive=img-blkreplay
>
> blkreplay driver should be inserted between disk image and virtual driver
> controller. Therefore all disk requests may be recorded and replayed.
As Paolo already merged and modified the first three patches, and I
don't feel like having another version and there seems to be no better
maintainer, I fixed and rebased onto the modified part the remaining
four patches and put them into my block tree.
Kevin
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH v5 0/7] Deterministic replay extensions
2016-03-24 11:59 ` Kevin Wolf
@ 2016-03-24 19:24 ` Pavel Dovgalyuk
0 siblings, 0 replies; 18+ messages in thread
From: Pavel Dovgalyuk @ 2016-03-24 19:24 UTC (permalink / raw)
To: Kevin Wolf
Cc: edgar.iglesias, peter.maydell, igor.rubinov, mark.burton, real,
hines, qemu-devel, maria.klimushenkova, stefanha, pbonzini,
batuzovk, alex.bennee, fred.konrad
[-- Attachment #1: Type: text/plain, Size: 1459 bytes --]
Thank you!
Sent using CloudMagic Email [https://cloudmagic.com/k/d/mailapp?ct=ta&cv=7.3.5&pv=5.1.1&source=email_footer_2] On чт, Мар 24, 2016 at 2:59 PM, Kevin Wolf < kwolf@redhat.com [kwolf@redhat.com] > wrote:
Am 14.03.2016 um 08:44 hat Pavel Dovgalyuk geschrieben:
> This set of patches is related to the reverse execution and deterministic
> replay of qemu execution. It includes recording and replaying of serial devices
> and block devices operations.
>
> With these patches one can record and deterministically replay behavior
> of the system with connected disk drives and serial communication ports
> (e.g., telnet terminal).
>
> Patches for deterministic replay of the block devices intercept calls of
> bdrv coroutine functions at the top of block drivers stack.
> To record and replay block operations the drive must be configured
> as following:
> -drive file=disk.qcow,if=none,id=img-direct
> -drive driver=blkreplay,if=none,image=img-direct,id=img-blkreplay
> -device ide-hd,drive=img-blkreplay
>
> blkreplay driver should be inserted between disk image and virtual driver
> controller. Therefore all disk requests may be recorded and replayed.
As Paolo already merged and modified the first three patches, and I
don't feel like having another version and there seems to be no better
maintainer, I fixed and rebased onto the modified part the remaining
four patches and put them into my block tree.
Kevin
[-- Attachment #2: Type: text/html, Size: 1963 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2016-03-24 19:24 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-14 7:44 [Qemu-devel] [PATCH v5 0/7] Deterministic replay extensions Pavel Dovgalyuk
2016-03-14 7:44 ` [Qemu-devel] [PATCH v5 1/7] replay: character devices Pavel Dovgalyuk
2016-03-14 14:11 ` Paolo Bonzini
2016-03-23 15:45 ` Kevin Wolf
2016-03-23 16:54 ` Paolo Bonzini
2016-03-14 7:44 ` [Qemu-devel] [PATCH v5 2/7] icount: remove obsolete warp call Pavel Dovgalyuk
2016-03-14 7:44 ` [Qemu-devel] [PATCH v5 3/7] icount: decouple warp calls Pavel Dovgalyuk
2016-03-14 7:44 ` [Qemu-devel] [PATCH v5 4/7] block: add flush callback Pavel Dovgalyuk
2016-03-23 15:46 ` Kevin Wolf
2016-03-14 7:44 ` [Qemu-devel] [PATCH v5 5/7] replay: bh scheduling fix Pavel Dovgalyuk
2016-03-14 7:45 ` [Qemu-devel] [PATCH v5 6/7] replay: fix error message Pavel Dovgalyuk
2016-03-24 11:56 ` Kevin Wolf
2016-03-14 7:45 ` [Qemu-devel] [PATCH v5 7/7] replay: introduce block devices record/replay Pavel Dovgalyuk
2016-03-23 15:52 ` Kevin Wolf
2016-03-15 20:04 ` [Qemu-devel] [PATCH v5 0/7] Deterministic replay extensions Igor R
2016-03-17 8:06 ` Pavel Dovgalyuk
2016-03-24 11:59 ` Kevin Wolf
2016-03-24 19:24 ` Pavel Dovgalyuk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).