qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jagannathan Raman <jag.raman@oracle.com>
To: qemu-devel@nongnu.org
Cc: elena.ufimtseva@oracle.com, fam@euphon.net,
	john.g.johnson@oracle.com, kraxel@redhat.com,
	jag.raman@oracle.com, quintela@redhat.com, mst@redhat.com,
	armbru@redhat.com, kanth.ghatraju@oracle.com, thuth@redhat.com,
	ehabkost@redhat.com, konrad.wilk@oracle.com, dgilbert@redhat.com,
	liran.alon@oracle.com, stefanha@redhat.com, rth@twiddle.net,
	kwolf@redhat.com, berrange@redhat.com, mreitz@redhat.com,
	ross.lagerwall@citrix.com, marcandre.lureau@gmail.com,
	pbonzini@redhat.com
Subject: [Qemu-devel] [RFC v3 PATCH 04/45] multi-process: Add stub functions to facilate build of multi-process
Date: Tue,  3 Sep 2019 16:37:30 -0400	[thread overview]
Message-ID: <29bbfa028904a603b708801897872fa250a6bbaa.1567534653.git.jag.raman@oracle.com> (raw)
In-Reply-To: <cover.1567534653.git.jag.raman@oracle.com>
In-Reply-To: <cover.1567534653.git.jag.raman@oracle.com>

Add stub functions that are needed during compile time but not in
runtime.

Signed-off-by: John G Johnson <john.g.johnson@oracle.com>
Signed-off-by: Jagannathan Raman <jag.raman@oracle.com>
Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
---
 accel/stubs/kvm-stub.c    |  5 +++
 accel/stubs/tcg-stub.c    | 85 +++++++++++++++++++++++++++++++++++++++++++++++
 stubs/machine-init-done.c |  4 +++
 stubs/monitor.c           | 33 ++++++++++++++++++
 stubs/net-stub.c          | 31 +++++++++++++++++
 stubs/replay.c            | 14 ++++++++
 stubs/vl-stub.c           | 77 ++++++++++++++++++++++++++++++++++++++++++
 stubs/vmstate.c           | 20 +++++++++++
 stubs/xen-mapcache.c      | 22 ++++++++++++
 9 files changed, 291 insertions(+)
 create mode 100644 stubs/net-stub.c
 create mode 100644 stubs/vl-stub.c
 create mode 100644 stubs/xen-mapcache.c

diff --git a/accel/stubs/kvm-stub.c b/accel/stubs/kvm-stub.c
index 6feb66e..f129dfb 100644
--- a/accel/stubs/kvm-stub.c
+++ b/accel/stubs/kvm-stub.c
@@ -31,6 +31,7 @@ bool kvm_allowed;
 bool kvm_readonly_mem_allowed;
 bool kvm_ioeventfd_any_length_allowed;
 bool kvm_msi_use_devid;
+bool kvm_halt_in_kernel_allowed;
 
 int kvm_destroy_vcpu(CPUState *cpu)
 {
@@ -58,6 +59,10 @@ void kvm_cpu_synchronize_post_init(CPUState *cpu)
 {
 }
 
+void kvm_cpu_synchronize_pre_loadvm(CPUState *cpu)
+{
+}
+
 int kvm_cpu_exec(CPUState *cpu)
 {
     abort();
diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c
index 76ae461..52722c7 100644
--- a/accel/stubs/tcg-stub.c
+++ b/accel/stubs/tcg-stub.c
@@ -16,11 +16,96 @@
 #include "tcg/tcg.h"
 #include "exec/cpu-common.h"
 #include "exec/exec-all.h"
+#include "translate-all.h"
+#include "exec/ram_addr.h"
+
+bool parallel_cpus;
 
 void tb_flush(CPUState *cpu)
 {
 }
 
+void tb_check_watchpoint(CPUState *cpu)
+{
+}
+
+void tb_invalidate_phys_range(ram_addr_t start, ram_addr_t end)
+{
+}
+
+void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end,
+                                   int is_cpu_write_access)
+{
+}
+
+void tb_invalidate_phys_page_fast(struct page_collection *pages,
+                                  tb_page_addr_t start, int len)
+{
+}
+
+void tlb_init(CPUState *cpu)
+{
+}
+
 void tlb_set_dirty(CPUState *cpu, target_ulong vaddr)
 {
 }
+
+void tlb_flush(CPUState *cpu)
+{
+}
+
+void tlb_flush_page(CPUState *cpu, target_ulong addr)
+{
+}
+
+void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length)
+{
+}
+
+void tcg_region_init(void)
+{
+}
+
+void tcg_register_thread(void)
+{
+}
+
+void tcg_flush_softmmu_tlb(CPUState *cs)
+{
+}
+
+void cpu_loop_exit_noexc(CPUState *cpu)
+{
+    cpu->exception_index = -1;
+    cpu_loop_exit(cpu);
+}
+
+void cpu_loop_exit(CPUState *cpu)
+{
+    cpu->can_do_io = 1;
+    siglongjmp(cpu->jmp_env, 1);
+}
+
+void cpu_reloading_memory_map(void)
+{
+}
+
+int cpu_exec(CPUState *cpu)
+{
+    return 0;
+}
+
+void cpu_exec_step_atomic(CPUState *cpu)
+{
+}
+
+struct page_collection *
+page_collection_lock(tb_page_addr_t start, tb_page_addr_t end)
+{
+    return NULL;
+}
+
+void page_collection_unlock(struct page_collection *set)
+{
+}
diff --git a/stubs/machine-init-done.c b/stubs/machine-init-done.c
index cd8e813..3deabc9 100644
--- a/stubs/machine-init-done.c
+++ b/stubs/machine-init-done.c
@@ -6,3 +6,7 @@ bool machine_init_done = true;
 void qemu_add_machine_init_done_notifier(Notifier *notify)
 {
 }
+
+void qemu_remove_machine_init_done_notifier(Notifier *notify)
+{
+}
diff --git a/stubs/monitor.c b/stubs/monitor.c
index c3e9a2e..75dafce 100644
--- a/stubs/monitor.c
+++ b/stubs/monitor.c
@@ -2,6 +2,12 @@
 #include "qapi/error.h"
 #include "qapi/qapi-emit-events.h"
 #include "monitor/monitor.h"
+#include "qapi/qapi-types-misc.h"
+#include "qapi/qapi-commands-misc.h"
+#include "qapi/qapi-types-qom.h"
+#include "qapi/qapi-commands-qdev.h"
+#include "hw/qdev-core.h"
+#include "sysemu/sysemu.h"
 
 __thread Monitor *cur_mon;
 
@@ -27,3 +33,30 @@ void monitor_init_hmp(Chardev *chr, bool use_readline)
 void qapi_event_emit(QAPIEvent event, QDict *qdict)
 {
 }
+
+int monitor_get_cpu_index(void)
+{
+    return -ENOSYS;
+}
+int monitor_printf(Monitor *mon, const char *fmt, ...)
+{
+    return -ENOSYS;
+}
+
+bool monitor_cur_is_qmp(void)
+{
+    return false;
+}
+
+ObjectPropertyInfoList *qmp_device_list_properties(const char *typename,
+                                                   Error **errp)
+{
+    return NULL;
+}
+
+VMChangeStateEntry *qdev_add_vm_change_state_handler(DeviceState *dev,
+                                                     VMChangeStateHandler *cb,
+                                                     void *opaque)
+{
+    return NULL;
+}
diff --git a/stubs/net-stub.c b/stubs/net-stub.c
new file mode 100644
index 0000000..cb2274b
--- /dev/null
+++ b/stubs/net-stub.c
@@ -0,0 +1,31 @@
+#include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "net/net.h"
+
+int qemu_find_net_clients_except(const char *id, NetClientState **ncs,
+                                 NetClientDriver type, int max)
+{
+    return -ENOSYS;
+}
+
+NetClientState *net_hub_port_find(int hub_id)
+{
+    return NULL;
+}
+
+int net_hub_id_for_client(NetClientState *nc, int *id)
+{
+    return -ENOSYS;
+}
+
+int qemu_show_nic_models(const char *arg, const char *const *models)
+{
+    return -ENOSYS;
+}
+
+int qemu_find_nic_model(NICInfo *nd, const char * const *models,
+                        const char *default_model)
+{
+    return -ENOSYS;
+}
+
diff --git a/stubs/replay.c b/stubs/replay.c
index 4ac6078..38fd1d3 100644
--- a/stubs/replay.c
+++ b/stubs/replay.c
@@ -80,3 +80,17 @@ void replay_mutex_lock(void)
 void replay_mutex_unlock(void)
 {
 }
+
+bool replay_has_checkpoint(void)
+{
+    return false;
+}
+
+int replay_get_instructions(void)
+{
+    return 0;
+}
+
+void replay_account_executed_instructions(void)
+{
+}
diff --git a/stubs/vl-stub.c b/stubs/vl-stub.c
new file mode 100644
index 0000000..89db36c
--- /dev/null
+++ b/stubs/vl-stub.c
@@ -0,0 +1,77 @@
+#include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "qemu/uuid.h"
+#include "sysemu/sysemu.h"
+#include "exec/cpu-common.h"
+#include "exec/gdbstub.h"
+#include "sysemu/replay.h"
+#include "disas/disas.h"
+
+bool tcg_allowed;
+bool xen_allowed;
+bool boot_strict;
+
+int mem_prealloc;
+int smp_cpus;
+int vga_interface_type = VGA_NONE;
+int smp_cores = 1;
+int smp_threads = 1;
+int icount_align_option;
+int boot_menu;
+
+unsigned int max_cpus;
+const uint32_t arch_type;
+const char *mem_path;
+uint8_t qemu_extra_params_fw[2];
+uint8_t *boot_splash_filedata;
+size_t boot_splash_filedata_size;
+struct syminfo *syminfos;
+
+ram_addr_t ram_size;
+MachineState *current_machine;
+QemuUUID qemu_uuid;
+
+int runstate_is_running(void)
+{
+    return 0;
+}
+
+void runstate_set(RunState new_state)
+{
+}
+
+void vm_state_notify(int running, RunState state)
+{
+}
+
+bool qemu_vmstop_requested(RunState *r)
+{
+    return false;
+}
+
+void qemu_system_debug_request(void)
+{
+}
+
+char *qemu_find_file(int type, const char *name)
+{
+    return NULL;
+}
+
+void gdb_set_stop_cpu(CPUState *cpu)
+{
+}
+
+void replay_enable_events(void)
+{
+}
+
+void replay_disable_events(void)
+{
+}
+
+#ifdef TARGET_I386
+void x86_cpu_list(void)
+{
+}
+#endif
diff --git a/stubs/vmstate.c b/stubs/vmstate.c
index e1e89b8..a9824bc 100644
--- a/stubs/vmstate.c
+++ b/stubs/vmstate.c
@@ -1,8 +1,11 @@
 #include "qemu/osdep.h"
 #include "migration/vmstate.h"
+#include "migration/misc.h"
 
 const VMStateDescription vmstate_dummy = {};
 
+const VMStateInfo vmstate_info_timer;
+
 int vmstate_register_with_alias_id(DeviceState *dev,
                                    int instance_id,
                                    const VMStateDescription *vmsd,
@@ -23,3 +26,20 @@ bool vmstate_check_only_migratable(const VMStateDescription *vmsd)
 {
     return true;
 }
+
+void vmstate_register_ram(MemoryRegion *mr, DeviceState *dev)
+{
+}
+
+void vmstate_unregister_ram(MemoryRegion *mr, DeviceState *dev)
+{
+}
+
+void vmstate_register_ram_global(MemoryRegion *mr)
+{
+}
+
+bool migration_is_idle(void)
+{
+    return true;
+}
diff --git a/stubs/xen-mapcache.c b/stubs/xen-mapcache.c
new file mode 100644
index 0000000..af5c031
--- /dev/null
+++ b/stubs/xen-mapcache.c
@@ -0,0 +1,22 @@
+#include "qemu/osdep.h"
+#include "exec/hwaddr.h"
+#include "exec/cpu-common.h"
+#include "sysemu/xen-mapcache.h"
+
+#ifdef CONFIG_XEN
+
+void xen_invalidate_map_cache_entry(uint8_t *buffer)
+{
+}
+
+uint8_t *xen_map_cache(hwaddr phys_addr, hwaddr size, uint8_t lock, bool dma)
+{
+    return NULL;
+}
+
+ram_addr_t xen_ram_addr_from_mapcache(void *ptr)
+{
+    return 0;
+}
+
+#endif
-- 
1.8.3.1



  parent reply	other threads:[~2019-09-03 20:41 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-03 20:37 [Qemu-devel] [RFC v3 PATCH 00/45] Initial support of multi-process qemu Jagannathan Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 01/45] multi-process: memory: alloc RAM from file at offset Jagannathan Raman
2019-09-04  8:11   ` Dr. David Alan Gilbert
2019-09-05 15:07     ` Jag Raman
2019-09-05 15:17       ` Dr. David Alan Gilbert
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 02/45] multi-process: util: Add qemu_thread_cancel() to cancel running thread Jagannathan Raman
2019-09-04  9:11   ` Daniel P. Berrangé
2019-09-05 15:10     ` Jag Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 03/45] multi-process: add a command line option for debug file Jagannathan Raman
2019-09-03 20:37 ` Jagannathan Raman [this message]
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 05/45] multi-process: Add config option for multi-process QEMU Jagannathan Raman
2019-09-12 14:31   ` Stefan Hajnoczi
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 06/45] multi-process: build system for remote device process Jagannathan Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 07/45] multi-process: define proxy-link object Jagannathan Raman
2019-09-04  8:22   ` Daniel P. Berrangé
2019-09-05 14:37     ` Eric Blake
2019-09-05 15:20       ` Jag Raman
2019-09-12 15:34   ` Stefan Hajnoczi
2019-10-09 13:37     ` Stefan Hajnoczi
2019-10-09 17:58       ` Elena Ufimtseva
2019-10-10 20:21         ` Jag Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 08/45] multi-process: add functions to synchronize proxy and remote endpoints Jagannathan Raman
2019-09-12 15:45   ` Stefan Hajnoczi
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 09/45] multi-process: setup PCI host bridge for remote device Jagannathan Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 10/45] multi-process: setup a machine object for remote device process Jagannathan Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 11/45] multi-process: setup memory manager for remote device Jagannathan Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 12/45] multi-process: remote process initialization Jagannathan Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 13/45] multi-process: introduce proxy object Jagannathan Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 14/45] mutli-process: build remote command line args Jagannathan Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 15/45] multi-process: add support of device id to communication channel Jagannathan Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 16/45] multi-process: PCI BAR read/write handling for proxy & remote endpoints Jagannathan Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 17/45] multi-process: modify BARs read/write to support dev_id Jagannathan Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 18/45] multi-process: support dev id in config read/write Jagannathan Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 19/45] multi-process: Add LSI device proxy object Jagannathan Raman
2019-09-05 10:22   ` Gerd Hoffmann
2019-09-05 15:22     ` Jag Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 20/45] multi-process: Synchronize remote memory Jagannathan Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 21/45] multi-process: create IOHUB object to handle irq Jagannathan Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 22/45] multi-process: configure remote side devices Jagannathan Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 23/45] multi-process: add qdev_proxy_add to create proxy devices Jagannathan Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 24/45] multi-process: remote: add setup_devices and setup_drive msg processing Jagannathan Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 25/45] multi-process: remote: use fd for socket from parent process Jagannathan Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 26/45] multi-process: remote: add create_done condition Jagannathan Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 27/45] multi-process: add processing of remote drive and device command line Jagannathan Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 28/45] multi-process: Introduce build flags to separate remote process code Jagannathan Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 29/45] multi-process: refractor vl.c code to re-use in remote Jagannathan Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 30/45] multi-process: add remote option Jagannathan Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 31/45] multi-process: add remote options parser Jagannathan Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 32/45] multi-process: add parse_cmdline in remote process Jagannathan Raman
2019-09-03 20:37 ` [Qemu-devel] [RFC v3 PATCH 33/45] multi-process: add support for multiple devices Jagannathan Raman
2019-09-03 20:38 ` [Qemu-devel] [RFC v3 PATCH 34/45] multi-process: add heartbeat timer and signal handler Jagannathan Raman
2019-09-03 20:38 ` [Qemu-devel] [RFC v3 PATCH 35/45] multi-process: handle heartbeat messages in remote process Jagannathan Raman
2019-09-03 20:38 ` [Qemu-devel] [RFC v3 PATCH 36/45] multi-process: Use separate MMIO communication channel Jagannathan Raman
2019-09-03 20:38 ` [Qemu-devel] [RFC v3 PATCH 37/45] multi-process: perform device reset in the remote process Jagannathan Raman
2019-09-03 20:38 ` [Qemu-devel] [RFC v3 PATCH 38/45] multi-process/mon: stub functions to enable QMP module for " Jagannathan Raman
2019-09-03 20:38 ` [Qemu-devel] [RFC v3 PATCH 39/45] multi-process/mon: build system for QMP module in " Jagannathan Raman
2019-09-03 20:38 ` [Qemu-devel] [RFC v3 PATCH 40/45] multi-process/mon: Refactor monitor/chardev functions out of vl.c Jagannathan Raman
2019-09-04  8:37   ` Dr. David Alan Gilbert
2019-09-05 15:23     ` Jag Raman
2019-09-03 20:38 ` [Qemu-devel] [RFC v3 PATCH 41/45] multi-process/mon: trim HMP command set for remote storage processes Jagannathan Raman
2019-09-04  8:56   ` Dr. David Alan Gilbert
2019-09-05 15:54     ` Jag Raman
2019-09-05 15:57       ` Dr. David Alan Gilbert
2019-09-03 20:38 ` [Qemu-devel] [RFC v3 PATCH 42/45] multi-process/mon: Initialize QMP module for remote processes Jagannathan Raman
2019-09-03 20:38 ` [Qemu-devel] [RFC v3 PATCH 43/45] multi-process: prevent duplicate memory initialization in remote Jagannathan Raman
2019-09-03 20:38 ` [Qemu-devel] [RFC v3 PATCH 44/45] multi-process: add the concept description to docs/devel/qemu-multiprocess Jagannathan Raman
2019-09-05 10:10   ` Gerd Hoffmann
2019-09-05 10:16   ` Peter Maydell
2019-09-05 16:08     ` Elena Ufimtseva
2019-09-03 20:38 ` [Qemu-devel] [RFC v3 PATCH 45/45] multi-process: add configure and usage information Jagannathan Raman
2019-09-04  9:18 ` [Qemu-devel] [RFC v3 PATCH 00/45] Initial support of multi-process qemu Daniel P. Berrangé
2019-09-04 16:29   ` Jag Raman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=29bbfa028904a603b708801897872fa250a6bbaa.1567534653.git.jag.raman@oracle.com \
    --to=jag.raman@oracle.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=elena.ufimtseva@oracle.com \
    --cc=fam@euphon.net \
    --cc=john.g.johnson@oracle.com \
    --cc=kanth.ghatraju@oracle.com \
    --cc=konrad.wilk@oracle.com \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=liran.alon@oracle.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=mreitz@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=ross.lagerwall@citrix.com \
    --cc=rth@twiddle.net \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).