Browse Source
this fixes non-TCG builds broken recently by replay reverse debugging. Stub the needed functions in stub/, splitting roughly between functions needed only by system emulation, by system emulation and tools, and by everyone. This includes duplicating some code in replay/, and puts the logic for non-replay related events in the replay/ module (+ the stubs), so this should be revisited in the future. Surprisingly, only _one_ qtest was affected by this, ide-test.c, which resulted in a buzz as the bh events were never delivered, and the bh never executed. Many other subsystems _should_ have been affected. This fixes the immediate issue, however a better way to group replay functionality to TCG-only code could be developed in the long term. Signed-off-by: Claudio Fontana <cfontana@suse.de> Message-Id: <20201013192123.22632-4-cfontana@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>remotes/github/master
committed by
Paolo Bonzini
10 changed files with 191 additions and 97 deletions
@ -0,0 +1,96 @@ |
|||
#include "qemu/osdep.h" |
|||
#include "sysemu/replay.h" |
|||
#include "ui/input.h" |
|||
|
|||
void replay_input_event(QemuConsole *src, InputEvent *evt) |
|||
{ |
|||
qemu_input_event_send_impl(src, evt); |
|||
} |
|||
|
|||
void replay_input_sync_event(void) |
|||
{ |
|||
qemu_input_event_sync_impl(); |
|||
} |
|||
|
|||
void replay_add_blocker(Error *reason) |
|||
{ |
|||
} |
|||
void replay_audio_in(size_t *recorded, void *samples, size_t *wpos, size_t size) |
|||
{ |
|||
} |
|||
void replay_audio_out(size_t *played) |
|||
{ |
|||
} |
|||
void replay_breakpoint(void) |
|||
{ |
|||
} |
|||
bool replay_can_snapshot(void) |
|||
{ |
|||
return true; |
|||
} |
|||
void replay_configure(struct QemuOpts *opts) |
|||
{ |
|||
} |
|||
void replay_flush_events(void) |
|||
{ |
|||
} |
|||
void replay_gdb_attached(void) |
|||
{ |
|||
} |
|||
bool replay_running_debug(void) |
|||
{ |
|||
return false; |
|||
} |
|||
void replay_shutdown_request(ShutdownCause cause) |
|||
{ |
|||
} |
|||
void replay_start(void) |
|||
{ |
|||
} |
|||
void replay_vmstate_init(void) |
|||
{ |
|||
} |
|||
|
|||
#include "monitor/monitor.h" |
|||
#include "monitor/hmp.h" |
|||
#include "qapi/qapi-commands-replay.h" |
|||
#include "qapi/error.h" |
|||
#include "qemu/error-report.h" |
|||
|
|||
void hmp_info_replay(Monitor *mon, const QDict *qdict) |
|||
{ |
|||
error_report("replay support not available"); |
|||
} |
|||
void hmp_replay_break(Monitor *mon, const QDict *qdict) |
|||
{ |
|||
error_report("replay support not available"); |
|||
} |
|||
void hmp_replay_delete_break(Monitor *mon, const QDict *qdict) |
|||
{ |
|||
error_report("replay support not available"); |
|||
} |
|||
void hmp_replay_seek(Monitor *mon, const QDict *qdict) |
|||
{ |
|||
error_report("replay support not available"); |
|||
} |
|||
ReplayInfo *qmp_query_replay(Error **errp) |
|||
{ |
|||
error_set(errp, ERROR_CLASS_COMMAND_NOT_FOUND, |
|||
"replay support not available"); |
|||
return NULL; |
|||
} |
|||
void qmp_replay_break(int64_t icount, Error **errp) |
|||
{ |
|||
error_set(errp, ERROR_CLASS_COMMAND_NOT_FOUND, |
|||
"replay support not available"); |
|||
} |
|||
void qmp_replay_delete_break(Error **errp) |
|||
{ |
|||
error_set(errp, ERROR_CLASS_COMMAND_NOT_FOUND, |
|||
"replay support not available"); |
|||
} |
|||
void qmp_replay_seek(int64_t icount, Error **errp) |
|||
{ |
|||
error_set(errp, ERROR_CLASS_COMMAND_NOT_FOUND, |
|||
"replay support not available"); |
|||
} |
|||
@ -0,0 +1,83 @@ |
|||
#include "qemu/osdep.h" |
|||
#include "sysemu/replay.h" |
|||
#include "block/aio.h" |
|||
|
|||
bool replay_events_enabled(void) |
|||
{ |
|||
return false; |
|||
} |
|||
|
|||
int64_t replay_save_clock(unsigned int kind, int64_t clock, int64_t raw_icount) |
|||
{ |
|||
abort(); |
|||
return 0; |
|||
} |
|||
|
|||
int64_t replay_read_clock(unsigned int kind) |
|||
{ |
|||
abort(); |
|||
return 0; |
|||
} |
|||
|
|||
uint64_t replay_get_current_icount(void) |
|||
{ |
|||
return 0; |
|||
} |
|||
|
|||
void replay_bh_schedule_event(QEMUBH *bh) |
|||
{ |
|||
qemu_bh_schedule(bh); |
|||
} |
|||
|
|||
void replay_bh_schedule_oneshot_event(AioContext *ctx, |
|||
QEMUBHFunc *cb, void *opaque) |
|||
{ |
|||
aio_bh_schedule_oneshot(ctx, cb, opaque); |
|||
} |
|||
|
|||
bool replay_checkpoint(ReplayCheckpoint checkpoint) |
|||
{ |
|||
return true; |
|||
} |
|||
|
|||
void replay_mutex_lock(void) |
|||
{ |
|||
} |
|||
|
|||
void replay_mutex_unlock(void) |
|||
{ |
|||
} |
|||
|
|||
void replay_register_char_driver(Chardev *chr) |
|||
{ |
|||
} |
|||
|
|||
void replay_chr_be_write(Chardev *s, uint8_t *buf, int len) |
|||
{ |
|||
abort(); |
|||
} |
|||
|
|||
void replay_char_write_event_save(int res, int offset) |
|||
{ |
|||
abort(); |
|||
} |
|||
|
|||
void replay_char_write_event_load(int *res, int *offset) |
|||
{ |
|||
abort(); |
|||
} |
|||
|
|||
int replay_char_read_all_load(uint8_t *buf) |
|||
{ |
|||
abort(); |
|||
} |
|||
|
|||
void replay_char_read_all_save_error(int res) |
|||
{ |
|||
abort(); |
|||
} |
|||
|
|||
void replay_char_read_all_save_buf(uint8_t *buf, int offset) |
|||
{ |
|||
abort(); |
|||
} |
|||
@ -1,9 +0,0 @@ |
|||
#include "qemu/osdep.h" |
|||
#include "sysemu/replay.h" |
|||
#include "sysemu/sysemu.h" |
|||
|
|||
void replay_bh_schedule_oneshot_event(AioContext *ctx, |
|||
QEMUBHFunc *cb, void *opaque) |
|||
{ |
|||
aio_bh_schedule_oneshot(ctx, cb, opaque); |
|||
} |
|||
Loading…
Reference in new issue