From b551ad1ad2a2cfecf2f0d33b65e0c57a08140646 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Tue, 14 Feb 2012 11:13:49 +0100 Subject: [PATCH 24/99] tools: Use real async.c instead of stubs RH-Author: Kevin Wolf Message-id: <1329218101-24213-25-git-send-email-kwolf@redhat.com> Patchwork-id: 37215 O-Subject: [RHEL-6.3 qemu-kvm PATCH v2 24/96] tools: Use real async.c instead of stubs Bugzilla: 783950 RH-Acked-by: Paolo Bonzini RH-Acked-by: Marcelo Tosatti RH-Acked-by: Laszlo Ersek Bugzilla: 783950 It's wrong to call BHs directly, even in tools. The only operations that schedule BHs are called in a loop that (indirectly) contains a call to qemu_bh_poll anyway, so we're not losing the scheduled BHs: Tools either use synchronous functions, which are guaranteed to have completed (including any BHs) when they return; or if they use asynchronous functions, they need to call qemu_aio_wait() or similar functions already today. Signed-off-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi (cherry picked from commit 4e59b545868a5ee5f59b346337f0c44209929334) Conflicts: Makefile.objs qemu-tool.c Signed-off-by: Kevin Wolf --- Makefile.objs | 2 +- Makefile.target | 2 +- qemu-tool.c | 47 ++++------------------------------------------- 3 files changed, 6 insertions(+), 45 deletions(-) Signed-off-by: Michal Novotny --- Makefile.objs | 2 +- Makefile.target | 2 +- qemu-tool.c | 47 ++++------------------------------------------- 3 files changed, 6 insertions(+), 45 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index 5fcfc72..f05a23a 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -7,7 +7,7 @@ qobject-obj-y += qerror.o ####################################################################### # block-obj-y is code used by both qemu system emulation and qemu-img -block-obj-y = cutils.o cache-utils.o qemu-malloc.o qemu-option.o module.o +block-obj-y = cutils.o cache-utils.o qemu-malloc.o qemu-option.o module.o async.o block-obj-y += nbd.o block.o aio.o aes.o osdep.o qemu-config.o qemu-progress.o block-obj-$(CONFIG_POSIX) += posix-aio-compat.o block-obj-$(CONFIG_LINUX_AIO) += linux-aio.o diff --git a/Makefile.target b/Makefile.target index 50996f5..939334c 100644 --- a/Makefile.target +++ b/Makefile.target @@ -201,7 +201,7 @@ endif #CONFIG_BSD_USER # System emulator target ifdef CONFIG_SOFTMMU -obj-y = vl.o async.o monitor.o pci.o pci_host.o pcie_host.o machine.o gdbstub.o balloon.o +obj-y = vl.o monitor.o pci.o pci_host.o pcie_host.o machine.o gdbstub.o balloon.o # virtio has to be here due to weird dependency between PCI and virtio-net. # need to fix this properly obj-y += virtio-blk.o virtio-balloon.o virtio-net.o virtio-pci.o virtio-serial-bus.o diff --git a/qemu-tool.c b/qemu-tool.c index 4516675..e205cb7 100644 --- a/qemu-tool.c +++ b/qemu-tool.c @@ -56,19 +56,6 @@ void monitor_print_filename(Monitor *mon, const char *filename) { } -void async_context_push(void) -{ -} - -void async_context_pop(void) -{ -} - -int get_async_context_id(void) -{ - return 0; -} - void monitor_protocol_event(MonitorEvent event, QObject *data) { } @@ -91,36 +78,6 @@ void qemu_mod_timer(QEMUTimer *ts, int64_t expire_time) { } -QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque) -{ - QEMUBH *bh; - - bh = qemu_malloc(sizeof(*bh)); - bh->cb = cb; - bh->opaque = opaque; - - return bh; -} - -int qemu_bh_poll(void) -{ - return 0; -} - -void qemu_bh_schedule(QEMUBH *bh) -{ - bh->cb(bh->opaque); -} - -void qemu_bh_cancel(QEMUBH *bh) -{ -} - -void qemu_bh_delete(QEMUBH *bh) -{ - qemu_free(bh); -} - int qemu_set_fd_handler2(int fd, IOCanRWHandler *fd_read_poll, IOHandler *fd_read, @@ -145,3 +102,7 @@ int64_t get_clock(void) { return 0; } + +void qemu_notify_event(void) +{ +} -- 1.7.7.5