[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH RESEND v6 10/36] multi-process: build system for remote devic
From: |
Stefan Hajnoczi |
Subject: |
Re: [PATCH RESEND v6 10/36] multi-process: build system for remote device process |
Date: |
Fri, 24 Apr 2020 16:04:21 +0100 |
On Wed, Apr 22, 2020 at 09:13:45PM -0700, address@hidden wrote:
> From: Jagannathan Raman <address@hidden>
>
> Modify Makefile to support the building of the remote
> device process. Implements main() function of remote
> device process.
>
> Signed-off-by: John G Johnson <address@hidden>
> Signed-off-by: Jagannathan Raman <address@hidden>
> Signed-off-by: Elena Ufimtseva <address@hidden>
> ---
> MAINTAINERS | 8 ++++++
> Makefile | 2 ++
> Makefile.objs | 27 ++++++++++++++++++
> Makefile.target | 61 ++++++++++++++++++++++++++++++++++++++++-
> accel/Makefile.objs | 2 ++
> backends/Makefile.objs | 2 ++
> block/Makefile.objs | 2 ++
> hw/Makefile.objs | 7 +++++
> hw/block/Makefile.objs | 2 ++
> hw/core/Makefile.objs | 18 ++++++++++++
> hw/nvram/Makefile.objs | 2 ++
> hw/pci/Makefile.objs | 4 +++
> hw/scsi/Makefile.objs | 2 ++
> migration/Makefile.objs | 2 ++
> qom/Makefile.objs | 3 ++
> remote/Makefile.objs | 1 +
> remote/remote-main.c | 23 ++++++++++++++++
> stubs/replay.c | 4 +++
> 18 files changed, 171 insertions(+), 1 deletion(-)
> create mode 100644 remote/Makefile.objs
> create mode 100644 remote/remote-main.c
This approach is okay for now but will result in a lot of Makefile
duplication in the long run.
Each hw .o file should specify its dependencies so that qemu-system-*
and the remote executable can link in the needed files. The Kconfig
system can also help with this by enabling/disabling features.
Then the Makefiles don't need to duplicate *-obj-y and remote-pci-*.
> diff --git a/Makefile.objs b/Makefile.objs
> index f29c60c59d..f6654633b4 100644
> --- a/Makefile.objs
> +++ b/Makefile.objs
> @@ -21,6 +21,33 @@ block-obj-$(CONFIG_REPLICATION) += replication.o
>
> block-obj-m = block/
>
> +#########################################################
> +# remote-pci-obj-y is common code used by remote devices
> +
> +remote-pci-obj-$(CONFIG_MPQEMU) += hw/
> +remote-pci-obj-$(CONFIG_MPQEMU) += qom/
> +remote-pci-obj-$(CONFIG_MPQEMU) += backends/
> +remote-pci-obj-$(CONFIG_MPQEMU) += block/
> +remote-pci-obj-$(CONFIG_MPQEMU) += migration/
In the future migration can be split into the QEMU and remote parts.
The remote executable doesn't need all the live migration code.
> +remote-pci-obj-$(CONFIG_MPQEMU) += remote/
> +remote-pci-obj-$(CONFIG_MPQEMU) += accel/
Devices do not execute guest code so they should not need accel/. kvm
and tcg functions were stubbed out earlier in this patch series, so I'm
surprised to see thing being built into the remote executable.
> @@ -121,6 +131,20 @@ LIBS := $(libs_cpu) $(LIBS)
>
> obj-$(CONFIG_PLUGIN) += plugins/
>
> +ifeq ($(TARGET_NAME)-$(CONFIG_MPQEMU)-$(CONFIG_USER_ONLY), x86_64-y-)
> +remote-pci-tgt-obj-$(CONFIG_MPQEMU) += accel/stubs/kvm-stub.o
> +remote-pci-tgt-obj-$(CONFIG_MPQEMU) += accel/stubs/tcg-stub.o
> +remote-pci-tgt-obj-$(CONFIG_MPQEMU) += accel/stubs/hax-stub.o
> +remote-pci-tgt-obj-$(CONFIG_MPQEMU) += accel/stubs/whpx-stub.o
> +remote-pci-tgt-obj-$(CONFIG_MPQEMU) += stubs/vl-stub.o
> +remote-pci-tgt-obj-$(CONFIG_MPQEMU) += stubs/net-stub.o
> +remote-pci-tgt-obj-$(CONFIG_MPQEMU) += stubs/monitor.o
> +remote-pci-tgt-obj-$(CONFIG_MPQEMU) += stubs/replay.o
> +remote-pci-tgt-obj-$(CONFIG_MPQEMU) += stubs/xen-mapcache.o
> +remote-pci-tgt-obj-$(CONFIG_MPQEMU) += stubs/audio.o
> +remote-pci-tgt-obj-$(CONFIG_MPQEMU) += stubs/monitor.o
> +endif
Stubs don't need to be explicitly included, they should be linked in via
libqemustub.a.
> diff --git a/remote/remote-main.c b/remote/remote-main.c
> new file mode 100644
> index 0000000000..7c0764ad01
> --- /dev/null
> +++ b/remote/remote-main.c
> @@ -0,0 +1,23 @@
> +/*
> + * Remote device initialization
> + *
> + * Copyright © 2018, 2020 Oracle and/or its affiliates.
> + *
> + * 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 <stdio.h>
This is already included by "qemu/osdep.h"
> +
> +#include "qemu/module.h"
> +
> +int main(int argc, char *argv[])
> +{
> + module_call_init(MODULE_INIT_QOM);
> +
> + return 0;
> +}
> diff --git a/stubs/replay.c b/stubs/replay.c
> index 2e3feee6a9..9b53c0cb37 100644
> --- a/stubs/replay.c
> +++ b/stubs/replay.c
> @@ -102,3 +102,7 @@ int replay_get_instructions(void)
> void replay_account_executed_instructions(void)
> {
> }
> +
> +void replay_add_blocker(Error *reason)
> +{
> +}
This can be moved to the stubs patch.
signature.asc
Description: PGP signature
- [PATCH RESEND v6 31/36] multi-process/mon: choose HMP commands based on target, (continued)
- [PATCH RESEND v6 31/36] multi-process/mon: choose HMP commands based on target, elena . ufimtseva, 2020/04/23
- [PATCH RESEND v6 34/36] multi-process/mon: Initialize QMP module for remote processes, elena . ufimtseva, 2020/04/23
- [PATCH RESEND v6 32/36] multi-process/mon: stub functions to enable QMP module for remote process, elena . ufimtseva, 2020/04/23
- [PATCH RESEND v6 35/36] multi-process: add the concept description to docs/devel/qemu-multiprocess, elena . ufimtseva, 2020/04/23
- [PATCH RESEND v6 02/36] multi-process: Refactor machine_init and exit notifiers, elena . ufimtseva, 2020/04/23
- [PATCH RESEND v6 08/36] multi-process: Add stub functions to facilitate build of multi-process, elena . ufimtseva, 2020/04/23
- [PATCH RESEND v6 10/36] multi-process: build system for remote device process, elena . ufimtseva, 2020/04/23
- Re: [PATCH RESEND v6 10/36] multi-process: build system for remote device process,
Stefan Hajnoczi <=
- [PATCH RESEND v6 11/36] multi-process: define mpqemu-link object, elena . ufimtseva, 2020/04/23
- [PATCH RESEND v6 12/36] multi-process: add functions to synchronize proxy and remote endpoints, elena . ufimtseva, 2020/04/23
- [PATCH RESEND v6 14/36] multi-process: setup a machine object for remote device process, elena . ufimtseva, 2020/04/23
- [PATCH RESEND v6 17/36] multi-process: introduce proxy object, elena . ufimtseva, 2020/04/23
- [PATCH RESEND v6 24/36] multi-process: Retrieve PCI info from remote process, elena . ufimtseva, 2020/04/23
- [PATCH RESEND v6 26/36] multi-process: add parse_cmdline in remote process, elena . ufimtseva, 2020/04/23
- [PATCH RESEND v6 28/36] multi-process: send heartbeat messages to remote, elena . ufimtseva, 2020/04/23
- [PATCH RESEND v6 33/36] multi-process/mon: enable QMP module support in the remote process, elena . ufimtseva, 2020/04/23
- [PATCH RESEND v6 36/36] multi-process: add configure and usage information, elena . ufimtseva, 2020/04/23