QEMU/Xen: disentangle PV and HVM in QEMU
cover QEMU/Xen: disentangle PV and HVM in QEMU
This small series disentangles Xen-specific files in QEMU. PV and HVM guests related files are moved to corresponding locations. Build system is updated to reflect those changes.
This series was sent back in Jan but fell through the crack. It is now rebased on current QEMU master and tested with usual Xen building runes. Everything works as before.
Wei.
Wei Liu (3):
xen: move Xen PV machine files to hw/xenpv
xen: move Xen HVM files under hw/i386/xen
xen: factor out common functions
Makefile.target | 6 +- hw/i386/Makefile.objs | 2 +- hw/i386/xen/Makefile.objs | 1 + hw/i386/xen/xen_apic.c | 97 ++++ hw/i386/xen/xen_platform.c | 450 ++++++++++++++++ hw/i386/xen/xen_pvdevice.c | 135 +++++ hw/i386/xen_domainbuild.c | 299 ----------- hw/i386/xen_domainbuild.h | 13 - hw/i386/xen_machine_pv.c | 109 ---- hw/xen/Makefile.objs | 1 - hw/xen/xen_apic.c | 97 ---- hw/xen/xen_platform.c | 450 ---------------- hw/xen/xen_pvdevice.c | 135 ----- hw/xenpv/Makefile.objs | 2 + hw/xenpv/xen_domainbuild.c | 299 +++++++++++ hw/xenpv/xen_domainbuild.h | 13 + hw/xenpv/xen_machine_pv.c | 109 ++++ xen-all.c | 1228 -------------------------------------------- xen-common-stub.c | 19 + xen-common.c | 123 +++++ xen-hvm-stub.c | 66 +++ xen-hvm.c | 1129 ++++++++++++++++++++++++++++++++++++++++ xen-mapcache-stub.c | 39 ++ xen-stub.c | 70 --- 24 files changed, 2487 insertions(+), 2405 deletions(-) create mode 100644 hw/i386/xen/Makefile.objs create mode 100644 hw/i386/xen/xen_apic.c create mode 100644 hw/i386/xen/xen_platform.c create mode 100644 hw/i386/xen/xen_pvdevice.c delete mode 100644 hw/i386/xen_domainbuild.c delete mode 100644 hw/i386/xen_domainbuild.h delete mode 100644 hw/i386/xen_machine_pv.c delete mode 100644 hw/xen/xen_apic.c delete mode 100644 hw/xen/xen_platform.c delete mode 100644 hw/xen/xen_pvdevice.c create mode 100644 hw/xenpv/Makefile.objs create mode 100644 hw/xenpv/xen_domainbuild.c create mode 100644 hw/xenpv/xen_domainbuild.h create mode 100644 hw/xenpv/xen_machine_pv.c delete mode 100644 xen-all.c create mode 100644 xen-common-stub.c create mode 100644 xen-common.c create mode 100644 xen-hvm-stub.c create mode 100644 xen-hvm.c create mode 100644 xen-mapcache-stub.c delete mode 100644 xen-stub.c
Signature · 1 line
1.7.10.4
PATCH RESEND 1/3 xen: move Xen PV machine files to hw/xenpv
--- hw/i386/Makefile.objs | 2 +- hw/i386/xen_domainbuild.c | 299 -------------------------------------------- hw/i386/xen_domainbuild.h | 13 -- hw/i386/xen_machine_pv.c | 109 ---------------- hw/xenpv/Makefile.objs | 2 + hw/xenpv/xen_domainbuild.c | 299 ++++++++++++++++++++++++++++++++++++++++++++ hw/xenpv/xen_domainbuild.h | 13 ++ hw/xenpv/xen_machine_pv.c | 109 ++++++++++++++++ 8 files changed, 424 insertions(+), 422 deletions(-) delete mode 100644 hw/i386/xen_domainbuild.c delete mode 100644 hw/i386/xen_domainbuild.h delete mode 100644 hw/i386/xen_machine_pv.c create mode 100644 hw/xenpv/Makefile.objs create mode 100644 hw/xenpv/xen_domainbuild.c create mode 100644 hw/xenpv/xen_domainbuild.h create mode 100644 hw/xenpv/xen_machine_pv.c
hw/i386/Makefile.objs +1 -1
@@ -2,7 +2,7 @@ obj-$(CONFIG_KVM) += kvm/ obj-y += multiboot.o smbios.o obj-y += pc.o pc_piix.o pc_q35.o obj-y += pc_sysfw.o -obj-$(CONFIG_XEN) += xen_domainbuild.o xen_machine_pv.o +obj-$(CONFIG_XEN) += ../xenpv/ obj-y += kvmvapic.o obj-y += acpi-build.o
hw/i386/xen_domainbuild.c deleted +0 -299
299 lines not on this page · raw message
hw/i386/xen_domainbuild.h deleted +0 -13
@@ -1,13 +0,0 @@ -#ifndef QEMU_HW_XEN_DOMAINBUILD_H -#define QEMU_HW_XEN_DOMAINBUILD_H 1 - -#include "hw/xen/xen_common.h" - -int xenstore_domain_init1 (const char *kernel,const char *ramdisk, -const char *cmdline); -int xenstore_domain_init2 (int xenstore_port,int xenstore_mfn, -int console_port,int console_mfn); -int xen_domain_build_pv (const char *kernel,const char *ramdisk, -const char *cmdline); - -#endif /* QEMU_HW_XEN_DOMAINBUILD_H */
hw/i386/xen_machine_pv.c deleted +0 -109
109 lines not on this page · raw message
hw/xenpv/Makefile.objs new file +2 -0
@@ -0,0 +1,2 @@ +# Xen PV machine support +obj-$(CONFIG_XEN) += xen_domainbuild.o xen_machine_pv.o
hw/xenpv/xen_domainbuild.c new file +299 -0
299 lines not on this page · raw message
hw/xenpv/xen_domainbuild.h new file +13 -0
@@ -0,0 +1,13 @@ +#ifndef QEMU_HW_XEN_DOMAINBUILD_H +#define QEMU_HW_XEN_DOMAINBUILD_H 1 + +#include "hw/xen/xen_common.h" + +int xenstore_domain_init1 (const char *kernel,const char *ramdisk, +const char *cmdline); +int xenstore_domain_init2 (int xenstore_port,int xenstore_mfn, +int console_port,int console_mfn); +int xen_domain_build_pv (const char *kernel,const char *ramdisk, +const char *cmdline); + +#endif /* QEMU_HW_XEN_DOMAINBUILD_H */
hw/xenpv/xen_machine_pv.c new file +109 -0
109 lines not on this page · raw message
Signature · 1 line
1.7.10.4
PATCH RESEND 2/3 xen: move Xen HVM files under hw/i386/xen
In reply to Wei Liu--- hw/i386/Makefile.objs | 2 +- hw/i386/xen/Makefile.objs | 1 + hw/i386/xen/xen_apic.c | 97 ++++++++++ hw/i386/xen/xen_platform.c | 450 ++++++++++++++++++++++++++++++++++++++++++++ hw/i386/xen/xen_pvdevice.c | 135 +++++++++++++ hw/xen/Makefile.objs | 1 - hw/xen/xen_apic.c | 97 ---------- hw/xen/xen_platform.c | 450 -------------------------------------------- hw/xen/xen_pvdevice.c | 135 ------------- 9 files changed, 684 insertions(+), 684 deletions(-) create mode 100644 hw/i386/xen/Makefile.objs create mode 100644 hw/i386/xen/xen_apic.c create mode 100644 hw/i386/xen/xen_platform.c create mode 100644 hw/i386/xen/xen_pvdevice.c delete mode 100644 hw/xen/xen_apic.c delete mode 100644 hw/xen/xen_platform.c delete mode 100644 hw/xen/xen_pvdevice.c
hw/i386/Makefile.objs +1 -1
@@ -2,7 +2,7 @@ obj-$(CONFIG_KVM) += kvm/ obj-y += multiboot.o smbios.o obj-y += pc.o pc_piix.o pc_q35.o obj-y += pc_sysfw.o -obj-$(CONFIG_XEN) += ../xenpv/ +obj-$(CONFIG_XEN) += ../xenpv/ xen/ obj-y += kvmvapic.o obj-y += acpi-build.o
hw/i386/xen/Makefile.objs new file +1 -0
@@ -0,0 +1 @@ +obj-y += xen_platform.o xen_apic.o xen_pvdevice.o
hw/i386/xen/xen_apic.c new file +97 -0
97 lines not on this page · raw message
hw/i386/xen/xen_platform.c new file +450 -0
450 lines not on this page · raw message
hw/i386/xen/xen_pvdevice.c new file +135 -0
135 lines not on this page · raw message
hw/xen/Makefile.objs +0 -1
@@ -1,6 +1,5 @@ # xen backend driver support common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_devconfig.o -obj-$(CONFIG_XEN_I386) += xen_platform.o xen_apic.o xen_pvdevice.o obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen-host-pci-device.o obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen_pt.o xen_pt_config_init.o xen_pt_msi.o
hw/xen/xen_apic.c deleted +0 -97
97 lines not on this page · raw message
hw/xen/xen_platform.c deleted +0 -450
450 lines not on this page · raw message
hw/xen/xen_pvdevice.c deleted +0 -135
135 lines not on this page · raw message
Signature · 1 line
1.7.10.4
PATCH RESEND 3/3 xen: factor out common functions
In reply to Wei LiuSo common functions used by both HVM and PV are factored out from xen-all.c to xen-common.c.
Finally rename xen-all.c to xen-hvm.c, as those functions are only useful to HVM guest.
Create *-stub files and modify Makefile.target to reflect the changes.
--- Makefile.target | 6 +- xen-all.c | 1228 --------------------------------------------------- xen-common-stub.c | 19 + xen-common.c | 123 ++++++ xen-hvm-stub.c | 66 +++ xen-hvm.c | 1129 ++++++++++++++++++++++++++++++++++++++++++++++ xen-mapcache-stub.c | 39 ++ xen-stub.c | 70 --- 8 files changed, 1380 insertions(+), 1300 deletions(-) delete mode 100644 xen-all.c create mode 100644 xen-common-stub.c create mode 100644 xen-common.c create mode 100644 xen-hvm-stub.c create mode 100644 xen-hvm.c create mode 100644 xen-mapcache-stub.c delete mode 100644 xen-stub.c
Makefile.target +4 -2
@@ -120,8 +120,10 @@ obj-y += dump.o LIBS+=$(libs_softmmu) # xen support -obj-$(CONFIG_XEN) += xen-all.o xen-mapcache.o -obj-$(call lnot,$(CONFIG_XEN)) += xen-stub.o +obj-$(CONFIG_XEN) += xen-common.o +obj-$(CONFIG_XEN_I386) += xen-hvm.o xen-mapcache.o +obj-$(call lnot,$(CONFIG_XEN)) += xen-common-stub.o +obj-$(call lnot,$(CONFIG_XEN_I386)) += xen-hvm-stub.o xen-mapcache-stub.o # Hardware support ifeq ($(TARGET_NAME), sparc64)
xen-all.c deleted +0 -1228
1,228 lines not on this page · raw message
xen-common-stub.c new file +19 -0
@@ -0,0 +1,19 @@ +/* +* Copyright (C) 2014 Citrix Systems UK Ltd. +* +* 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-common.h" +#include "hw/xen/xen.h" + +void xenstore_store_pv_console_info (int i,CharDriverState *chr) +{ +} + +int xen_init (QEMUMachine *machine) +{ +return -ENOSYS ; +} +
xen-common.c new file +123 -0
123 lines not on this page · raw message
xen-hvm-stub.c new file +66 -0
66 lines not on this page · raw message
xen-hvm.c new file +1129 -0
1,129 lines not on this page · raw message
xen-mapcache-stub.c new file +39 -0
@@ -0,0 +1,39 @@ +/* +* Copyright (C) 2014 Citrix Ltd. +* +* This work is licensed under the terms of the GNU GPL, version 2. See +* the COPYING file in the top-level directory. +* +* Contributions after 2012-01-13 are licensed under the terms of the +* GNU GPL, version 2 or (at your option) any later version. +*/ + +#include "config.h" + +#include <sys/resource.h> + +#include "hw/xen/xen_backend.h" + +#include <xen/hvm/params.h> + +#include "sysemu/xen-mapcache.h" +#include "trace.h" + +uint8_t *xen_map_cache (hwaddr phys_addr,hwaddr size, +uint8_t lock) +{ +abort (); +return NULL ; +} + +ram_addr_t xen_ram_addr_from_mapcache (void *ptr) +{ +abort (); +return 0 ; +} + +void xen_invalidate_map_cache_entry (uint8_t *buffer) +{ +abort (); +} +
xen-stub.c deleted +0 -70
70 lines not on this page · raw message
Signature · 1 line
1.7.10.4
Il 25/03/2014 16:59, Wei Liu ha scritto:
Quoted 8 lines
This small series disentangles Xen-specific files in QEMU. PV and HVM guests related files are moved to corresponding locations. Build system is updated to reflect those changes.
This series was sent back in Jan but fell through the crack. It is now rebased on current QEMU master and tested with usual Xen building runes. Everything works as before.
Quoted 6 lines
Wei.
Wei Liu (3):
xen: move Xen PV machine files to hw/xenpv
xen: move Xen HVM files under hw/i386/xen
xen: factor out common functions
Please regenerate with the "-M" option or add the following to .gitconfig:
[diff]
renames = true
Paolo
Quoted 16 lines · Paolo Bonzini
Il 25/03/2014 16:59, Wei Liu ha scritto:
Quoted 8 lines
This small series disentangles Xen-specific files in QEMU. PV and HVM guests related files are moved to corresponding locations. Build system is updated to reflect those changes.
This series was sent back in Jan but fell through the crack. It is now rebased on current QEMU master and tested with usual Xen building runes. Everything works as before.
Quoted 6 lines
Wei.
Wei Liu (3):
xen: move Xen PV machine files to hw/xenpv
xen: move Xen HVM files under hw/i386/xen
xen: factor out common functions
Quoted 4 lines
Please regenerate with the "-M" option or add the following to .gitconfig:
[diff]
renames = true
Oops, sorry. I did this for first series but forgot about it when resending. Updated diff stat attached.
Wei.
Wei Liu (3):
xen: move Xen PV machine files to hw/xenpv
xen: move Xen HVM files under hw/i386/xen
xen: factor out common functions
Makefile.target | 6 +-
hw/i386/Makefile.objs | 2 +-
hw/i386/xen/Makefile.objs | 1 +
hw/{ => i386}/xen/xen_apic.c | 0
hw/{ => i386}/xen/xen_platform.c | 0
hw/{ => i386}/xen/xen_pvdevice.c | 0
hw/xen/Makefile.objs | 1 -
hw/xenpv/Makefile.objs | 2 +
hw/{i386 => xenpv}/xen_domainbuild.c | 0
hw/{i386 => xenpv}/xen_domainbuild.h | 0
hw/{i386 => xenpv}/xen_machine_pv.c | 0
xen-common-stub.c | 19 ++++++
xen-common.c | 123 ++++++++++++++++++++++++++++++++++
xen-stub.c => xen-hvm-stub.c | 18 ++---
xen-all.c => xen-hvm.c | 121 +++------------------------------
xen-mapcache-stub.c | 39 +++++++++++
16 files changed, 207 insertions(+), 125 deletions(-)
create mode 100644 hw/i386/xen/Makefile.objs
rename hw/{ => i386}/xen/xen_apic.c (100%)
rename hw/{ => i386}/xen/xen_platform.c (100%)
rename hw/{ => i386}/xen/xen_pvdevice.c (100%)
create mode 100644 hw/xenpv/Makefile.objs
rename hw/{i386 => xenpv}/xen_domainbuild.c (100%)
rename hw/{i386 => xenpv}/xen_domainbuild.h (100%)
rename hw/{i386 => xenpv}/xen_machine_pv.c (100%)
create mode 100644 xen-common-stub.c
create mode 100644 xen-common.c
rename xen-stub.c => xen-hvm-stub.c (90%)
rename xen-all.c => xen-hvm.c (93%)
create mode 100644 xen-mapcache-stub.cQuoted 17 lines · Wei Liu
Quoted 16 lines · Paolo Bonzini
Il 25/03/2014 16:59, Wei Liu ha scritto:
Quoted 14 lines
This small series disentangles Xen-specific files in QEMU. PV and HVM guests related files are moved to corresponding locations. Build system is updated to reflect those changes.
This series was sent back in Jan but fell through the crack. It is now rebased on current QEMU master and tested with usual Xen building runes. Everything works as before.
Wei.
Wei Liu (3):
xen: move Xen PV machine files to hw/xenpv
xen: move Xen HVM files under hw/i386/xen
xen: factor out common functions
Quoted 7 lines
Quoted 4 lines
Please regenerate with the "-M" option or add the following to .gitconfig:
[diff]
renames = trueOops, sorry. I did this for first series but forgot about it when resending. Updated diff stat attached.
Much better, thanks.
The patches are fine by me.
Paolo, if you are OK with them, I'll send a pull request.
Quoted 38 lines
Wei.
Wei Liu (3):
xen: move Xen PV machine files to hw/xenpv
xen: move Xen HVM files under hw/i386/xen
xen: factor out common functionsMakefile.target | 6 +- hw/i386/Makefile.objs | 2 +- hw/i386/xen/Makefile.objs | 1 + hw/{ => i386}/xen/xen_apic.c | 0 hw/{ => i386}/xen/xen_platform.c | 0 hw/{ => i386}/xen/xen_pvdevice.c | 0 hw/xen/Makefile.objs | 1 - hw/xenpv/Makefile.objs | 2 + hw/{i386 => xenpv}/xen_domainbuild.c | 0 hw/{i386 => xenpv}/xen_domainbuild.h | 0 hw/{i386 => xenpv}/xen_machine_pv.c | 0 xen-common-stub.c | 19 ++++++ xen-common.c | 123 ++++++++++++++++++++++++++++++++++ xen-stub.c => xen-hvm-stub.c | 18 ++--- xen-all.c => xen-hvm.c | 121 +++------------------------------ xen-mapcache-stub.c | 39 +++++++++++ 16 files changed, 207 insertions(+), 125 deletions(-) create mode 100644 hw/i386/xen/Makefile.objs rename hw/{ => i386}/xen/xen_apic.c (100%) rename hw/{ => i386}/xen/xen_platform.c (100%) rename hw/{ => i386}/xen/xen_pvdevice.c (100%) create mode 100644 hw/xenpv/Makefile.objs rename hw/{i386 => xenpv}/xen_domainbuild.c (100%) rename hw/{i386 => xenpv}/xen_domainbuild.h (100%) rename hw/{i386 => xenpv}/xen_machine_pv.c (100%) create mode 100644 xen-common-stub.c create mode 100644 xen-common.c rename xen-stub.c => xen-hvm-stub.c (90%) rename xen-all.c => xen-hvm.c (93%) create mode 100644 xen-mapcache-stub.c
Il 25/03/2014 17:40, Stefano Stabellini ha scritto:
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Oops, sorry. I did this for first series but forgot about it when resending. Updated diff stat attached.
Much better, thanks.
The patches are fine by me.Paolo, if you are OK with them, I'll send a pull request.
I guess for 2.1? Or do they actually fix bugs?
Paolo
Quoted 10 lines · Paolo Bonzini
Il 25/03/2014 17:40, Stefano Stabellini ha scritto:
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Oops, sorry. I did this for first series but forgot about it when resending. Updated diff stat attached.
Much better, thanks.
The patches are fine by me.Paolo, if you are OK with them, I'll send a pull request.
I guess for 2.1? Or do they actually fix bugs?
For 2.1 is fine.