Skip to contentSkip to conversation

move libxenctrl to tools/libs directory

PATCH In review Juergen Gross 2 participants 21 messages Aug 17, 2020 Arm/actions semi architecture

lore
Share & tools
lore
#0 lore raw

v2 cover move libxenctrl to tools/libs directory

This is part 2 of the series moving more libraries under tools/libs. It is based on part 1 and does the needed cleanup work and moving for libxenctrl into tools/libs/ctrl.

Please note that patch 17 ("tools: move libxenctrl below tools/libs") needs the related qemu-trad patch applied in order not to break the build:

https://lists.xen.org/archives/html/xen-devel/2020-07/msg00617.html

Changes in V2:
- split the original series into multiple parts, this being part 2
- split the original 3 patches into now 17 in order to make review easier
- fixed several bugs and addressed the few comments I received

Juergen Gross (17):
stubdom: add correct dependencies for Xen libraries
tools: drop explicit path specifications for qemu build
tools: tweak tools/libs/libs.mk for being able to support libxenctrl tools/python: drop libxenguest from setup.py
tools: fix pkg-config file for libxenguest
tools: don't assume libxenguest and libxenctrl to be in same directory tools/misc: don't use libxenctrl internals from xen-hptool tools/misc: don't include xg_save_restore.h from xen-mfndump.c tools/misc: replace PAGE_SIZE with XC_PAGE_SIZE in xen-mfndump.c tools/misc: drop all libxc internals from xen-mfndump.c tools/libxc: remove unused headers xc_efi.h and xc_elf.h tools/libxc: move xc_[un]map_domain_meminfo() into new source
xg_domain.c
tools/libxc: rename all libxenguest sources to xg_* tools/libxc: rename libxenguest internal headers tools/misc: rename xc_dom.h do xenctrl_dom.h
tools/libxc: untangle libxenctrl from libxenguest
tools: move libxenctrl below tools/libs

 .gitignore                                    |   8 +
 MAINTAINERS                                   |   2 +-
 stubdom/Makefile                              |  28 ++-
 stubdom/grub/kexec.c                          |   2 +-
 stubdom/mini-os.mk                            |   2 +-
 tools/Makefile                                |  26 +--
 tools/Rules.mk                                |  17 +-
 tools/helpers/init-xenstore-domain.c          |   2 +-
 tools/libs/Makefile                           |   1 +
 tools/libs/ctrl/Makefile                      |  68 ++++++++
 tools/{libxc => libs/ctrl}/include/xenctrl.h  |   0
 .../ctrl}/include/xenctrl_compat.h            |   0
 .../ctrl/include/xenctrl_dom.h}               |  10 +-
 tools/{libxc => libs/ctrl}/xc_altp2m.c        |   0
 tools/{libxc => libs/ctrl}/xc_arinc653.c      |   0
 tools/{libxc => libs/ctrl}/xc_bitops.h        |   0
 tools/{libxc => libs/ctrl}/xc_core.c          |   5 +-
 tools/{libxc => libs/ctrl}/xc_core.h          |   2 +-
 tools/{libxc => libs/ctrl}/xc_core_arm.c      |   2 +-
 tools/{libxc => libs/ctrl}/xc_core_arm.h      |   0
 tools/{libxc => libs/ctrl}/xc_core_x86.c      |   6 +-
 tools/{libxc => libs/ctrl}/xc_core_x86.h      |   0
 tools/{libxc => libs/ctrl}/xc_cpu_hotplug.c   |   0
 tools/{libxc => libs/ctrl}/xc_cpupool.c       |   0
 tools/{libxc => libs/ctrl}/xc_csched.c        |   0
 tools/{libxc => libs/ctrl}/xc_csched2.c       |   0
 .../ctrl}/xc_devicemodel_compat.c             |   0
 tools/{libxc => libs/ctrl}/xc_domain.c        | 129 +-------------
 tools/{libxc => libs/ctrl}/xc_evtchn.c        |   0
 tools/{libxc => libs/ctrl}/xc_evtchn_compat.c |   0
 tools/{libxc => libs/ctrl}/xc_flask.c         |   0
 .../{libxc => libs/ctrl}/xc_foreign_memory.c  |   0
 tools/{libxc => libs/ctrl}/xc_freebsd.c       |   0
 tools/{libxc => libs/ctrl}/xc_gnttab.c        |   0
 tools/{libxc => libs/ctrl}/xc_gnttab_compat.c |   0
 tools/{libxc => libs/ctrl}/xc_hcall_buf.c     |   1 -
 tools/{libxc => libs/ctrl}/xc_kexec.c         |   0
 tools/{libxc => libs/ctrl}/xc_linux.c         |   0
 tools/{libxc => libs/ctrl}/xc_mem_access.c    |   0
 tools/{libxc => libs/ctrl}/xc_mem_paging.c    |   0
 tools/{libxc => libs/ctrl}/xc_memshr.c        |   0
 tools/{libxc => libs/ctrl}/xc_minios.c        |   0
 tools/{libxc => libs/ctrl}/xc_misc.c          |   0
 tools/{libxc => libs/ctrl}/xc_monitor.c       |   0
 tools/{libxc => libs/ctrl}/xc_msr_x86.h       |   0
 tools/{libxc => libs/ctrl}/xc_netbsd.c        |   0
 tools/{libxc => libs/ctrl}/xc_pagetab.c       |   0
 tools/{libxc => libs/ctrl}/xc_physdev.c       |   0
 tools/{libxc => libs/ctrl}/xc_pm.c            |   0
 tools/{libxc => libs/ctrl}/xc_private.c       |   3 +-
 tools/{libxc => libs/ctrl}/xc_private.h       |  36 ++++
 tools/{libxc => libs/ctrl}/xc_psr.c           |   0
 tools/{libxc => libs/ctrl}/xc_resource.c      |   0
 tools/{libxc => libs/ctrl}/xc_resume.c        |   2 -
 tools/{libxc => libs/ctrl}/xc_rt.c            |   0
 tools/{libxc => libs/ctrl}/xc_solaris.c       |   0
 tools/{libxc => libs/ctrl}/xc_tbuf.c          |   0
 tools/{libxc => libs/ctrl}/xc_vm_event.c      |   0
 tools/{libxc => libs/ctrl}/xencontrol.pc.in   |   0
 tools/libs/libs.mk                            |  21 ++-
 tools/libxc/Makefile                          | 159 +++++-------------
 tools/libxc/include/xenguest.h                |   8 +-
 tools/libxc/xc_efi.h                          | 158 -----------------
 tools/libxc/xc_elf.h                          |  16 --
 tools/libxc/xenguest.pc.in                    |   2 +-
 .../libxc/{xc_cpuid_x86.c => xg_cpuid_x86.c}  |   0
 tools/libxc/{xc_dom_arm.c => xg_dom_arm.c}    |   2 +-
 ...imageloader.c => xg_dom_armzimageloader.c} |   2 +-
 ...{xc_dom_binloader.c => xg_dom_binloader.c} |   2 +-
 tools/libxc/{xc_dom_boot.c => xg_dom_boot.c}  |   2 +-
 ...bzimageloader.c => xg_dom_bzimageloader.c} |   2 +-
 ...m_compat_linux.c => xg_dom_compat_linux.c} |   2 +-
 tools/libxc/{xc_dom_core.c => xg_dom_core.c}  |   2 +-
 ...c_dom_decompress.h => xg_dom_decompress.h} |   4 +-
 ...compress_lz4.c => xg_dom_decompress_lz4.c} |   2 +-
 ...ss_unsafe.c => xg_dom_decompress_unsafe.c} |   2 +-
 ...ss_unsafe.h => xg_dom_decompress_unsafe.h} |   2 +-
 ...ip2.c => xg_dom_decompress_unsafe_bzip2.c} |   2 +-
 ...lzma.c => xg_dom_decompress_unsafe_lzma.c} |   2 +-
 ...o1x.c => xg_dom_decompress_unsafe_lzo1x.c} |   2 +-
 ...afe_xz.c => xg_dom_decompress_unsafe_xz.c} |   2 +-
 ...{xc_dom_elfloader.c => xg_dom_elfloader.c} |   2 +-
 ...{xc_dom_hvmloader.c => xg_dom_hvmloader.c} |   2 +-
 tools/libxc/{xc_dom_x86.c => xg_dom_x86.c}    |   2 +-
 tools/libxc/xg_domain.c                       | 149 ++++++++++++++++
 .../libxc/{xc_nomigrate.c => xg_nomigrate.c}  |   0
 .../{xc_offline_page.c => xg_offline_page.c}  |   2 +-
 tools/libxc/xg_private.h                      |  22 ---
 tools/libxc/xg_save_restore.h                 |  13 --
 .../libxc/{xc_sr_common.c => xg_sr_common.c}  |   2 +-
 .../libxc/{xc_sr_common.h => xg_sr_common.h}  |   4 +-
 ...{xc_sr_common_x86.c => xg_sr_common_x86.c} |   2 +-
 ...{xc_sr_common_x86.h => xg_sr_common_x86.h} |   2 +-
 ..._common_x86_pv.c => xg_sr_common_x86_pv.c} |   2 +-
 ..._common_x86_pv.h => xg_sr_common_x86_pv.h} |   2 +-
 .../{xc_sr_restore.c => xg_sr_restore.c}      |   2 +-
 ...tore_x86_hvm.c => xg_sr_restore_x86_hvm.c} |   2 +-
 ...estore_x86_pv.c => xg_sr_restore_x86_pv.c} |   2 +-
 tools/libxc/{xc_sr_save.c => xg_sr_save.c}    |   2 +-
 ...sr_save_x86_hvm.c => xg_sr_save_x86_hvm.c} |   2 +-
 ...c_sr_save_x86_pv.c => xg_sr_save_x86_pv.c} |   2 +-
 ..._stream_format.h => xg_sr_stream_format.h} |   0
 tools/libxc/{xc_suspend.c => xg_suspend.c}    |   0
 tools/libxl/Makefile                          |   2 +-
 tools/libxl/libxl_arm.c                       |   2 +-
 tools/libxl/libxl_arm.h                       |   2 +-
 tools/libxl/libxl_create.c                    |   2 +-
 tools/libxl/libxl_dm.c                        |   2 +-
 tools/libxl/libxl_dom.c                       |   2 +-
 tools/libxl/libxl_internal.h                  |   2 +-
 tools/libxl/libxl_vnuma.c                     |   2 +-
 tools/libxl/libxl_x86.c                       |   2 +-
 tools/libxl/libxl_x86_acpi.c                  |   2 +-
 tools/misc/Makefile                           |   5 +-
 tools/misc/xen-hptool.c                       |   8 +-
 tools/misc/xen-mfndump.c                      |  44 +++--
 tools/python/Makefile                         |   2 +-
 tools/python/setup.py                         |  10 +-
 tools/python/xen/lowlevel/xc/xc.c             |   2 +-
 tools/xcutils/readnotes.c                     |   2 +-
 120 files changed, 457 insertions(+), 602 deletions(-)
 create mode 100644 tools/libs/ctrl/Makefile
 rename tools/{libxc => libs/ctrl}/include/xenctrl.h (100%)
 rename tools/{libxc => libs/ctrl}/include/xenctrl_compat.h (100%)
 rename tools/{libxc/include/xc_dom.h => libs/ctrl/include/xenctrl_dom.h} (98%)
 rename tools/{libxc => libs/ctrl}/xc_altp2m.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_arinc653.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_bitops.h (100%)
 rename tools/{libxc => libs/ctrl}/xc_core.c (99%)
 rename tools/{libxc => libs/ctrl}/xc_core.h (99%)
 rename tools/{libxc => libs/ctrl}/xc_core_arm.c (99%)
 rename tools/{libxc => libs/ctrl}/xc_core_arm.h (100%)
 rename tools/{libxc => libs/ctrl}/xc_core_x86.c (98%)
 rename tools/{libxc => libs/ctrl}/xc_core_x86.h (100%)
 rename tools/{libxc => libs/ctrl}/xc_cpu_hotplug.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_cpupool.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_csched.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_csched2.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_devicemodel_compat.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_domain.c (94%)
 rename tools/{libxc => libs/ctrl}/xc_evtchn.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_evtchn_compat.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_flask.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_foreign_memory.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_freebsd.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_gnttab.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_gnttab_compat.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_hcall_buf.c (99%)
 rename tools/{libxc => libs/ctrl}/xc_kexec.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_linux.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_mem_access.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_mem_paging.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_memshr.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_minios.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_misc.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_monitor.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_msr_x86.h (100%)
 rename tools/{libxc => libs/ctrl}/xc_netbsd.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_pagetab.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_physdev.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_pm.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_private.c (99%)
 rename tools/{libxc => libs/ctrl}/xc_private.h (91%)
 rename tools/{libxc => libs/ctrl}/xc_psr.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_resource.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_resume.c (99%)
 rename tools/{libxc => libs/ctrl}/xc_rt.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_solaris.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_tbuf.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_vm_event.c (100%)
 rename tools/{libxc => libs/ctrl}/xencontrol.pc.in (100%)
 delete mode 100644 tools/libxc/xc_efi.h
 delete mode 100644 tools/libxc/xc_elf.h
 rename tools/libxc/{xc_cpuid_x86.c => xg_cpuid_x86.c} (100%)
 rename tools/libxc/{xc_dom_arm.c => xg_dom_arm.c} (99%)
 rename tools/libxc/{xc_dom_armzimageloader.c => xg_dom_armzimageloader.c} (99%)
 rename tools/libxc/{xc_dom_binloader.c => xg_dom_binloader.c} (99%)
 rename tools/libxc/{xc_dom_boot.c => xg_dom_boot.c} (99%)
 rename tools/libxc/{xc_dom_bzimageloader.c => xg_dom_bzimageloader.c} (99%)
 rename tools/libxc/{xc_dom_compat_linux.c => xg_dom_compat_linux.c} (99%)
 rename tools/libxc/{xc_dom_core.c => xg_dom_core.c} (99%)
 rename tools/libxc/{xc_dom_decompress.h => xg_dom_decompress.h} (62%)
 rename tools/libxc/{xc_dom_decompress_lz4.c => xg_dom_decompress_lz4.c} (98%)
 rename tools/libxc/{xc_dom_decompress_unsafe.c => xg_dom_decompress_unsafe.c} (96%)
 rename tools/libxc/{xc_dom_decompress_unsafe.h => xg_dom_decompress_unsafe.h} (97%)
 rename tools/libxc/{xc_dom_decompress_unsafe_bzip2.c => xg_dom_decompress_unsafe_bzip2.c} (87%)
 rename tools/libxc/{xc_dom_decompress_unsafe_lzma.c => xg_dom_decompress_unsafe_lzma.c} (87%)
 rename tools/libxc/{xc_dom_decompress_unsafe_lzo1x.c => xg_dom_decompress_unsafe_lzo1x.c} (96%)
 rename tools/libxc/{xc_dom_decompress_unsafe_xz.c => xg_dom_decompress_unsafe_xz.c} (95%)
 rename tools/libxc/{xc_dom_elfloader.c => xg_dom_elfloader.c} (99%)
 rename tools/libxc/{xc_dom_hvmloader.c => xg_dom_hvmloader.c} (99%)
 rename tools/libxc/{xc_dom_x86.c => xg_dom_x86.c} (99%)
 create mode 100644 tools/libxc/xg_domain.c
 rename tools/libxc/{xc_nomigrate.c => xg_nomigrate.c} (100%)
 rename tools/libxc/{xc_offline_page.c => xg_offline_page.c} (99%)
 rename tools/libxc/{xc_sr_common.c => xg_sr_common.c} (99%)
 rename tools/libxc/{xc_sr_common.h => xg_sr_common.h} (99%)
 rename tools/libxc/{xc_sr_common_x86.c => xg_sr_common_x86.c} (99%)
 rename tools/libxc/{xc_sr_common_x86.h => xg_sr_common_x86.h} (98%)
 rename tools/libxc/{xc_sr_common_x86_pv.c => xg_sr_common_x86_pv.c} (99%)
 rename tools/libxc/{xc_sr_common_x86_pv.h => xg_sr_common_x86_pv.h} (98%)
 rename tools/libxc/{xc_sr_restore.c => xg_sr_restore.c} (99%)
 rename tools/libxc/{xc_sr_restore_x86_hvm.c => xg_sr_restore_x86_hvm.c} (99%)
 rename tools/libxc/{xc_sr_restore_x86_pv.c => xg_sr_restore_x86_pv.c} (99%)
 rename tools/libxc/{xc_sr_save.c => xg_sr_save.c} (99%)
 rename tools/libxc/{xc_sr_save_x86_hvm.c => xg_sr_save_x86_hvm.c} (99%)
 rename tools/libxc/{xc_sr_save_x86_pv.c => xg_sr_save_x86_pv.c} (99%)
 rename tools/libxc/{xc_sr_stream_format.h => xg_sr_stream_format.h} (100%)
 rename tools/libxc/{xc_suspend.c => xg_suspend.c} (100%)
Signature · 1 line
2.26.2
#1 lore raw

PATCH v2 1/17 stubdom: add correct dependencies for Xen libraries

The stubdom Makefile is missing several dependencies between Xen libraries. Add them.

---
 stubdom/Makefile | 5 +++++
 1 file changed, 5 insertions(+)
stubdom/Makefile +5 -0
index af8cde41b9..6fcecadeb9 100644
@@ -405,6 +405,7 @@ libs-$(XEN_TARGET_ARCH)/toollog/libxentoollog.a: mk-headers-$(XEN_TARGET_ARCH) $
 
 .PHONY: libxenevtchn
 libxenevtchn: libs-$(XEN_TARGET_ARCH)/evtchn/libxenevtchn.a
+libs-$(XEN_TARGET_ARCH)/evtchn/libxenevtchn.a: libxentoolcore
 libs-$(XEN_TARGET_ARCH)/evtchn/libxenevtchn.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/evtchn
 
@@ -414,6 +415,7 @@ libs-$(XEN_TARGET_ARCH)/evtchn/libxenevtchn.a: mk-headers-$(XEN_TARGET_ARCH) $(N
 
 .PHONY: libxengnttab
 libxengnttab: libs-$(XEN_TARGET_ARCH)/gnttab/libxengnttab.a
+libs-$(XEN_TARGET_ARCH)/gnttab/libxengnttab.a: libxentoolcore libxentoollog
 libs-$(XEN_TARGET_ARCH)/gnttab/libxengnttab.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/gnttab
 
@@ -423,6 +425,7 @@ libs-$(XEN_TARGET_ARCH)/gnttab/libxengnttab.a: mk-headers-$(XEN_TARGET_ARCH) $(N
 
 .PHONY: libxencall
 libxencall: libs-$(XEN_TARGET_ARCH)/call/libxencall.a
+libs-$(XEN_TARGET_ARCH)/call/libxencall.a: libxentoolcore
 libs-$(XEN_TARGET_ARCH)/call/libxencall.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/call
 
@@ -432,6 +435,7 @@ libs-$(XEN_TARGET_ARCH)/call/libxencall.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLI
 
 .PHONY: libxenforeignmemory
 libxenforeignmemory: libs-$(XEN_TARGET_ARCH)/foreignmemory/libxenforeignmemory.a
+libs-$(XEN_TARGET_ARCH)/foreignmemory/libxenforeignmemory.a: libxentoolcore
 libs-$(XEN_TARGET_ARCH)/foreignmemory/libxenforeignmemory.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/foreignmemory
 
@@ -441,6 +445,7 @@ libs-$(XEN_TARGET_ARCH)/foreignmemory/libxenforeignmemory.a: mk-headers-$(XEN_TA
 
 .PHONY: libxendevicemodel
 libxendevicemodel: libs-$(XEN_TARGET_ARCH)/devicemodel/libxendevicemodel.a
+libs-$(XEN_TARGET_ARCH)/devicemodel/libxendevicemodel.a: libxentoolcore libxentoollog libxencall
 libs-$(XEN_TARGET_ARCH)/devicemodel/libxendevicemodel.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/devicemodel
 
Signature · 1 line
2.26.2
#2 lore raw

Re: [PATCH II v2 01/17] stubdom: add correct dependencies for Xen libraries

Hello,

Juergen Gross, le lun. 17 août 2020 11:49:06 +0200, a ecrit:

stubdom/Makefile libs-$(XEN_TARGET_ARCH)/toollog/libxentoollog.a: mk-headers-$(XEN_TARGET_ARCH) $ · line 408

Quoted 8 lines

The stubdom Makefile is missing several dependencies between Xen libraries. Add them.

stubdom/Makefile +1 -0
@@ -405,6 +405,7 @@ libs-$(XEN_TARGET_ARCH)/toollog/libxentoollog.a: mk-headers-$(XEN_TARGET_ARCH) $
 
 .PHONY: libxenevtchn
 libxenevtchn: libs-$(XEN_TARGET_ARCH)/evtchn/libxenevtchn.a
+libs-$(XEN_TARGET_ARCH)/evtchn/libxenevtchn.a: libxentoolcore

I see

evtchn/Makefile:USELIBS := toollog toolcore

So it'd actually need libxentoollog as well?

stubdom/Makefile libs-$(XEN_TARGET_ARCH)/gnttab/libxengnttab.a: mk-headers-$(XEN_TARGET_ARCH) $(N · line 428

Quoted 5 lines
stubdom/Makefile +1 -0
@@ -423,6 +425,7 @@ libs-$(XEN_TARGET_ARCH)/gnttab/libxengnttab.a: mk-headers-$(XEN_TARGET_ARCH) $(N
 
 .PHONY: libxencall
 libxencall: libs-$(XEN_TARGET_ARCH)/call/libxencall.a
+libs-$(XEN_TARGET_ARCH)/call/libxencall.a: libxentoolcore

Same with

call/Makefile:USELIBS := toollog toolcore

?

stubdom/Makefile libs-$(XEN_TARGET_ARCH)/call/libxencall.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLI · line 438

Quoted 5 lines
stubdom/Makefile +1 -0
@@ -432,6 +435,7 @@ libs-$(XEN_TARGET_ARCH)/call/libxencall.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLI
 
 .PHONY: libxenforeignmemory
 libxenforeignmemory: libs-$(XEN_TARGET_ARCH)/foreignmemory/libxenforeignmemory.a
+libs-$(XEN_TARGET_ARCH)/foreignmemory/libxenforeignmemory.a: libxentoolcore

Same with

foreignmemory/Makefile:USELIBS := toollog toolcore

?

Possibly they are actually already coming from somewhere by transitivity, but it'd probably better to just make sure we match Makefiles' USELIBS.

Samuel

#3 lore raw

Re: [PATCH II v2 01/17] stubdom: add correct dependencies for Xen libraries

Quoted 38 lines · Samuel Thibault

Hello,

Juergen Gross, le lun. 17 août 2020 11:49:06 +0200, a ecrit:

stubdom/Makefile libs-$(XEN_TARGET_ARCH)/toollog/libxentoollog.a: mk-headers-$(XEN_TARGET_ARCH) $ · line 408

Quoted 8 lines

The stubdom Makefile is missing several dependencies between Xen libraries. Add them.

stubdom/Makefile +1 -0
@@ -405,6 +405,7 @@ libs-$(XEN_TARGET_ARCH)/toollog/libxentoollog.a: mk-headers-$(XEN_TARGET_ARCH) $
 
  .PHONY: libxenevtchn
  libxenevtchn: libs-$(XEN_TARGET_ARCH)/evtchn/libxenevtchn.a
+libs-$(XEN_TARGET_ARCH)/evtchn/libxenevtchn.a: libxentoolcore

I see

evtchn/Makefile:USELIBS := toollog toolcore

So it'd actually need libxentoollog as well?

stubdom/Makefile libs-$(XEN_TARGET_ARCH)/gnttab/libxengnttab.a: mk-headers-$(XEN_TARGET_ARCH) $(N · line 428

Quoted 5 lines
stubdom/Makefile +1 -0
@@ -423,6 +425,7 @@ libs-$(XEN_TARGET_ARCH)/gnttab/libxengnttab.a: mk-headers-$(XEN_TARGET_ARCH) $(N
 
  .PHONY: libxencall
  libxencall: libs-$(XEN_TARGET_ARCH)/call/libxencall.a
+libs-$(XEN_TARGET_ARCH)/call/libxencall.a: libxentoolcore

Same with

call/Makefile:USELIBS := toollog toolcore

?

stubdom/Makefile libs-$(XEN_TARGET_ARCH)/call/libxencall.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLI · line 438

Quoted 5 lines
stubdom/Makefile +1 -0
@@ -432,6 +435,7 @@ libs-$(XEN_TARGET_ARCH)/call/libxencall.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLI
 
  .PHONY: libxenforeignmemory
  libxenforeignmemory: libs-$(XEN_TARGET_ARCH)/foreignmemory/libxenforeignmemory.a
+libs-$(XEN_TARGET_ARCH)/foreignmemory/libxenforeignmemory.a: libxentoolcore

Same with

Quoted 7 lines

foreignmemory/Makefile:USELIBS := toollog toolcore

?

Possibly they are actually already coming from somewhere by transitivity, but it'd probably better to just make sure we match Makefiles' USELIBS.

Yes. Thanks for catching those.

When all libraries have been switched to the USELIBS scheme I'll add a patch using those variables in the stubdom Makefile, too. This will avoid duplicate work when adding new libs or changing dependencies.

Juergen

#4 lore raw

PATCH v2 2/17 tools: drop explicit path specifications for qemu build

In reply to Juergen Gross

Since more than three years now qemu is capable to set the needed include and library paths for the Xen libraries via pkg-config.

So drop the specification of those paths in tools/Makefile. This will enable to move libxenctrl away from tools/libxc, as qemu's configure script has special treatment of this path.

---
 tools/Makefile | 26 +-------------------------
 1 file changed, 1 insertion(+), 25 deletions(-)
tools/Makefile +1 -25
index 198b239edc..7c9f9fc900 100644
@@ -245,32 +245,8 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		-DXC_WANT_COMPAT_GNTTAB_API=1 \
 		-DXC_WANT_COMPAT_MAP_FOREIGN_API=1 \
 		-DXC_WANT_COMPAT_DEVICEMODEL_API=1 \
-		-I$(XEN_ROOT)/tools/include \
-		-I$(XEN_ROOT)/tools/libs/toolcore/include \
-		-I$(XEN_ROOT)/tools/libs/toollog/include \
-		-I$(XEN_ROOT)/tools/libs/evtchn/include \
-		-I$(XEN_ROOT)/tools/libs/gnttab/include \
-		-I$(XEN_ROOT)/tools/libs/foreignmemory/include \
-		-I$(XEN_ROOT)/tools/libs/devicemodel/include \
-		-I$(XEN_ROOT)/tools/libxc/include \
-		-I$(XEN_ROOT)/tools/xenstore/include \
-		-I$(XEN_ROOT)/tools/xenstore/compat/include \
 		$(EXTRA_CFLAGS_QEMU_XEN)" \
-		--extra-ldflags="-L$(XEN_ROOT)/tools/libxc \
-		-L$(XEN_ROOT)/tools/xenstore \
-		-L$(XEN_ROOT)/tools/libs/toolcore \
-		-L$(XEN_ROOT)/tools/libs/evtchn \
-		-L$(XEN_ROOT)/tools/libs/gnttab \
-		-L$(XEN_ROOT)/tools/libs/foreignmemory \
-		-L$(XEN_ROOT)/tools/libs/devicemodel \
-		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/toolcore \
-		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/toollog \
-		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/evtchn \
-		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/gnttab \
-		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/call \
-		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/foreignmemory \
-		-Wl,-rpath-link=$(XEN_ROOT)/tools/libs/devicemodel \
-		$(QEMU_UPSTREAM_RPATH)" \
+		--extra-ldflags="$(QEMU_UPSTREAM_RPATH)" \
 		--bindir=$(LIBEXEC_BIN) \
 		--datadir=$(SHAREDIR)/qemu-xen \
 		--localstatedir=$(localstatedir) \
Signature · 1 line
2.26.2
#5 lore raw

PATCH v2 3/17 tools: tweak tools/libs/libs.mk for being able to support libxenctrl

In reply to Juergen Gross

tools/libs/libs.mk needs to be modified for being able to support building libxenctrl, as the pkg-config file of that library is not following the same conventions as those of the other libraries.

So add support for specifying PKG_CONFIG before including libs.mk.

In order to make life easier for unstable libraries like libxenctrl set MAJOR and MINOR automatically to the Xen-version and 0 when not specified. This removes the need to bump the versions of unstable libraries when switching to a new Xen version.

As all libraries built via libs.mk require a map file generate a dummy one in case there is none existing. This again will help avoiding the need to bump the libarary version in the map file of an unstable library in case it is exporting all symbols.

The clean target is missing the removal of _paths.h.

Finally drop the foreach loop when setting PKG_CONFIG_LOCAL, as there is always only one element in PKG_CONFIG.

---
 tools/libs/libs.mk | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)
tools/libs/libs.mk +14 -7
index 19efc5e743..8b1ca2aa62 100644
@@ -1,10 +1,13 @@
 # Common Makefile for building a lib.
 #
 # Variables taken as input:
-#   MAJOR:   major version of lib
-#   MINOR:   minor version of lib
+#   PKG_CONFIG: name of pkg-config file (xen$(LIBNAME).pc if empty)
+#   MAJOR:   major version of lib (Xen version if empty)
+#   MINOR:   minor version of lib (0 if empty)
 
 LIBNAME := $(notdir $(CURDIR))
+MAJOR ?= $(shell $(XEN_ROOT)/version.sh $(XEN_ROOT)/xen/Makefile)
+MINOR ?= 0
 
 SHLIB_LDFLAGS += -Wl,--version-script=libxen$(LIBNAME).map
 
@@ -22,7 +25,7 @@ ifneq ($(nosharedlibs),y)
 LIB += libxen$(LIBNAME).so
 endif
 
-PKG_CONFIG := xen$(LIBNAME).pc
+PKG_CONFIG ?= xen$(LIBNAME).pc
 PKG_CONFIG_VERSION := $(MAJOR).$(MINOR)
 
 ifneq ($(CONFIG_LIBXC_MINIOS),y)
@@ -32,7 +35,7 @@ $(PKG_CONFIG_INST): PKG_CONFIG_INCDIR = $(includedir)
 $(PKG_CONFIG_INST): PKG_CONFIG_LIBDIR = $(libdir)
 endif
 
-PKG_CONFIG_LOCAL := $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc))
+PKG_CONFIG_LOCAL := $(PKG_CONFIG_DIR)/$(PKG_CONFIG)
 
 LIBHEADER ?= xen$(LIBNAME).h
 LIBHEADERS = $(foreach h, $(LIBHEADER), include/$(h))
@@ -45,7 +48,7 @@ $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR)
 all: build
 
 .PHONY: build
-build: libs
+build: libs libxen$(LIBNAME).map
 
 .PHONY: libs
 libs: headers.chk $(LIB) $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL)
@@ -64,6 +67,9 @@ endif
 
 headers.chk: $(LIBHEADERSGLOB) $(AUTOINCS)
 
+libxen$(LIBNAME).map:
+	echo 'VERS_$(MAJOR).$(MINOR) { global: *; };' >$@
+
 $(LIBHEADERSGLOB): $(LIBHEADERS)
 	for i in $(realpath $(LIBHEADERS)); do ln -sf $$i $(XEN_ROOT)/tools/include; done
 
@@ -87,7 +93,7 @@ install: build
 	$(SYMLINK_SHLIB) libxen$(LIBNAME).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxen$(LIBNAME).so.$(MAJOR)
 	$(SYMLINK_SHLIB) libxen$(LIBNAME).so.$(MAJOR) $(DESTDIR)$(libdir)/libxen$(LIBNAME).so
 	for i in $(LIBHEADERS); do $(INSTALL_DATA) $$i $(DESTDIR)$(includedir); done
-	$(INSTALL_DATA) xen$(LIBNAME).pc $(DESTDIR)$(PKG_INSTALLDIR)
+	$(INSTALL_DATA) $(PKG_CONFIG) $(DESTDIR)$(PKG_INSTALLDIR)
 
 .PHONY: uninstall
 uninstall:
@@ -107,8 +113,9 @@ clean:
 	rm -rf *.rpm $(LIB) *~ $(DEPS_RM) $(LIB_OBJS) $(PIC_OBJS)
 	rm -f libxen$(LIBNAME).so.$(MAJOR).$(MINOR) libxen$(LIBNAME).so.$(MAJOR)
 	rm -f headers.chk
-	rm -f xen$(LIBNAME).pc
+	rm -f $(PKG_CONFIG)
 	rm -f $(LIBHEADERSGLOB)
+	rm -f _paths.h
 
 .PHONY: distclean
 distclean: clean
Signature · 1 line
2.26.2
#6 lore raw

PATCH v2 4/17 tools/python: drop libxenguest from setup.py

In reply to Juergen Gross

There is not a single wrapper for a libxenguest function defined. So drop libxenguest from tools/python/setup.py.

---
 tools/python/setup.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/python/setup.py +2 -2
index 8faf1c0ddc..44696b3998 100644
@@ -21,8 +21,8 @@ xc = Extension("xc",
                                       PATH_LIBXC + "/include",
                                       "xen/lowlevel/xc" ],
                library_dirs       = [ PATH_LIBXC ],
-               libraries          = [ "xenctrl", "xenguest" ],
-               depends            = [ PATH_LIBXC + "/libxenctrl.so", PATH_LIBXC + "/libxenguest.so" ],
+               libraries          = [ "xenctrl" ],
+               depends            = [ PATH_LIBXC + "/libxenctrl.so" ],
                extra_link_args    = [ "-Wl,-rpath-link="+PATH_LIBXENTOOLLOG ],
                sources            = [ "xen/lowlevel/xc/xc.c" ])
 
Signature · 1 line
2.26.2
#7 lore raw

PATCH v2 5/17 tools: fix pkg-config file for libxenguest

In reply to Juergen Gross

The pkg-config file for libxenguest is missing the private dependency on libxenctrl.

---
 tools/libxc/xenguest.pc.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxc/xenguest.pc.in +1 -1
index 225ac0b9c8..6b43b67e63 100644
@@ -7,4 +7,4 @@ Description: The Xenguest library for Xen hypervisor
 Version: @@version@@
 Cflags: -I${includedir}
 Libs: @@libsflag@@${libdir} -lxenguest
-Requires.private: xentoollog,xencall,xenforeignmemory,xenevtchn
+Requires.private: xentoollog,xencall,xenforeignmemory,xenevtchn,xencontrol
Signature · 1 line
2.26.2
#8 lore raw

PATCH v2 6/17 tools: don't assume libxenguest and libxenctrl to be in same directory

In reply to Juergen Gross

There are quite some places in Makefiles assuming libxenguest and libxenctrl being built in the same directory via a single Makefile.

Drop this assumption by specifying the dependencies and path variables for both libraries correctly.

---
 tools/Rules.mk       | 7 +++----
 tools/libxl/Makefile | 2 +-
 tools/misc/Makefile  | 1 +
 3 files changed, 5 insertions(+), 5 deletions(-)
tools/Rules.mk +3 -4
index b36818bcaa..35d237bba6 100644
@@ -31,8 +31,7 @@ LIBS_LIBS += hypfs
 USELIBS_hypfs := toollog toolcore call
 
 XEN_libxenctrl     = $(XEN_ROOT)/tools/libxc
-# Currently libxenguest lives in the same directory as libxenctrl
-XEN_libxenguest    = $(XEN_libxenctrl)
+XEN_libxenguest    = $(XEN_ROOT)/tools/libxc
 XEN_libxenlight    = $(XEN_ROOT)/tools/libxl
 # Currently libxlutil lives in the same directory as libxenlight
 XEN_libxlutil      = $(XEN_libxenlight)
@@ -132,7 +131,7 @@ LDLIBS_libxenguest = $(SHDEPS_libxenguest) $(XEN_libxenguest)/libxenguest$(libex
 SHLIB_libxenguest  = $(SHDEPS_libxenguest) -Wl,-rpath-link=$(XEN_libxenguest)
 
 CFLAGS_libxenstore = -I$(XEN_libxenstore)/include $(CFLAGS_xeninclude)
-SHDEPS_libxenstore = $(SHLIB_libxentoolcore)
+SHDEPS_libxenstore = $(SHLIB_libxentoolcore) $(SHLIB_libxenctrl)
 LDLIBS_libxenstore = $(SHDEPS_libxenstore) $(XEN_libxenstore)/libxenstore$(libextension)
 SHLIB_libxenstore  = $(SHDEPS_libxenstore) -Wl,-rpath-link=$(XEN_libxenstore)
 ifeq ($(CONFIG_Linux),y)
@@ -159,7 +158,7 @@ CFLAGS += -O2 -fomit-frame-pointer
 endif
 
 CFLAGS_libxenlight = -I$(XEN_libxenlight) $(CFLAGS_libxenctrl) $(CFLAGS_xeninclude)
-SHDEPS_libxenlight = $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(SHLIB_libxenhypfs)
+SHDEPS_libxenlight = $(SHLIB_libxenctrl) $(SHLIB_libxenstore) $(SHLIB_libxenhypfs) $(SHLIB_libxenguest)
 LDLIBS_libxenlight = $(SHDEPS_libxenlight) $(XEN_libxenlight)/libxenlight$(libextension)
 SHLIB_libxenlight  = $(SHDEPS_libxenlight) -Wl,-rpath-link=$(XEN_libxenlight)
 
tools/libxl/Makefile +1 -1
index 0e8dfc6193..65f3968947 100644
@@ -188,7 +188,7 @@ libxl_dom.o: CFLAGS += -I$(XEN_ROOT)/tools  # include libacpi/x86.h
 libxl_x86_acpi.o: CFLAGS += -I$(XEN_ROOT)/tools
 
 SAVE_HELPER_OBJS = libxl_save_helper.o _libxl_save_msgs_helper.o
-$(SAVE_HELPER_OBJS): CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenevtchn)
+$(SAVE_HELPER_OBJS): CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenevtchn) $(CFLAGS_libxenguest)
 
 PKG_CONFIG = xenlight.pc xlutil.pc
 PKG_CONFIG_VERSION := $(MAJOR).$(MINOR)
tools/misc/Makefile +1 -0
index 9fdb13597f..e7e74db85f 100644
@@ -6,6 +6,7 @@ CFLAGS += -Werror
 CFLAGS += -include $(XEN_ROOT)/tools/config.h
 CFLAGS += $(CFLAGS_libxenevtchn)
 CFLAGS += $(CFLAGS_libxenctrl)
+CFLAGS += $(CFLAGS_libxenguest)
 CFLAGS += $(CFLAGS_xeninclude)
 CFLAGS += $(CFLAGS_libxenstore)
 
Signature · 1 line
2.26.2
#9 lore raw

PATCH v2 7/17 tools/misc: don't use libxenctrl internals from xen-hptool

In reply to Juergen Gross

xen-hptool is including private headers from tools/libxc without any need. Switch it to use official headers only.

---
 tools/misc/Makefile     | 2 --
 tools/misc/xen-hptool.c | 8 +++++---
 2 files changed, 5 insertions(+), 5 deletions(-)
tools/misc/Makefile +0 -2
index e7e74db85f..2a7f2ec42d 100644
@@ -94,8 +94,6 @@ xenhypfs: xenhypfs.o
 xenlockprof: xenlockprof.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
 
-# xen-hptool incorrectly uses libxc internals
-xen-hptool.o: CFLAGS += -I$(XEN_ROOT)/tools/libxc $(CFLAGS_libxencall)
 xen-hptool: xen-hptool.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) $(APPEND_LDFLAGS)
 
tools/misc/xen-hptool.c +5 -3
index 6e27d9cf43..7f17f24942 100644
@@ -1,9 +1,11 @@
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 #include <xenevtchn.h>
 #include <xenctrl.h>
-#include <xc_private.h>
-#include <xc_core.h>
+#include <xenguest.h>
 #include <xenstore.h>
-#include <unistd.h>
+#include <xen-tools/libs.h>
 
 static xc_interface *xch;
 
Signature · 1 line
2.26.2
#10 lore raw

PATCH v2 8/17 tools/misc: don't include xg_save_restore.h from xen-mfndump.c

In reply to Juergen Gross

xen-mfndump.c is including the libxc private header xg_save_restore.h. Avoid that by moving the definition of is_mapped() to xen-mfndump.c (it is used there only) and by duplicating the definition of M2P_SIZE() in xen-mfndump.c.

---
 tools/libxc/xg_save_restore.h | 4 ----
 tools/misc/xen-mfndump.c      | 5 ++++-
 2 files changed, 4 insertions(+), 5 deletions(-)
tools/libxc/xg_save_restore.h +0 -4
index 303081df0d..b904296997 100644
@@ -109,10 +109,6 @@ static inline int get_platform_info(xc_interface *xch, uint32_t dom,
 #define M2P_SIZE(_m)    ROUNDUP(((_m) * sizeof(xen_pfn_t)), M2P_SHIFT)
 #define M2P_CHUNKS(_m)  (M2P_SIZE((_m)) >> M2P_SHIFT)
 
-/* Returns TRUE if the PFN is currently mapped */
-#define is_mapped(pfn_type) (!((pfn_type) & 0x80000000UL))
-
-
 #define GET_FIELD(_p, _f, _w) (((_w) == 8) ? ((_p)->x64._f) : ((_p)->x32._f))
 
 #define SET_FIELD(_p, _f, _v, _w) do {          \
tools/misc/xen-mfndump.c +4 -1
index 858bd0e26b..cb15d08c7e 100644
@@ -5,7 +5,10 @@
 #include <unistd.h>
 #include <inttypes.h>
 
-#include "xg_save_restore.h"
+#include <xen-tools/libs.h>
+
+#define M2P_SIZE(_m)    ROUNDUP(((_m) * sizeof(xen_pfn_t)), 21)
+#define is_mapped(pfn_type) (!((pfn_type) & 0x80000000UL))
 
 static xc_interface *xch;
 
Signature · 1 line
2.26.2
#11 lore raw

PATCH v2 9/17 tools/misc: replace PAGE_SIZE with XC_PAGE_SIZE in xen-mfndump.c

In reply to Juergen Gross

The definition of PAGE_SIZE comes from xc_private.h, which shouldn't be used by xen-mfndump.c. Replace PAGE_SIZE by XC_PAGE_SIZE, as xc_private.h contains:

#define PAGE_SIZE XC_PAGE_SIZE

For the same reason PAGE_SHIFT_X86 needs to replaced with XC_PAGE_SHIFT.

---
 tools/misc/xen-mfndump.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
tools/misc/xen-mfndump.c +13 -13
index cb15d08c7e..92bc954ce0 100644
@@ -207,7 +207,7 @@ int dump_ptes_func(int argc, char *argv[])
         goto out;
     }
 
-    page = xc_map_foreign_range(xch, domid, PAGE_SIZE, PROT_READ,
+    page = xc_map_foreign_range(xch, domid, XC_PAGE_SIZE, PROT_READ,
                                 minfo.p2m_table[pfn]);
     if ( !page )
     {
@@ -216,7 +216,7 @@ int dump_ptes_func(int argc, char *argv[])
         goto out;
     }
 
-    pte_num = PAGE_SIZE / 8;
+    pte_num = XC_PAGE_SIZE / 8;
 
     printf(" --- Dumping %d PTEs for domain %d ---\n", pte_num, domid);
     printf(" Guest Width: %u, PT Levels: %u P2M size: = %lu\n",
@@ -252,7 +252,7 @@ int dump_ptes_func(int argc, char *argv[])
 
  out:
     if ( page )
-        munmap(page, PAGE_SIZE);
+        munmap(page, XC_PAGE_SIZE);
     xc_unmap_domain_meminfo(xch, &minfo);
     munmap(m2p_table, M2P_SIZE(max_mfn));
     return rc;
@@ -290,7 +290,7 @@ int lookup_pte_func(int argc, char *argv[])
         return -1;
     }
 
-    pte_num = PAGE_SIZE / 8;
+    pte_num = XC_PAGE_SIZE / 8;
 
     printf(" --- Lookig for PTEs mapping mfn 0x%lx for domain %d ---\n",
            mfn, domid);
@@ -302,7 +302,7 @@ int lookup_pte_func(int argc, char *argv[])
         if ( !(minfo.pfn_type[i] & XEN_DOMCTL_PFINFO_LTABTYPE_MASK) )
             continue;
 
-        page = xc_map_foreign_range(xch, domid, PAGE_SIZE, PROT_READ,
+        page = xc_map_foreign_range(xch, domid, XC_PAGE_SIZE, PROT_READ,
                                     minfo.p2m_table[i]);
         if ( !page )
             continue;
@@ -312,15 +312,15 @@ int lookup_pte_func(int argc, char *argv[])
             uint64_t pte = ((const uint64_t*)page)[j];
 
 #define __MADDR_BITS_X86  ((minfo.guest_width == 8) ? 52 : 44)
-#define __MFN_MASK_X86    ((1ULL << (__MADDR_BITS_X86 - PAGE_SHIFT_X86)) - 1)
-            if ( ((pte >> PAGE_SHIFT_X86) & __MFN_MASK_X86) == mfn)
+#define __MFN_MASK_X86    ((1ULL << (__MADDR_BITS_X86 - XC_PAGE_SHIFT)) - 1)
+            if ( ((pte >> XC_PAGE_SHIFT) & __MFN_MASK_X86) == mfn)
                 printf("  0x%lx <-- [0x%lx][%lu]: 0x%"PRIx64"\n",
                        mfn, minfo.p2m_table[i], j, pte);
 #undef __MADDR_BITS_X86
 #undef __MFN_MASK_X8
         }
 
-        munmap(page, PAGE_SIZE);
+        munmap(page, XC_PAGE_SIZE);
         page = NULL;
     }
 
@@ -355,8 +355,8 @@ int memcmp_mfns_func(int argc, char *argv[])
         return -1;
     }
 
-    page1 = xc_map_foreign_range(xch, domid1, PAGE_SIZE, PROT_READ, mfn1);
-    page2 = xc_map_foreign_range(xch, domid2, PAGE_SIZE, PROT_READ, mfn2);
+    page1 = xc_map_foreign_range(xch, domid1, XC_PAGE_SIZE, PROT_READ, mfn1);
+    page2 = xc_map_foreign_range(xch, domid2, XC_PAGE_SIZE, PROT_READ, mfn2);
     if ( !page1 || !page2 )
     {
         ERROR("Failed to map either 0x%lx[dom %d] or 0x%lx[dom %d]\n",
@@ -368,13 +368,13 @@ int memcmp_mfns_func(int argc, char *argv[])
     printf(" --- Comparing the content of 2 MFNs ---\n");
     printf(" 1: 0x%lx[dom %d], 2: 0x%lx[dom %d]\n",
            mfn1, domid1, mfn2, domid2);
-    printf("  memcpy(1, 2) = %d\n", memcmp(page1, page2, PAGE_SIZE));
+    printf("  memcpy(1, 2) = %d\n", memcmp(page1, page2, XC_PAGE_SIZE));
 
  out:
     if ( page1 )
-        munmap(page1, PAGE_SIZE);
+        munmap(page1, XC_PAGE_SIZE);
     if ( page2 )
-        munmap(page2, PAGE_SIZE);
+        munmap(page2, XC_PAGE_SIZE);
     return rc;
 }
 
Signature · 1 line
2.26.2
#12 lore raw

PATCH v2 10/17 tools/misc: drop all libxc internals from xen-mfndump.c

In reply to Juergen Gross

The last libxc internal used by xen-mfndump.c is the ERROR() macro. Add a simple definition for that macro to xen-mfndump.c and replace the libxc private header includes by official ones.

---
 tools/misc/Makefile      |  2 --
 tools/misc/xen-mfndump.c | 13 +++++++++----
 2 files changed, 9 insertions(+), 6 deletions(-)
tools/misc/Makefile +0 -2
index 2a7f2ec42d..7d37f297a9 100644
@@ -99,8 +99,6 @@ xen-hptool: xen-hptool.o
 
 xenhypfs.o: CFLAGS += $(CFLAGS_libxenhypfs)
 
-# xen-mfndump incorrectly uses libxc internals
-xen-mfndump.o: CFLAGS += -I$(XEN_ROOT)/tools/libxc $(CFLAGS_libxencall)
 xen-mfndump: xen-mfndump.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(APPEND_LDFLAGS)
 
tools/misc/xen-mfndump.c +9 -4
index 92bc954ce0..62121bd241 100644
@@ -1,15 +1,20 @@
-#define XC_WANT_COMPAT_MAP_FOREIGN_API
-#include <xenctrl.h>
-#include <xc_private.h>
-#include <xc_core.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/mman.h>
 #include <unistd.h>
 #include <inttypes.h>
 
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
+#include <xenctrl.h>
+#include <xenguest.h>
+
 #include <xen-tools/libs.h>
 
 #define M2P_SIZE(_m)    ROUNDUP(((_m) * sizeof(xen_pfn_t)), 21)
 #define is_mapped(pfn_type) (!((pfn_type) & 0x80000000UL))
 
+#define ERROR(msg, args...) fprintf(stderr, msg, ## args)
+
 static xc_interface *xch;
 
 int help_func(int argc, char *argv[])
Signature · 1 line
2.26.2
#13 lore raw

PATCH v2 11/17 tools/libxc: remove unused headers xc_efi.h and xc_elf.h

In reply to Juergen Gross

Remove xc_efi.h and xc_elf.h as they aren't used anywhere.

---
 tools/libxc/xc_efi.h | 158 -------------------------------------------
 tools/libxc/xc_elf.h |  16 -----
 2 files changed, 174 deletions(-)
 delete mode 100644 tools/libxc/xc_efi.h
 delete mode 100644 tools/libxc/xc_elf.h
tools/libxc/xc_efi.h deleted +0 -158
deleted file mode 100644
index dbe105be8f..0000000000
@@ -1,158 +0,0 @@
-/*
- * Extensible Firmware Interface
- * Based on 'Extensible Firmware Interface Specification' version 0.9, April 30, 1999
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 1999 VA Linux Systems
- * Copyright (C) 1999 Walt Drummond <[email protected]>
- * Copyright (C) 1999, 2002-2003 Hewlett-Packard Co.
- *      David Mosberger-Tang <[email protected]>
- *      Stephane Eranian <[email protected]>
- */
-
-#ifndef XC_EFI_H
-#define XC_EFI_H
-
-/* definitions from xen/include/asm-ia64/linux-xen/linux/efi.h */
-
-typedef struct {
-        uint8_t b[16];
-} efi_guid_t;
-
-#define EFI_GUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \
-((efi_guid_t) \
-{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \
-  (b) & 0xff, ((b) >> 8) & 0xff, \
-  (c) & 0xff, ((c) >> 8) & 0xff, \
-  (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
-
-/*
- * Generic EFI table header
- */
-typedef struct {
-	uint64_t signature;
-	uint32_t revision;
-	uint32_t headersize;
-	uint32_t crc32;
-	uint32_t reserved;
-} efi_table_hdr_t;
-
-/*
- * Memory map descriptor:
- */
-
-/* Memory types: */
-#define EFI_RESERVED_TYPE                0
-#define EFI_LOADER_CODE                  1
-#define EFI_LOADER_DATA                  2
-#define EFI_BOOT_SERVICES_CODE           3
-#define EFI_BOOT_SERVICES_DATA           4
-#define EFI_RUNTIME_SERVICES_CODE        5
-#define EFI_RUNTIME_SERVICES_DATA        6
-#define EFI_CONVENTIONAL_MEMORY          7
-#define EFI_UNUSABLE_MEMORY              8
-#define EFI_ACPI_RECLAIM_MEMORY          9
-#define EFI_ACPI_MEMORY_NVS             10
-#define EFI_MEMORY_MAPPED_IO            11
-#define EFI_MEMORY_MAPPED_IO_PORT_SPACE 12
-#define EFI_PAL_CODE                    13
-#define EFI_MAX_MEMORY_TYPE             14
-
-/* Attribute values: */
-#define EFI_MEMORY_UC           ((uint64_t)0x0000000000000001ULL)    /* uncached */
-#define EFI_MEMORY_WC           ((uint64_t)0x0000000000000002ULL)    /* write-coalescing */
-#define EFI_MEMORY_WT           ((uint64_t)0x0000000000000004ULL)    /* write-through */
-#define EFI_MEMORY_WB           ((uint64_t)0x0000000000000008ULL)    /* write-back */
-#define EFI_MEMORY_WP           ((uint64_t)0x0000000000001000ULL)    /* write-protect */
-#define EFI_MEMORY_RP           ((uint64_t)0x0000000000002000ULL)    /* read-protect */
-#define EFI_MEMORY_XP           ((uint64_t)0x0000000000004000ULL)    /* execute-protect */
-#define EFI_MEMORY_RUNTIME      ((uint64_t)0x8000000000000000ULL)    /* range requires runtime mapping */
-#define EFI_MEMORY_DESCRIPTOR_VERSION   1
-
-#define EFI_PAGE_SHIFT          12
-
-/*
- * For current x86 implementations of EFI, there is
- * additional padding in the mem descriptors.  This is not
- * the case in ia64.  Need to have this fixed in the f/w.
- */
-typedef struct {
-        uint32_t type;
-        uint32_t pad;
-        uint64_t phys_addr;
-        uint64_t virt_addr;
-        uint64_t num_pages;
-        uint64_t attribute;
-#if defined (__i386__)
-        uint64_t pad1;
-#endif
-} efi_memory_desc_t;
-
-/*
- * EFI Runtime Services table
- */
-#define EFI_RUNTIME_SERVICES_SIGNATURE	((uint64_t)0x5652453544e5552ULL)
-#define EFI_RUNTIME_SERVICES_REVISION	0x00010000
-
-typedef struct {
-	efi_table_hdr_t hdr;
-	unsigned long get_time;
-	unsigned long set_time;
-	unsigned long get_wakeup_time;
-	unsigned long set_wakeup_time;
-	unsigned long set_virtual_address_map;
-	unsigned long convert_pointer;
-	unsigned long get_variable;
-	unsigned long get_next_variable;
-	unsigned long set_variable;
-	unsigned long get_next_high_mono_count;
-	unsigned long reset_system;
-} efi_runtime_services_t;
-
-/*
- *  EFI Configuration Table and GUID definitions
- */
-#define NULL_GUID \
-    EFI_GUID(  0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 )
-#define ACPI_20_TABLE_GUID    \
-    EFI_GUID(  0x8868e871, 0xe4f1, 0x11d3, 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 )
-#define SAL_SYSTEM_TABLE_GUID    \
-    EFI_GUID(  0xeb9d2d32, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d )
-
-typedef struct {
-	efi_guid_t guid;
-	unsigned long table;
-} efi_config_table_t;
-
-#define EFI_SYSTEM_TABLE_SIGNATURE ((uint64_t)0x5453595320494249ULL)
-#define EFI_SYSTEM_TABLE_REVISION  ((1 << 16) | 00)
-
-typedef struct {
-	efi_table_hdr_t hdr;
-	unsigned long fw_vendor;	/* physical addr of CHAR16 vendor string */
-	uint32_t fw_revision;
-	unsigned long con_in_handle;
-	unsigned long con_in;
-	unsigned long con_out_handle;
-	unsigned long con_out;
-	unsigned long stderr_handle;
-	unsigned long stderr;
-	efi_runtime_services_t *runtime;
-	unsigned long boottime;
-	unsigned long nr_tables;
-	unsigned long tables;
-} efi_system_table_t;
-
-#endif /* XC_EFI_H */
tools/libxc/xc_elf.h deleted +0 -16
deleted file mode 100644
index acbc0280bd..0000000000
@@ -1,16 +0,0 @@
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <xen/libelf/elfstructs.h>
Signature · 1 line
2.26.2
#14 lore raw

PATCH v2 12/17 tools/libxc: move xc_[un]map_domain_meminfo() into new source xg_domain.c

In reply to Juergen Gross

Move xc_[un]map_domain_meminfo() functions to new source xg_domain.c as they are defined in include/xenguest.h and should be in libxenguest.

---
 tools/libxc/Makefile    |   4 +-
 tools/libxc/xc_domain.c | 126 ---------------------------------
 tools/libxc/xg_domain.c | 149 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 152 insertions(+), 127 deletions(-)
 create mode 100644 tools/libxc/xg_domain.c
tools/libxc/Makefile +3 -1
index c1e41a8ee9..f3f1edc07b 100644
@@ -52,7 +52,9 @@ CTRL_SRCS-y       += xc_gnttab_compat.c
 CTRL_SRCS-y       += xc_devicemodel_compat.c
 
 GUEST_SRCS-y :=
-GUEST_SRCS-y += xg_private.c xc_suspend.c
+GUEST_SRCS-y += xg_private.c
+GUEST_SRCS-y += xg_domain.c
+GUEST_SRCS-y += xc_suspend.c
 ifeq ($(CONFIG_MIGRATE),y)
 GUEST_SRCS-y += xc_sr_common.c
 GUEST_SRCS-$(CONFIG_X86) += xc_sr_common_x86.c
tools/libxc/xc_domain.c +0 -126

132 lines not on this page · raw message

tools/libxc/xg_domain.c new file +149 -0

149 lines not on this page · raw message

Signature · 1 line
2.26.2
#15 lore raw

PATCH v2 13/17 tools/libxc: rename all libxenguest sources to xg_*

In reply to Juergen Gross

Some sources of libxenguest are named xg_*.c and some xc_*.c. Rename the xc_*.c files to xg_*.c.

---
 tools/libxc/Makefile                          | 59 ++++++++++---------
 .../libxc/{xc_cpuid_x86.c => xg_cpuid_x86.c}  |  0
 tools/libxc/{xc_dom_arm.c => xg_dom_arm.c}    |  0
 ...imageloader.c => xg_dom_armzimageloader.c} |  0
 ...{xc_dom_binloader.c => xg_dom_binloader.c} |  0
 tools/libxc/{xc_dom_boot.c => xg_dom_boot.c}  |  0
 ...bzimageloader.c => xg_dom_bzimageloader.c} |  0
 ...m_compat_linux.c => xg_dom_compat_linux.c} |  0
 tools/libxc/{xc_dom_core.c => xg_dom_core.c}  |  0
 ...compress_lz4.c => xg_dom_decompress_lz4.c} |  0
 ...ss_unsafe.c => xg_dom_decompress_unsafe.c} |  0
 ...ip2.c => xg_dom_decompress_unsafe_bzip2.c} |  0
 ...lzma.c => xg_dom_decompress_unsafe_lzma.c} |  0
 ...o1x.c => xg_dom_decompress_unsafe_lzo1x.c} |  0
 ...afe_xz.c => xg_dom_decompress_unsafe_xz.c} |  0
 ...{xc_dom_elfloader.c => xg_dom_elfloader.c} |  0
 ...{xc_dom_hvmloader.c => xg_dom_hvmloader.c} |  0
 tools/libxc/{xc_dom_x86.c => xg_dom_x86.c}    |  0
 .../libxc/{xc_nomigrate.c => xg_nomigrate.c}  |  0
 .../{xc_offline_page.c => xg_offline_page.c}  |  0
 .../libxc/{xc_sr_common.c => xg_sr_common.c}  |  0
 ...{xc_sr_common_x86.c => xg_sr_common_x86.c} |  0
 ..._common_x86_pv.c => xg_sr_common_x86_pv.c} |  0
 .../{xc_sr_restore.c => xg_sr_restore.c}      |  0
 ...tore_x86_hvm.c => xg_sr_restore_x86_hvm.c} |  0
 ...estore_x86_pv.c => xg_sr_restore_x86_pv.c} |  0
 tools/libxc/{xc_sr_save.c => xg_sr_save.c}    |  0
 ...sr_save_x86_hvm.c => xg_sr_save_x86_hvm.c} |  0
 ...c_sr_save_x86_pv.c => xg_sr_save_x86_pv.c} |  0
 tools/libxc/{xc_suspend.c => xg_suspend.c}    |  0
 30 files changed, 30 insertions(+), 29 deletions(-)
 rename tools/libxc/{xc_cpuid_x86.c => xg_cpuid_x86.c} (100%)
 rename tools/libxc/{xc_dom_arm.c => xg_dom_arm.c} (100%)
 rename tools/libxc/{xc_dom_armzimageloader.c => xg_dom_armzimageloader.c} (100%)
 rename tools/libxc/{xc_dom_binloader.c => xg_dom_binloader.c} (100%)
 rename tools/libxc/{xc_dom_boot.c => xg_dom_boot.c} (100%)
 rename tools/libxc/{xc_dom_bzimageloader.c => xg_dom_bzimageloader.c} (100%)
 rename tools/libxc/{xc_dom_compat_linux.c => xg_dom_compat_linux.c} (100%)
 rename tools/libxc/{xc_dom_core.c => xg_dom_core.c} (100%)
 rename tools/libxc/{xc_dom_decompress_lz4.c => xg_dom_decompress_lz4.c} (100%)
 rename tools/libxc/{xc_dom_decompress_unsafe.c => xg_dom_decompress_unsafe.c} (100%)
 rename tools/libxc/{xc_dom_decompress_unsafe_bzip2.c => xg_dom_decompress_unsafe_bzip2.c} (100%)
 rename tools/libxc/{xc_dom_decompress_unsafe_lzma.c => xg_dom_decompress_unsafe_lzma.c} (100%)
 rename tools/libxc/{xc_dom_decompress_unsafe_lzo1x.c => xg_dom_decompress_unsafe_lzo1x.c} (100%)
 rename tools/libxc/{xc_dom_decompress_unsafe_xz.c => xg_dom_decompress_unsafe_xz.c} (100%)
 rename tools/libxc/{xc_dom_elfloader.c => xg_dom_elfloader.c} (100%)
 rename tools/libxc/{xc_dom_hvmloader.c => xg_dom_hvmloader.c} (100%)
 rename tools/libxc/{xc_dom_x86.c => xg_dom_x86.c} (100%)
 rename tools/libxc/{xc_nomigrate.c => xg_nomigrate.c} (100%)
 rename tools/libxc/{xc_offline_page.c => xg_offline_page.c} (100%)
 rename tools/libxc/{xc_sr_common.c => xg_sr_common.c} (100%)
 rename tools/libxc/{xc_sr_common_x86.c => xg_sr_common_x86.c} (100%)
 rename tools/libxc/{xc_sr_common_x86_pv.c => xg_sr_common_x86_pv.c} (100%)
 rename tools/libxc/{xc_sr_restore.c => xg_sr_restore.c} (100%)
 rename tools/libxc/{xc_sr_restore_x86_hvm.c => xg_sr_restore_x86_hvm.c} (100%)
 rename tools/libxc/{xc_sr_restore_x86_pv.c => xg_sr_restore_x86_pv.c} (100%)
 rename tools/libxc/{xc_sr_save.c => xg_sr_save.c} (100%)
 rename tools/libxc/{xc_sr_save_x86_hvm.c => xg_sr_save_x86_hvm.c} (100%)
 rename tools/libxc/{xc_sr_save_x86_pv.c => xg_sr_save_x86_pv.c} (100%)
 rename tools/libxc/{xc_suspend.c => xg_suspend.c} (100%)
tools/libxc/Makefile +30 -29
index f3f1edc07b..e1b2c24106 100644
@@ -54,20 +54,20 @@ CTRL_SRCS-y       += xc_devicemodel_compat.c
 GUEST_SRCS-y :=
 GUEST_SRCS-y += xg_private.c
 GUEST_SRCS-y += xg_domain.c
-GUEST_SRCS-y += xc_suspend.c
+GUEST_SRCS-y += xg_suspend.c
 ifeq ($(CONFIG_MIGRATE),y)
-GUEST_SRCS-y += xc_sr_common.c
-GUEST_SRCS-$(CONFIG_X86) += xc_sr_common_x86.c
-GUEST_SRCS-$(CONFIG_X86) += xc_sr_common_x86_pv.c
-GUEST_SRCS-$(CONFIG_X86) += xc_sr_restore_x86_pv.c
-GUEST_SRCS-$(CONFIG_X86) += xc_sr_restore_x86_hvm.c
-GUEST_SRCS-$(CONFIG_X86) += xc_sr_save_x86_pv.c
-GUEST_SRCS-$(CONFIG_X86) += xc_sr_save_x86_hvm.c
-GUEST_SRCS-y += xc_sr_restore.c
-GUEST_SRCS-y += xc_sr_save.c
-GUEST_SRCS-y += xc_offline_page.c
+GUEST_SRCS-y += xg_sr_common.c
+GUEST_SRCS-$(CONFIG_X86) += xg_sr_common_x86.c
+GUEST_SRCS-$(CONFIG_X86) += xg_sr_common_x86_pv.c
+GUEST_SRCS-$(CONFIG_X86) += xg_sr_restore_x86_pv.c
+GUEST_SRCS-$(CONFIG_X86) += xg_sr_restore_x86_hvm.c
+GUEST_SRCS-$(CONFIG_X86) += xg_sr_save_x86_pv.c
+GUEST_SRCS-$(CONFIG_X86) += xg_sr_save_x86_hvm.c
+GUEST_SRCS-y += xg_sr_restore.c
+GUEST_SRCS-y += xg_sr_save.c
+GUEST_SRCS-y += xg_offline_page.c
 else
-GUEST_SRCS-y += xc_nomigrate.c
+GUEST_SRCS-y += xg_nomigrate.c
 endif
 
 vpath %.c ../../xen/common/libelf
@@ -88,25 +88,26 @@ GUEST_SRCS-y                 += cpuid.c msr.c
 endif
 
 # new domain builder
-GUEST_SRCS-y                 += xc_dom_core.c xc_dom_boot.c
-GUEST_SRCS-y                 += xc_dom_elfloader.c
-GUEST_SRCS-$(CONFIG_X86)     += xc_dom_bzimageloader.c
-GUEST_SRCS-$(CONFIG_X86)     += xc_dom_decompress_lz4.c
-GUEST_SRCS-$(CONFIG_X86)     += xc_dom_hvmloader.c
-GUEST_SRCS-$(CONFIG_ARM)     += xc_dom_armzimageloader.c
-GUEST_SRCS-y                 += xc_dom_binloader.c
-GUEST_SRCS-y                 += xc_dom_compat_linux.c
-
-GUEST_SRCS-$(CONFIG_X86)     += xc_dom_x86.c
-GUEST_SRCS-$(CONFIG_X86)     += xc_cpuid_x86.c
-GUEST_SRCS-$(CONFIG_ARM)     += xc_dom_arm.c
+GUEST_SRCS-y                 += xg_dom_core.c
+GUEST_SRCS-y                 += xg_dom_boot.c
+GUEST_SRCS-y                 += xg_dom_elfloader.c
+GUEST_SRCS-$(CONFIG_X86)     += xg_dom_bzimageloader.c
+GUEST_SRCS-$(CONFIG_X86)     += xg_dom_decompress_lz4.c
+GUEST_SRCS-$(CONFIG_X86)     += xg_dom_hvmloader.c
+GUEST_SRCS-$(CONFIG_ARM)     += xg_dom_armzimageloader.c
+GUEST_SRCS-y                 += xg_dom_binloader.c
+GUEST_SRCS-y                 += xg_dom_compat_linux.c
+
+GUEST_SRCS-$(CONFIG_X86)     += xg_dom_x86.c
+GUEST_SRCS-$(CONFIG_X86)     += xg_cpuid_x86.c
+GUEST_SRCS-$(CONFIG_ARM)     += xg_dom_arm.c
 
 ifeq ($(CONFIG_LIBXC_MINIOS),y)
-GUEST_SRCS-y                 += xc_dom_decompress_unsafe.c
-GUEST_SRCS-y                 += xc_dom_decompress_unsafe_bzip2.c
-GUEST_SRCS-y                 += xc_dom_decompress_unsafe_lzma.c
-GUEST_SRCS-y                 += xc_dom_decompress_unsafe_lzo1x.c
-GUEST_SRCS-y                 += xc_dom_decompress_unsafe_xz.c
+GUEST_SRCS-y                 += xg_dom_decompress_unsafe.c
+GUEST_SRCS-y                 += xg_dom_decompress_unsafe_bzip2.c
+GUEST_SRCS-y                 += xg_dom_decompress_unsafe_lzma.c
+GUEST_SRCS-y                 += xg_dom_decompress_unsafe_lzo1x.c
+GUEST_SRCS-y                 += xg_dom_decompress_unsafe_xz.c
 endif
 
 -include $(XEN_TARGET_ARCH)/Makefile
tools/libxc/xg_cpuid_x86.c renamed from tools/libxc/xc_cpuid_x86.c +0 -0
similarity index 100%
rename from tools/libxc/xc_cpuid_x86.c
rename to tools/libxc/xg_cpuid_x86.c
tools/libxc/xg_dom_arm.c renamed from tools/libxc/xc_dom_arm.c +0 -0
similarity index 100%
rename from tools/libxc/xc_dom_arm.c
rename to tools/libxc/xg_dom_arm.c
tools/libxc/xg_dom_armzimageloader.c renamed from tools/libxc/xc_dom_armzimageloader.c +0 -0
similarity index 100%
rename from tools/libxc/xc_dom_armzimageloader.c
rename to tools/libxc/xg_dom_armzimageloader.c
tools/libxc/xg_dom_binloader.c renamed from tools/libxc/xc_dom_binloader.c +0 -0
similarity index 100%
rename from tools/libxc/xc_dom_binloader.c
rename to tools/libxc/xg_dom_binloader.c
tools/libxc/xg_dom_boot.c renamed from tools/libxc/xc_dom_boot.c +0 -0
similarity index 100%
rename from tools/libxc/xc_dom_boot.c
rename to tools/libxc/xg_dom_boot.c
tools/libxc/xg_dom_bzimageloader.c renamed from tools/libxc/xc_dom_bzimageloader.c +0 -0
similarity index 100%
rename from tools/libxc/xc_dom_bzimageloader.c
rename to tools/libxc/xg_dom_bzimageloader.c
tools/libxc/xg_dom_compat_linux.c renamed from tools/libxc/xc_dom_compat_linux.c +0 -0
similarity index 100%
rename from tools/libxc/xc_dom_compat_linux.c
rename to tools/libxc/xg_dom_compat_linux.c
tools/libxc/xg_dom_core.c renamed from tools/libxc/xc_dom_core.c +0 -0
similarity index 100%
rename from tools/libxc/xc_dom_core.c
rename to tools/libxc/xg_dom_core.c
tools/libxc/xg_dom_decompress_lz4.c renamed from tools/libxc/xc_dom_decompress_lz4.c +0 -0
similarity index 100%
rename from tools/libxc/xc_dom_decompress_lz4.c
rename to tools/libxc/xg_dom_decompress_lz4.c
tools/libxc/xg_dom_decompress_unsafe.c renamed from tools/libxc/xc_dom_decompress_unsafe.c +0 -0
similarity index 100%
rename from tools/libxc/xc_dom_decompress_unsafe.c
rename to tools/libxc/xg_dom_decompress_unsafe.c
tools/libxc/xg_dom_decompress_unsafe_bzip2.c renamed from tools/libxc/xc_dom_decompress_unsafe_bzip2.c +0 -0
similarity index 100%
rename from tools/libxc/xc_dom_decompress_unsafe_bzip2.c
rename to tools/libxc/xg_dom_decompress_unsafe_bzip2.c
tools/libxc/xg_dom_decompress_unsafe_lzma.c renamed from tools/libxc/xc_dom_decompress_unsafe_lzma.c +0 -0
similarity index 100%
rename from tools/libxc/xc_dom_decompress_unsafe_lzma.c
rename to tools/libxc/xg_dom_decompress_unsafe_lzma.c
tools/libxc/xg_dom_decompress_unsafe_lzo1x.c renamed from tools/libxc/xc_dom_decompress_unsafe_lzo1x.c +0 -0
similarity index 100%
rename from tools/libxc/xc_dom_decompress_unsafe_lzo1x.c
rename to tools/libxc/xg_dom_decompress_unsafe_lzo1x.c
tools/libxc/xg_dom_decompress_unsafe_xz.c renamed from tools/libxc/xc_dom_decompress_unsafe_xz.c +0 -0
similarity index 100%
rename from tools/libxc/xc_dom_decompress_unsafe_xz.c
rename to tools/libxc/xg_dom_decompress_unsafe_xz.c
tools/libxc/xg_dom_elfloader.c renamed from tools/libxc/xc_dom_elfloader.c +0 -0
similarity index 100%
rename from tools/libxc/xc_dom_elfloader.c
rename to tools/libxc/xg_dom_elfloader.c
tools/libxc/xg_dom_hvmloader.c renamed from tools/libxc/xc_dom_hvmloader.c +0 -0
similarity index 100%
rename from tools/libxc/xc_dom_hvmloader.c
rename to tools/libxc/xg_dom_hvmloader.c
tools/libxc/xg_dom_x86.c renamed from tools/libxc/xc_dom_x86.c +0 -0
similarity index 100%
rename from tools/libxc/xc_dom_x86.c
rename to tools/libxc/xg_dom_x86.c
tools/libxc/xg_nomigrate.c renamed from tools/libxc/xc_nomigrate.c +0 -0
similarity index 100%
rename from tools/libxc/xc_nomigrate.c
rename to tools/libxc/xg_nomigrate.c
tools/libxc/xg_offline_page.c renamed from tools/libxc/xc_offline_page.c +0 -0
similarity index 100%
rename from tools/libxc/xc_offline_page.c
rename to tools/libxc/xg_offline_page.c
tools/libxc/xg_sr_common.c renamed from tools/libxc/xc_sr_common.c +0 -0
similarity index 100%
rename from tools/libxc/xc_sr_common.c
rename to tools/libxc/xg_sr_common.c
tools/libxc/xg_sr_common_x86.c renamed from tools/libxc/xc_sr_common_x86.c +0 -0
similarity index 100%
rename from tools/libxc/xc_sr_common_x86.c
rename to tools/libxc/xg_sr_common_x86.c
tools/libxc/xg_sr_common_x86_pv.c renamed from tools/libxc/xc_sr_common_x86_pv.c +0 -0
similarity index 100%
rename from tools/libxc/xc_sr_common_x86_pv.c
rename to tools/libxc/xg_sr_common_x86_pv.c
tools/libxc/xg_sr_restore.c renamed from tools/libxc/xc_sr_restore.c +0 -0
similarity index 100%
rename from tools/libxc/xc_sr_restore.c
rename to tools/libxc/xg_sr_restore.c
tools/libxc/xg_sr_restore_x86_hvm.c renamed from tools/libxc/xc_sr_restore_x86_hvm.c +0 -0
similarity index 100%
rename from tools/libxc/xc_sr_restore_x86_hvm.c
rename to tools/libxc/xg_sr_restore_x86_hvm.c
tools/libxc/xg_sr_restore_x86_pv.c renamed from tools/libxc/xc_sr_restore_x86_pv.c +0 -0
similarity index 100%
rename from tools/libxc/xc_sr_restore_x86_pv.c
rename to tools/libxc/xg_sr_restore_x86_pv.c
tools/libxc/xg_sr_save.c renamed from tools/libxc/xc_sr_save.c +0 -0
similarity index 100%
rename from tools/libxc/xc_sr_save.c
rename to tools/libxc/xg_sr_save.c
tools/libxc/xg_sr_save_x86_hvm.c renamed from tools/libxc/xc_sr_save_x86_hvm.c +0 -0
similarity index 100%
rename from tools/libxc/xc_sr_save_x86_hvm.c
rename to tools/libxc/xg_sr_save_x86_hvm.c
tools/libxc/xg_sr_save_x86_pv.c renamed from tools/libxc/xc_sr_save_x86_pv.c +0 -0
similarity index 100%
rename from tools/libxc/xc_sr_save_x86_pv.c
rename to tools/libxc/xg_sr_save_x86_pv.c
tools/libxc/xg_suspend.c renamed from tools/libxc/xc_suspend.c +0 -0
similarity index 100%
rename from tools/libxc/xc_suspend.c
rename to tools/libxc/xg_suspend.c
Signature · 1 line
2.26.2
#16 lore raw

PATCH v2 14/17 tools/libxc: rename libxenguest internal headers

In reply to Juergen Gross

Rename the header files private to libxenguest from xc_*.h to xg_*.h.

---
 tools/libxc/xg_dom_bzimageloader.c                              | 2 +-
 tools/libxc/{xc_dom_decompress.h => xg_dom_decompress.h}        | 2 +-
 tools/libxc/xg_dom_decompress_lz4.c                             | 2 +-
 tools/libxc/xg_dom_decompress_unsafe.c                          | 2 +-
 .../{xc_dom_decompress_unsafe.h => xg_dom_decompress_unsafe.h}  | 0
 tools/libxc/xg_dom_decompress_unsafe_bzip2.c                    | 2 +-
 tools/libxc/xg_dom_decompress_unsafe_lzma.c                     | 2 +-
 tools/libxc/xg_dom_decompress_unsafe_lzo1x.c                    | 2 +-
 tools/libxc/xg_dom_decompress_unsafe_xz.c                       | 2 +-
 tools/libxc/xg_sr_common.c                                      | 2 +-
 tools/libxc/{xc_sr_common.h => xg_sr_common.h}                  | 2 +-
 tools/libxc/xg_sr_common_x86.c                                  | 2 +-
 tools/libxc/{xc_sr_common_x86.h => xg_sr_common_x86.h}          | 2 +-
 tools/libxc/xg_sr_common_x86_pv.c                               | 2 +-
 tools/libxc/{xc_sr_common_x86_pv.h => xg_sr_common_x86_pv.h}    | 2 +-
 tools/libxc/xg_sr_restore.c                                     | 2 +-
 tools/libxc/xg_sr_restore_x86_hvm.c                             | 2 +-
 tools/libxc/xg_sr_restore_x86_pv.c                              | 2 +-
 tools/libxc/xg_sr_save.c                                        | 2 +-
 tools/libxc/xg_sr_save_x86_hvm.c                                | 2 +-
 tools/libxc/xg_sr_save_x86_pv.c                                 | 2 +-
 tools/libxc/{xc_sr_stream_format.h => xg_sr_stream_format.h}    | 0
 22 files changed, 20 insertions(+), 20 deletions(-)
 rename tools/libxc/{xc_dom_decompress.h => xg_dom_decompress.h} (77%)
 rename tools/libxc/{xc_dom_decompress_unsafe.h => xg_dom_decompress_unsafe.h} (100%)
 rename tools/libxc/{xc_sr_common.h => xg_sr_common.h} (99%)
 rename tools/libxc/{xc_sr_common_x86.h => xg_sr_common_x86.h} (98%)
 rename tools/libxc/{xc_sr_common_x86_pv.h => xg_sr_common_x86_pv.h} (98%)
 rename tools/libxc/{xc_sr_stream_format.h => xg_sr_stream_format.h} (100%)
tools/libxc/xg_dom_bzimageloader.c +1 -1
index a7d70cc7c6..f959a77602 100644
@@ -32,7 +32,7 @@
 #include <inttypes.h>
 
 #include "xg_private.h"
-#include "xc_dom_decompress.h"
+#include "xg_dom_decompress.h"
 
 #include <xen-tools/libs.h>
 
tools/libxc/xg_dom_decompress.h renamed from tools/libxc/xc_dom_decompress.h +1 -1
similarity index 77%
rename from tools/libxc/xc_dom_decompress.h
rename to tools/libxc/xg_dom_decompress.h
index 42cefa3f0e..d9a21cf297 100644
@@ -1,7 +1,7 @@
 #ifndef __MINIOS__
 # include "xc_dom.h"
 #else
-# include "xc_dom_decompress_unsafe.h"
+# include "xg_dom_decompress_unsafe.h"
 #endif
 
 int xc_try_lz4_decode(struct xc_dom_image *dom, void **blob, size_t *size);
tools/libxc/xg_dom_decompress_lz4.c +1 -1
index b6a33f27a8..97ba620d86 100644
@@ -4,7 +4,7 @@
 #include <stdint.h>
 
 #include "xg_private.h"
-#include "xc_dom_decompress.h"
+#include "xg_dom_decompress.h"
 
 #define CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
 
tools/libxc/xg_dom_decompress_unsafe.c +1 -1
index 164e35558f..21d964787d 100644
@@ -3,7 +3,7 @@
 #include <inttypes.h>
 
 #include "xg_private.h"
-#include "xc_dom_decompress_unsafe.h"
+#include "xg_dom_decompress_unsafe.h"
 
 static struct xc_dom_image *unsafe_dom;
 static unsigned char *output_blob;
tools/libxc/xg_dom_decompress_unsafe.h renamed from tools/libxc/xc_dom_decompress_unsafe.h +0 -0
similarity index 100%
rename from tools/libxc/xc_dom_decompress_unsafe.h
rename to tools/libxc/xg_dom_decompress_unsafe.h
tools/libxc/xg_dom_decompress_unsafe_bzip2.c +1 -1
index 4dcabe4061..9d3709e6cc 100644
@@ -3,7 +3,7 @@
 #include <inttypes.h>
 
 #include "xg_private.h"
-#include "xc_dom_decompress_unsafe.h"
+#include "xg_dom_decompress_unsafe.h"
 
 #include "../../xen/common/bunzip2.c"
 
tools/libxc/xg_dom_decompress_unsafe_lzma.c +1 -1
index 4ee8cdbab1..5d178f0c43 100644
@@ -3,7 +3,7 @@
 #include <inttypes.h>
 
 #include "xg_private.h"
-#include "xc_dom_decompress_unsafe.h"
+#include "xg_dom_decompress_unsafe.h"
 
 #include "../../xen/common/unlzma.c"
 
tools/libxc/xg_dom_decompress_unsafe_lzo1x.c +1 -1
index 59888b9da2..a4f8ebd42d 100644
@@ -5,7 +5,7 @@
 #include <stdint.h>
 
 #include "xg_private.h"
-#include "xc_dom_decompress_unsafe.h"
+#include "xg_dom_decompress_unsafe.h"
 
 typedef uint8_t u8;
 typedef uint32_t u32;
tools/libxc/xg_dom_decompress_unsafe_xz.c +1 -1
index fe7a7f49b4..ff6824b38d 100644
@@ -6,7 +6,7 @@
 #include <inttypes.h>
 
 #include "xg_private.h"
-#include "xc_dom_decompress_unsafe.h"
+#include "xg_dom_decompress_unsafe.h"
 
 // TODO
 #define XZ_DEC_X86
tools/libxc/xg_sr_common.c +1 -1
index 7c54b03414..17567ab133 100644
@@ -1,6 +1,6 @@
 #include <assert.h>
 
-#include "xc_sr_common.h"
+#include "xg_sr_common.h"
 
 #include <xen-tools/libs.h>
 
tools/libxc/xg_sr_common.h renamed from tools/libxc/xc_sr_common.h +1 -1
similarity index 99%
rename from tools/libxc/xc_sr_common.h
rename to tools/libxc/xg_sr_common.h
index f3bdea8006..35f23fabb5 100644
@@ -8,7 +8,7 @@
 #include "xc_dom.h"
 #include "xc_bitops.h"
 
-#include "xc_sr_stream_format.h"
+#include "xg_sr_stream_format.h"
 
 /* String representation of Domain Header types. */
 const char *dhdr_type_to_str(uint32_t type);
tools/libxc/xg_sr_common_x86.c +1 -1
index 77ea044a74..6f12483907 100644
@@ -1,4 +1,4 @@
-#include "xc_sr_common_x86.h"
+#include "xg_sr_common_x86.h"
 
 int write_x86_tsc_info(struct xc_sr_context *ctx)
 {
tools/libxc/xg_sr_common_x86.h renamed from tools/libxc/xc_sr_common_x86.h +1 -1
similarity index 98%
rename from tools/libxc/xc_sr_common_x86.h
rename to tools/libxc/xg_sr_common_x86.h
index e08d81e0e7..b55758c96d 100644
@@ -1,7 +1,7 @@
 #ifndef __COMMON_X86__H
 #define __COMMON_X86__H
 
-#include "xc_sr_common.h"
+#include "xg_sr_common.h"
 
 /*
  * Obtains a domains TSC information from Xen and writes a X86_TSC_INFO record
tools/libxc/xg_sr_common_x86_pv.c +1 -1
index d3d425cb82..cd33406aab 100644
@@ -1,6 +1,6 @@
 #include <assert.h>
 
-#include "xc_sr_common_x86_pv.h"
+#include "xg_sr_common_x86_pv.h"
 
 xen_pfn_t mfn_to_pfn(struct xc_sr_context *ctx, xen_pfn_t mfn)
 {
tools/libxc/xg_sr_common_x86_pv.h renamed from tools/libxc/xc_sr_common_x86_pv.h +1 -1
similarity index 98%
rename from tools/libxc/xc_sr_common_x86_pv.h
rename to tools/libxc/xg_sr_common_x86_pv.h
index 2ed03309af..953b5bfb8d 100644
@@ -1,7 +1,7 @@
 #ifndef __COMMON_X86_PV_H
 #define __COMMON_X86_PV_H
 
-#include "xc_sr_common_x86.h"
+#include "xg_sr_common_x86.h"
 
 /* Virtual address ranges reserved for hypervisor. */
 #define HYPERVISOR_VIRT_START_X86_64 0xFFFF800000000000ULL
tools/libxc/xg_sr_restore.c +1 -1
index bc811e6e3a..b57a787519 100644
@@ -2,7 +2,7 @@
 
 #include <assert.h>
 
-#include "xc_sr_common.h"
+#include "xg_sr_common.h"
 
 /*
  * Read and validate the Image and Domain headers.
tools/libxc/xg_sr_restore_x86_hvm.c +1 -1
index a77624cc9d..d6ea6f3012 100644
@@ -1,7 +1,7 @@
 #include <assert.h>
 #include <arpa/inet.h>
 
-#include "xc_sr_common_x86.h"
+#include "xg_sr_common_x86.h"
 
 /*
  * Process an HVM_CONTEXT record from the stream.
tools/libxc/xg_sr_restore_x86_pv.c +1 -1
index d086271efb..dc50b0f5a8 100644
@@ -1,6 +1,6 @@
 #include <assert.h>
 
-#include "xc_sr_common_x86_pv.h"
+#include "xg_sr_common_x86_pv.h"
 
 static xen_pfn_t pfn_to_mfn(const struct xc_sr_context *ctx, xen_pfn_t pfn)
 {
tools/libxc/xg_sr_save.c +1 -1
index 80b1d5de1f..d74c72cba6 100644
@@ -1,7 +1,7 @@
 #include <assert.h>
 #include <arpa/inet.h>
 
-#include "xc_sr_common.h"
+#include "xg_sr_common.h"
 
 /*
  * Writes an Image header and Domain header into the stream.
tools/libxc/xg_sr_save_x86_hvm.c +1 -1
index 0b2abb26bd..1634a7bc43 100644
@@ -1,6 +1,6 @@
 #include <assert.h>
 
-#include "xc_sr_common_x86.h"
+#include "xg_sr_common_x86.h"
 
 #include <xen/hvm/params.h>
 
tools/libxc/xg_sr_save_x86_pv.c +1 -1
index c7e246ef4f..4964f1f7b8 100644
@@ -1,7 +1,7 @@
 #include <assert.h>
 #include <limits.h>
 
-#include "xc_sr_common_x86_pv.h"
+#include "xg_sr_common_x86_pv.h"
 
 /* Check a 64 bit virtual address for being canonical. */
 static inline bool is_canonical_address(xen_vaddr_t vaddr)
tools/libxc/xg_sr_stream_format.h renamed from tools/libxc/xc_sr_stream_format.h +0 -0
similarity index 100%
rename from tools/libxc/xc_sr_stream_format.h
rename to tools/libxc/xg_sr_stream_format.h
Signature · 1 line
2.26.2
#17 lore raw

PATCH v2 15/17 tools/misc: rename xc_dom.h do xenctrl_dom.h

In reply to Juergen Gross

For being able to disentangle lixenctrl and libxenguest headers xc_dom.h will need to be public. Prepare that by renaming xc_dom.h to xenctrl_dom.h.

---
 stubdom/grub/kexec.c                            | 2 +-
 tools/helpers/init-xenstore-domain.c            | 2 +-
 tools/libxc/include/{xc_dom.h => xenctrl_dom.h} | 0
 tools/libxc/xc_core.c                           | 2 +-
 tools/libxc/xc_private.c                        | 2 +-
 tools/libxc/xg_dom_arm.c                        | 2 +-
 tools/libxc/xg_dom_armzimageloader.c            | 2 +-
 tools/libxc/xg_dom_binloader.c                  | 2 +-
 tools/libxc/xg_dom_boot.c                       | 2 +-
 tools/libxc/xg_dom_compat_linux.c               | 2 +-
 tools/libxc/xg_dom_core.c                       | 2 +-
 tools/libxc/xg_dom_decompress.h                 | 2 +-
 tools/libxc/xg_dom_decompress_unsafe.h          | 2 +-
 tools/libxc/xg_dom_elfloader.c                  | 2 +-
 tools/libxc/xg_dom_hvmloader.c                  | 2 +-
 tools/libxc/xg_dom_x86.c                        | 2 +-
 tools/libxc/xg_offline_page.c                   | 2 +-
 tools/libxc/xg_sr_common.h                      | 2 +-
 tools/libxl/libxl_arm.c                         | 2 +-
 tools/libxl/libxl_arm.h                         | 2 +-
 tools/libxl/libxl_create.c                      | 2 +-
 tools/libxl/libxl_dm.c                          | 2 +-
 tools/libxl/libxl_dom.c                         | 2 +-
 tools/libxl/libxl_internal.h                    | 2 +-
 tools/libxl/libxl_vnuma.c                       | 2 +-
 tools/libxl/libxl_x86.c                         | 2 +-
 tools/libxl/libxl_x86_acpi.c                    | 2 +-
 tools/python/xen/lowlevel/xc/xc.c               | 2 +-
 tools/xcutils/readnotes.c                       | 2 +-
 29 files changed, 28 insertions(+), 28 deletions(-)
 rename tools/libxc/include/{xc_dom.h => xenctrl_dom.h} (100%)
stubdom/grub/kexec.c +1 -1
index 0e68b969a2..24001220a9 100644
@@ -20,7 +20,7 @@
 #include <sys/mman.h>
 
 #include <xenctrl.h>
-#include <xc_dom.h>
+#include <xenctrl_dom.h>
 
 #include <kernel.h>
 #include <console.h>
tools/helpers/init-xenstore-domain.c +1 -1
index 4ce8299c3c..5bdb48dc80 100644
@@ -8,7 +8,7 @@
 #include <sys/ioctl.h>
 #include <sys/mman.h>
 #include <xenctrl.h>
-#include <xc_dom.h>
+#include <xenctrl_dom.h>
 #include <xenstore.h>
 #include <xen/sys/xenbus_dev.h>
 #include <xen-xsm/flask/flask.h>
tools/libxc/include/xenctrl_dom.h renamed from tools/libxc/include/xc_dom.h +0 -0
similarity index 100%
rename from tools/libxc/include/xc_dom.h
rename to tools/libxc/include/xenctrl_dom.h
tools/libxc/xc_core.c +1 -1
index 2ee1d205b4..7df1fccd62 100644
@@ -62,7 +62,7 @@
 
 #include "xg_private.h"
 #include "xc_core.h"
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
 #include <stdlib.h>
 #include <unistd.h>
 
tools/libxc/xc_private.c +1 -1
index 90974d572e..6ecdf6953f 100644
@@ -19,7 +19,7 @@
 
 #include "xc_private.h"
 #include "xg_private.h"
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
 #include <stdarg.h>
 #include <stdlib.h>
 #include <unistd.h>
tools/libxc/xg_dom_arm.c +1 -1
index 931404c222..3f66f1d890 100644
@@ -24,7 +24,7 @@
 #include <xen-tools/libs.h>
 
 #include "xg_private.h"
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
 
 #define NR_MAGIC_PAGES 4
 #define CONSOLE_PFN_OFFSET 0
tools/libxc/xg_dom_armzimageloader.c +1 -1
index 0df8c2a4b1..4246c8e5fa 100644
@@ -25,7 +25,7 @@
 #include <inttypes.h>
 
 #include "xg_private.h"
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
 
 #include <arpa/inet.h> /* XXX ntohl is not the right function... */
 
tools/libxc/xg_dom_binloader.c +1 -1
index d6f7f2a500..870a921427 100644
@@ -83,7 +83,7 @@
 #include <inttypes.h>
 
 #include "xg_private.h"
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
 
 #define round_pgup(_p)    (((_p)+(PAGE_SIZE_X86-1))&PAGE_MASK_X86)
 #define round_pgdown(_p)  ((_p)&PAGE_MASK_X86)
tools/libxc/xg_dom_boot.c +1 -1
index bb599b33ba..1e31e92244 100644
@@ -31,7 +31,7 @@
 #include <zlib.h>
 
 #include "xg_private.h"
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
 #include "xc_core.h"
 #include <xen/hvm/params.h>
 #include <xen/grant_table.h>
tools/libxc/xg_dom_compat_linux.c +1 -1
index b3d43feed9..b645f0b14b 100644
@@ -30,7 +30,7 @@
 
 #include "xenctrl.h"
 #include "xg_private.h"
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
 
 /* ------------------------------------------------------------------------ */
 
tools/libxc/xg_dom_core.c +1 -1
index 327c8a8575..1c91cce315 100644
@@ -32,7 +32,7 @@
 #include <assert.h>
 
 #include "xg_private.h"
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
 #include "_paths.h"
 
 /* ------------------------------------------------------------------------ */
tools/libxc/xg_dom_decompress.h +1 -1
index d9a21cf297..c5ab2e59eb 100644
@@ -1,5 +1,5 @@
 #ifndef __MINIOS__
-# include "xc_dom.h"
+# include "xenctrl_dom.h"
 #else
 # include "xg_dom_decompress_unsafe.h"
 #endif
tools/libxc/xg_dom_decompress_unsafe.h +1 -1
index 64f68864b1..fb84b6add8 100644
@@ -1,4 +1,4 @@
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
 
 typedef int decompress_fn(unsigned char *inbuf, unsigned int len,
                           int (*fill)(void*, unsigned int),
tools/libxc/xg_dom_elfloader.c +1 -1
index b327db219d..7043c3bbba 100644
@@ -26,7 +26,7 @@
 #include <inttypes.h>
 
 #include "xg_private.h"
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
 #include "xc_bitops.h"
 
 #define XEN_VER "xen-3.0"
tools/libxc/xg_dom_hvmloader.c +1 -1
index 3f0bd65547..995a0f3dc3 100644
@@ -26,7 +26,7 @@
 #include <assert.h>
 
 #include "xg_private.h"
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
 #include "xc_bitops.h"
 
 /* ------------------------------------------------------------------------ */
tools/libxc/xg_dom_x86.c +1 -1
index 9439805eaa..842dbcccdd 100644
@@ -38,7 +38,7 @@
 #include <xen-tools/libs.h>
 
 #include "xg_private.h"
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
 #include "xenctrl.h"
 
 /* ------------------------------------------------------------------------ */
tools/libxc/xg_offline_page.c +1 -1
index 19538fc436..77e8889b11 100644
@@ -28,7 +28,7 @@
 #include <xc_core.h>
 
 #include "xc_private.h"
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
 #include "xg_private.h"
 #include "xg_save_restore.h"
 
tools/libxc/xg_sr_common.h +1 -1
index 35f23fabb5..13fcc47420 100644
@@ -5,7 +5,7 @@
 
 #include "xg_private.h"
 #include "xg_save_restore.h"
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
 #include "xc_bitops.h"
 
 #include "xg_sr_stream_format.h"
tools/libxl/libxl_arm.c +1 -1
index 34f8a29056..975a4d730a 100644
@@ -3,7 +3,7 @@
 #include "libxl_libfdt_compat.h"
 #include "libxl_arm.h"
 
-#include <xc_dom.h>
+#include <xenctrl_dom.h>
 #include <stdbool.h>
 #include <libfdt.h>
 #include <assert.h>
tools/libxl/libxl_arm.h +1 -1
index 8aef210d4c..52c2ab5e3a 100644
@@ -17,7 +17,7 @@
 #include "libxl_internal.h"
 #include "libxl_arch.h"
 
-#include <xc_dom.h>
+#include <xenctrl_dom.h>
 
 _hidden
 int libxl__prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info,
tools/libxl/libxl_create.c +1 -1
index 2814818e34..1031b75159 100644
@@ -20,7 +20,7 @@
 #include "libxl_internal.h"
 #include "libxl_arch.h"
 
-#include <xc_dom.h>
+#include <xenctrl_dom.h>
 #include <xenguest.h>
 #include <xen/hvm/hvm_info_table.h>
 #include <xen/hvm/e820.h>
tools/libxl/libxl_dm.c +1 -1
index f2dc5696b9..fec4e0fbe5 100644
@@ -19,7 +19,7 @@
 
 #include "libxl_internal.h"
 
-#include <xc_dom.h>
+#include <xenctrl_dom.h>
 #include <xen/hvm/e820.h>
 #include <sys/types.h>
 #include <pwd.h>
tools/libxl/libxl_dom.c +1 -1
index f8661e90d4..e2dca64aa1 100644
@@ -20,7 +20,7 @@
 #include "libxl_internal.h"
 #include "libxl_arch.h"
 
-#include <xc_dom.h>
+#include <xenctrl_dom.h>
 #include <xen/hvm/hvm_info_table.h>
 #include <xen/hvm/hvm_xs_strings.h>
 #include <xen/hvm/e820.h>
tools/libxl/libxl_internal.h +1 -1
index c63d0686fd..e16ae9630b 100644
@@ -57,7 +57,7 @@
 #include <xenctrl.h>
 #include <xenguest.h>
 #include <xenhypfs.h>
-#include <xc_dom.h>
+#include <xenctrl_dom.h>
 
 #include <xen-tools/libs.h>
 
tools/libxl/libxl_vnuma.c +1 -1
index 8ec2abb2e6..c2e144ceae 100644
@@ -17,7 +17,7 @@
 #include "libxl_arch.h"
 #include <stdlib.h>
 
-#include <xc_dom.h>
+#include <xenctrl_dom.h>
 
 bool libxl__vnuma_configured(const libxl_domain_build_info *b_info)
 {
tools/libxl/libxl_x86.c +1 -1
index e57f63282e..7d95506e00 100644
@@ -1,7 +1,7 @@
 #include "libxl_internal.h"
 #include "libxl_arch.h"
 
-#include <xc_dom.h>
+#include <xenctrl_dom.h>
 
 int libxl__arch_domain_prepare_config(libxl__gc *gc,
                                       libxl_domain_config *d_config,
tools/libxl/libxl_x86_acpi.c +1 -1
index ed6610c84e..3df86c7be5 100644
@@ -18,7 +18,7 @@
 #include <xen/hvm/e820.h>
 #include "libacpi/libacpi.h"
 
-#include <xc_dom.h>
+#include <xenctrl_dom.h>
 
  /* Number of pages holding ACPI tables */
 #define NUM_ACPI_PAGES 16
tools/python/xen/lowlevel/xc/xc.c +1 -1
index 8fde5f311f..8c7b184f0b 100644
@@ -17,7 +17,7 @@
 #include <arpa/inet.h>
 
 #include <xen/elfnote.h>
-#include "xc_dom.h"
+#include "xenctrl_dom.h"
 #include <xen/hvm/hvm_info_table.h>
 #include <xen/hvm/params.h>
 
tools/xcutils/readnotes.c +1 -1
index e682dd1a21..a6b7358e70 100644
@@ -12,7 +12,7 @@
 #include <sys/mman.h>
 
 #include <xg_private.h>
-#include <xc_dom.h> /* gunzip bits */
+#include <xenctrl_dom.h> /* gunzip bits */
 
 #include <xen/libelf/libelf.h>
 
Signature · 1 line
2.26.2
#18 lore raw

PATCH v2 16/17 tools/libxc: untangle libxenctrl from libxenguest

In reply to Juergen Gross

Sources of libxenctrl and libxenguest are completely entangled. In practice libxenguest is a user of libxenctrl, so don't let any source libxenctrl include xg_private.h.

This can be achieved by moving all definitions used by libxenctrl from xg_private.h to xc_private.h.

Export xenctrl_dom.h as it will now be included by other public headers.

---
 tools/libxc/Makefile              |  3 ++-
 tools/libxc/include/xenctrl_dom.h | 10 +++++++--
 tools/libxc/include/xenguest.h    |  8 ++-----
 tools/libxc/xc_core.c             |  5 +++--
 tools/libxc/xc_core.h             |  2 +-
 tools/libxc/xc_core_arm.c         |  2 +-
 tools/libxc/xc_core_x86.c         |  6 ++----
 tools/libxc/xc_domain.c           |  3 +--
 tools/libxc/xc_hcall_buf.c        |  1 -
 tools/libxc/xc_private.c          |  1 -
 tools/libxc/xc_private.h          | 36 +++++++++++++++++++++++++++++++
 tools/libxc/xc_resume.c           |  2 --
 tools/libxc/xg_private.h          | 22 -------------------
 tools/libxc/xg_save_restore.h     |  9 --------
 14 files changed, 56 insertions(+), 54 deletions(-)
tools/libxc/Makefile +2 -1
index e1b2c24106..1e4065f87c 100644
@@ -193,7 +193,7 @@ install: build
 	$(INSTALL_DATA) libxenctrl.a $(DESTDIR)$(libdir)
 	$(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenctrl.so.$(MAJOR)
 	$(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenctrl.so
-	$(INSTALL_DATA) include/xenctrl.h include/xenctrl_compat.h $(DESTDIR)$(includedir)
+	$(INSTALL_DATA) include/xenctrl.h include/xenctrl_compat.h include/xenctrl_dom.h $(DESTDIR)$(includedir)
 	$(INSTALL_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
 	$(INSTALL_DATA) libxenguest.a $(DESTDIR)$(libdir)
 	$(SYMLINK_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenguest.so.$(MAJOR)
@@ -213,6 +213,7 @@ uninstall:
 	rm -f $(DESTDIR)$(PKG_INSTALLDIR)/xencontrol.pc
 	rm -f $(DESTDIR)$(includedir)/xenctrl.h
 	rm -f $(DESTDIR)$(includedir)/xenctrl_compat.h
+	rm -f $(DESTDIR)$(includedir)/xenctrl_dom.h
 	rm -f $(DESTDIR)$(libdir)/libxenctrl.so
 	rm -f $(DESTDIR)$(libdir)/libxenctrl.so.$(MAJOR)
 	rm -f $(DESTDIR)$(libdir)/libxenctrl.so.$(MAJOR).$(MINOR)
tools/libxc/include/xenctrl_dom.h +8 -2
index 52a4d6c8c0..40b85b7755 100644
@@ -17,9 +17,7 @@
 #define _XC_DOM_H
 
 #include <xen/libelf/libelf.h>
-#include <xenguest.h>
 
-#define INVALID_PFN ((xen_pfn_t)-1)
 #define X86_HVM_NR_SPECIAL_PAGES    8
 #define X86_HVM_END_SPECIAL_REGION  0xff000u
 #define XG_MAX_MODULES 2
@@ -38,6 +36,12 @@ struct xc_dom_seg {
     xen_pfn_t pages;
 };
 
+struct xc_hvm_firmware_module {
+    uint8_t  *data;
+    uint32_t  length;
+    uint64_t  guest_addr_out;
+};
+
 struct xc_dom_mem {
     struct xc_dom_mem *next;
     void *ptr;
@@ -255,6 +259,8 @@ struct xc_dom_arch {
     int (*setup_pgtables) (struct xc_dom_image * dom);
 
     /* arch-specific data structs setup */
+    /* in Mini-OS environment start_info might be a macro, avoid collision. */
+#undef start_info
     int (*start_info) (struct xc_dom_image * dom);
     int (*shared_info) (struct xc_dom_image * dom, void *shared_info);
     int (*vcpu) (struct xc_dom_image * dom);
tools/libxc/include/xenguest.h +2 -6
index 7a12d21ff2..4643384790 100644
@@ -22,6 +22,8 @@
 #ifndef XENGUEST_H
 #define XENGUEST_H
 
+#include <xenctrl_dom.h>
+
 #define XC_NUMA_NO_NODE   (~0U)
 
 #define XCFLAGS_LIVE      (1 << 0)
@@ -249,12 +251,6 @@ int xc_linux_build(xc_interface *xch,
                    unsigned int console_evtchn,
                    unsigned long *console_mfn);
 
-struct xc_hvm_firmware_module {
-    uint8_t  *data;
-    uint32_t  length;
-    uint64_t  guest_addr_out;
-};
-
 /*
  * Sets *lockfd to -1.
  * Has deallocated everything even on error.
tools/libxc/xc_core.c +3 -2
index 7df1fccd62..e8c6fb96f9 100644
@@ -60,12 +60,13 @@
  *
  */
 
-#include "xg_private.h"
+#include "xc_private.h"
 #include "xc_core.h"
-#include "xenctrl_dom.h"
 #include <stdlib.h>
 #include <unistd.h>
 
+#include <xen/libelf/libelf.h>
+
 /* number of pages to write at a time */
 #define DUMP_INCREMENT (4 * 1024)
 
tools/libxc/xc_core.h +1 -1
index ed7ed53ca5..36fb755da2 100644
@@ -21,7 +21,7 @@
 #define XC_CORE_H
 
 #include "xen/version.h"
-#include "xg_private.h"
+#include "xc_private.h"
 #include "xen/libelf/elfstructs.h"
 
 /* section names */
tools/libxc/xc_core_arm.c +1 -1
index c3c492c971..7b587b4cc5 100644
@@ -16,7 +16,7 @@
  *
  */
 
-#include "xg_private.h"
+#include "xc_private.h"
 #include "xc_core.h"
 
 #include <xen-tools/libs.h>
tools/libxc/xc_core_x86.c +2 -4
index 54852a2d1a..cb76e6207b 100644
@@ -17,12 +17,10 @@
  *
  */
 
-#include "xg_private.h"
+#include "xc_private.h"
 #include "xc_core.h"
 #include <xen/hvm/e820.h>
 
-#define GET_FIELD(_p, _f) ((dinfo->guest_width==8) ? ((_p)->x64._f) : ((_p)->x32._f))
-
 int
 xc_core_arch_gpfn_may_present(struct xc_core_arch_context *arch_ctxt,
                               unsigned long pfn)
@@ -98,7 +96,7 @@ xc_core_arch_map_p2m_rw(xc_interface *xch, struct domain_info_context *dinfo, xc
 
     live_p2m_frame_list_list =
         xc_map_foreign_range(xch, dom, PAGE_SIZE, PROT_READ,
-                             GET_FIELD(live_shinfo, arch.pfn_to_mfn_frame_list_list));
+                             GET_FIELD(live_shinfo, arch.pfn_to_mfn_frame_list_list, dinfo->guest_width));
 
     if ( !live_p2m_frame_list_list )
     {
tools/libxc/xc_domain.c +1 -2
index fbc22c4df6..43fab50c06 100644
@@ -21,8 +21,7 @@
 
 #include "xc_private.h"
 #include "xc_core.h"
-#include "xg_private.h"
-#include "xg_save_restore.h"
+#include "xc_private.h"
 #include <xen/memory.h>
 #include <xen/hvm/hvm_op.h>
 
tools/libxc/xc_hcall_buf.c +0 -1
index c1230a1e2b..200671f36f 100644
@@ -19,7 +19,6 @@
 #include <string.h>
 
 #include "xc_private.h"
-#include "xg_private.h"
 
 xc_hypercall_buffer_t XC__HYPERCALL_BUFFER_NAME(HYPERCALL_BUFFER_NULL) = {
     .hbuf = NULL,
tools/libxc/xc_private.c +0 -1
index 6ecdf6953f..8af96b1b7e 100644
@@ -18,7 +18,6 @@
  */
 
 #include "xc_private.h"
-#include "xg_private.h"
 #include "xenctrl_dom.h"
 #include <stdarg.h>
 #include <stdlib.h>
tools/libxc/xc_private.h +36 -0
index c77edb3c4c..f0b5f83ac8 100644
@@ -26,6 +26,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <stdlib.h>
+#include <limits.h>
 #include <sys/ioctl.h>
 
 #include "_paths.h"
@@ -62,6 +63,39 @@ struct iovec {
 #include <sys/uio.h>
 #endif
 
+#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
+
+#define GET_FIELD(_p, _f, _w) (((_w) == 8) ? ((_p)->x64._f) : ((_p)->x32._f))
+
+#define SET_FIELD(_p, _f, _v, _w) do {          \
+    if ((_w) == 8)                              \
+        (_p)->x64._f = (_v);                    \
+    else                                        \
+        (_p)->x32._f = (_v);                    \
+} while (0)
+
+/* XXX SMH: following skanky macros rely on variable p2m_size being set */
+/* XXX TJD: also, "guest_width" should be the guest's sizeof(unsigned long) */
+
+struct domain_info_context {
+    unsigned int guest_width;
+    unsigned long p2m_size;
+};
+
+/* Number of xen_pfn_t in a page */
+#define FPP             (PAGE_SIZE/(dinfo->guest_width))
+
+/* Number of entries in the pfn_to_mfn_frame_list_list */
+#define P2M_FLL_ENTRIES (((dinfo->p2m_size)+(FPP*FPP)-1)/(FPP*FPP))
+
+/* Number of entries in the pfn_to_mfn_frame_list */
+#define P2M_FL_ENTRIES  (((dinfo->p2m_size)+FPP-1)/FPP)
+
+/* Size in bytes of the pfn_to_mfn_frame_list     */
+#define P2M_GUEST_FL_SIZE ((P2M_FL_ENTRIES) * (dinfo->guest_width))
+#define P2M_TOOLS_FL_SIZE ((P2M_FL_ENTRIES) *                           \
+                           max_t(size_t, sizeof(xen_pfn_t), dinfo->guest_width))
+
 #define DECLARE_DOMCTL struct xen_domctl domctl
 #define DECLARE_SYSCTL struct xen_sysctl sysctl
 #define DECLARE_PHYSDEV_OP struct physdev_op physdev_op
@@ -75,6 +109,8 @@ struct iovec {
 #define PAGE_SIZE               XC_PAGE_SIZE
 #define PAGE_MASK               XC_PAGE_MASK
 
+#define INVALID_PFN ((xen_pfn_t)-1)
+
 /*
 ** Define max dirty page cache to permit during save/restore -- need to balance 
 ** keeping cache usage down with CPU impact of invalidating too often.
tools/libxc/xc_resume.c +0 -2
index c169204fac..94c6c9fb31 100644
@@ -14,8 +14,6 @@
  */
 
 #include "xc_private.h"
-#include "xg_private.h"
-#include "xg_save_restore.h"
 
 #if defined(__i386__) || defined(__x86_64__)
 
tools/libxc/xg_private.h +0 -22
index 40b5baecde..0000b2b9b6 100644
@@ -97,15 +97,6 @@ typedef uint64_t x86_pgentry_t;
 
 #define NRPAGES(x) (ROUNDUP(x, PAGE_SHIFT) >> PAGE_SHIFT)
 
-
-/* XXX SMH: following skanky macros rely on variable p2m_size being set */
-/* XXX TJD: also, "guest_width" should be the guest's sizeof(unsigned long) */
-
-struct domain_info_context {
-    unsigned int guest_width;
-    unsigned long p2m_size;
-};
-
 static inline xen_pfn_t xc_pfn_to_mfn(xen_pfn_t pfn, xen_pfn_t *p2m,
                                       unsigned gwidth)
 {
@@ -121,19 +112,6 @@ static inline xen_pfn_t xc_pfn_to_mfn(xen_pfn_t pfn, xen_pfn_t *p2m,
     }
 }
 
-/* Number of xen_pfn_t in a page */
-#define FPP             (PAGE_SIZE/(dinfo->guest_width))
-
-/* Number of entries in the pfn_to_mfn_frame_list_list */
-#define P2M_FLL_ENTRIES (((dinfo->p2m_size)+(FPP*FPP)-1)/(FPP*FPP))
-
-/* Number of entries in the pfn_to_mfn_frame_list */
-#define P2M_FL_ENTRIES  (((dinfo->p2m_size)+FPP-1)/FPP)
-
-/* Size in bytes of the pfn_to_mfn_frame_list     */
-#define P2M_GUEST_FL_SIZE ((P2M_FL_ENTRIES) * (dinfo->guest_width))
-#define P2M_TOOLS_FL_SIZE ((P2M_FL_ENTRIES) *                           \
-                           max_t(size_t, sizeof(xen_pfn_t), dinfo->guest_width))
 
 /* Masks for PTE<->PFN conversions */
 #define MADDR_BITS_X86  ((dinfo->guest_width == 8) ? 52 : 44)
tools/libxc/xg_save_restore.h +0 -9
index b904296997..88120eb54b 100644
@@ -109,15 +109,6 @@ static inline int get_platform_info(xc_interface *xch, uint32_t dom,
 #define M2P_SIZE(_m)    ROUNDUP(((_m) * sizeof(xen_pfn_t)), M2P_SHIFT)
 #define M2P_CHUNKS(_m)  (M2P_SIZE((_m)) >> M2P_SHIFT)
 
-#define GET_FIELD(_p, _f, _w) (((_w) == 8) ? ((_p)->x64._f) : ((_p)->x32._f))
-
-#define SET_FIELD(_p, _f, _v, _w) do {          \
-    if ((_w) == 8)                              \
-        (_p)->x64._f = (_v);                    \
-    else                                        \
-        (_p)->x32._f = (_v);                    \
-} while (0)
-
 #define UNFOLD_CR3(_c)                                                  \
   ((uint64_t)((dinfo->guest_width == 8)                                 \
               ? ((_c) >> 12)                                            \
Signature · 1 line
2.26.2
#19 lore raw

PATCH v2 17/17 tools: move libxenctrl below tools/libs

In reply to Juergen Gross

Today tools/libxc needs to be built after tools/libs as libxenctrl is depending on some libraries in tools/libs. This in turn blocks moving other libraries depending on libxenctrl below tools/libs.

So carve out libxenctrl from tools/libxc and move it into tools/libs/ctrl.

---
 .gitignore                                    |  8 ++
 MAINTAINERS                                   |  2 +-
 stubdom/Makefile                              | 23 ++++-
 stubdom/mini-os.mk                            |  2 +-
 tools/Rules.mk                                | 10 +-
 tools/libs/Makefile                           |  1 +
 tools/libs/ctrl/Makefile                      | 68 +++++++++++++
 tools/{libxc => libs/ctrl}/include/xenctrl.h  |  0
 .../ctrl}/include/xenctrl_compat.h            |  0
 .../ctrl}/include/xenctrl_dom.h               |  0
 tools/{libxc => libs/ctrl}/xc_altp2m.c        |  0
 tools/{libxc => libs/ctrl}/xc_arinc653.c      |  0
 tools/{libxc => libs/ctrl}/xc_bitops.h        |  0
 tools/{libxc => libs/ctrl}/xc_core.c          |  0
 tools/{libxc => libs/ctrl}/xc_core.h          |  0
 tools/{libxc => libs/ctrl}/xc_core_arm.c      |  0
 tools/{libxc => libs/ctrl}/xc_core_arm.h      |  0
 tools/{libxc => libs/ctrl}/xc_core_x86.c      |  0
 tools/{libxc => libs/ctrl}/xc_core_x86.h      |  0
 tools/{libxc => libs/ctrl}/xc_cpu_hotplug.c   |  0
 tools/{libxc => libs/ctrl}/xc_cpupool.c       |  0
 tools/{libxc => libs/ctrl}/xc_csched.c        |  0
 tools/{libxc => libs/ctrl}/xc_csched2.c       |  0
 .../ctrl}/xc_devicemodel_compat.c             |  0
 tools/{libxc => libs/ctrl}/xc_domain.c        |  0
 tools/{libxc => libs/ctrl}/xc_evtchn.c        |  0
 tools/{libxc => libs/ctrl}/xc_evtchn_compat.c |  0
 tools/{libxc => libs/ctrl}/xc_flask.c         |  0
 .../{libxc => libs/ctrl}/xc_foreign_memory.c  |  0
 tools/{libxc => libs/ctrl}/xc_freebsd.c       |  0
 tools/{libxc => libs/ctrl}/xc_gnttab.c        |  0
 tools/{libxc => libs/ctrl}/xc_gnttab_compat.c |  0
 tools/{libxc => libs/ctrl}/xc_hcall_buf.c     |  0
 tools/{libxc => libs/ctrl}/xc_kexec.c         |  0
 tools/{libxc => libs/ctrl}/xc_linux.c         |  0
 tools/{libxc => libs/ctrl}/xc_mem_access.c    |  0
 tools/{libxc => libs/ctrl}/xc_mem_paging.c    |  0
 tools/{libxc => libs/ctrl}/xc_memshr.c        |  0
 tools/{libxc => libs/ctrl}/xc_minios.c        |  0
 tools/{libxc => libs/ctrl}/xc_misc.c          |  0
 tools/{libxc => libs/ctrl}/xc_monitor.c       |  0
 tools/{libxc => libs/ctrl}/xc_msr_x86.h       |  0
 tools/{libxc => libs/ctrl}/xc_netbsd.c        |  0
 tools/{libxc => libs/ctrl}/xc_pagetab.c       |  0
 tools/{libxc => libs/ctrl}/xc_physdev.c       |  0
 tools/{libxc => libs/ctrl}/xc_pm.c            |  0
 tools/{libxc => libs/ctrl}/xc_private.c       |  0
 tools/{libxc => libs/ctrl}/xc_private.h       |  0
 tools/{libxc => libs/ctrl}/xc_psr.c           |  0
 tools/{libxc => libs/ctrl}/xc_resource.c      |  0
 tools/{libxc => libs/ctrl}/xc_resume.c        |  0
 tools/{libxc => libs/ctrl}/xc_rt.c            |  0
 tools/{libxc => libs/ctrl}/xc_solaris.c       |  0
 tools/{libxc => libs/ctrl}/xc_tbuf.c          |  0
 tools/{libxc => libs/ctrl}/xc_vm_event.c      |  0
 tools/{libxc => libs/ctrl}/xencontrol.pc.in   |  0
 tools/libxc/Makefile                          | 99 +++----------------
 tools/python/Makefile                         |  2 +-
 tools/python/setup.py                         |  8 +-
 59 files changed, 117 insertions(+), 106 deletions(-)
 create mode 100644 tools/libs/ctrl/Makefile
 rename tools/{libxc => libs/ctrl}/include/xenctrl.h (100%)
 rename tools/{libxc => libs/ctrl}/include/xenctrl_compat.h (100%)
 rename tools/{libxc => libs/ctrl}/include/xenctrl_dom.h (100%)
 rename tools/{libxc => libs/ctrl}/xc_altp2m.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_arinc653.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_bitops.h (100%)
 rename tools/{libxc => libs/ctrl}/xc_core.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_core.h (100%)
 rename tools/{libxc => libs/ctrl}/xc_core_arm.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_core_arm.h (100%)
 rename tools/{libxc => libs/ctrl}/xc_core_x86.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_core_x86.h (100%)
 rename tools/{libxc => libs/ctrl}/xc_cpu_hotplug.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_cpupool.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_csched.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_csched2.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_devicemodel_compat.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_domain.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_evtchn.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_evtchn_compat.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_flask.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_foreign_memory.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_freebsd.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_gnttab.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_gnttab_compat.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_hcall_buf.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_kexec.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_linux.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_mem_access.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_mem_paging.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_memshr.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_minios.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_misc.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_monitor.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_msr_x86.h (100%)
 rename tools/{libxc => libs/ctrl}/xc_netbsd.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_pagetab.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_physdev.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_pm.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_private.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_private.h (100%)
 rename tools/{libxc => libs/ctrl}/xc_psr.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_resource.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_resume.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_rt.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_solaris.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_tbuf.c (100%)
 rename tools/{libxc => libs/ctrl}/xc_vm_event.c (100%)
 rename tools/{libxc => libs/ctrl}/xencontrol.pc.in (100%)
.gitignore +8 -0
index 5ea48af818..3e1008e372 100644
@@ -114,6 +114,9 @@ tools/libs/hypfs/headers.chk
 tools/libs/hypfs/xenhypfs.pc
 tools/libs/call/headers.chk
 tools/libs/call/xencall.pc
+tools/libs/ctrl/_paths.h
+tools/libs/ctrl/libxenctrl.map
+tools/libs/ctrl/xencontrol.pc
 tools/libs/foreignmemory/headers.chk
 tools/libs/foreignmemory/xenforeignmemory.pc
 tools/libs/devicemodel/headers.chk
@@ -195,6 +198,11 @@ tools/include/xen-foreign/*.(c|h|size)
 tools/include/xen-foreign/checker
 tools/libvchan/xenvchan.pc
 tools/libxc/*.pc
+tools/libxc/xc_bitops.h
+tools/libxc/xc_core.h
+tools/libxc/xc_core_arm.h
+tools/libxc/xc_core_x86.h
+tools/libxc/xc_private.h
 tools/libxl/_libxl.api-for-check
 tools/libxl/*.api-ok
 tools/libxl/*.pc
MAINTAINERS +1 -1
index 33fe51324e..91ca2c9c40 100644
@@ -226,7 +226,7 @@ M:	Stewart Hildebrand <[email protected]>
 S:	Supported
 L:	[email protected]
 F:	xen/common/sched/arinc653.c
-F:	tools/libxc/xc_arinc653.c
+F:	tools/libs/ctrl/xc_arinc653.c
 
 ARM (W/ VIRTUALISATION EXTENSIONS) ARCHITECTURE
 M:	Stefano Stabellini <[email protected]>
stubdom/Makefile +18 -5
index 6fcecadeb9..440adc2eb4 100644
@@ -351,13 +351,16 @@ libs-$(XEN_TARGET_ARCH)/foreignmemory/stamp: $(XEN_ROOT)/tools/libs/foreignmemor
 libs-$(XEN_TARGET_ARCH)/devicemodel/stamp: $(XEN_ROOT)/tools/libs/devicemodel/Makefile
 	$(do_links)
 
+libs-$(XEN_TARGET_ARCH)/ctrl/stamp: $(XEN_ROOT)/tools/libs/ctrl/Makefile
+	$(do_links)
+
 libxc-$(XEN_TARGET_ARCH)/stamp: $(XEN_ROOT)/tools/libxc/Makefile
 	$(do_links)
 
 xenstore/stamp: $(XEN_ROOT)/tools/xenstore/Makefile
 	$(do_links)
 
-LINK_LIBS_DIRS := toolcore toollog evtchn gnttab call foreignmemory devicemodel
+LINK_LIBS_DIRS := toolcore toollog evtchn gnttab call foreignmemory devicemodel ctrl
 LINK_DIRS := libxc-$(XEN_TARGET_ARCH) xenstore $(foreach dir,$(LINK_LIBS_DIRS),libs-$(XEN_TARGET_ARCH)/$(dir))
 LINK_STAMPS := $(foreach dir,$(LINK_DIRS),$(dir)/stamp)
 
@@ -449,17 +452,26 @@ libs-$(XEN_TARGET_ARCH)/devicemodel/libxendevicemodel.a: libxentoolcore libxento
 libs-$(XEN_TARGET_ARCH)/devicemodel/libxendevicemodel.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/devicemodel
 
+#######
+# libxenctrl
+#######
+
+.PHONY: libxenctrl
+libxenctrl: libs-$(XEN_TARGET_ARCH)/ctrl/libxenctrl.a
+libs-$(XEN_TARGET_ARCH)/ctrl/libxenctrl.a: libxentoollog libxencall libxenevtchn libxengnttab libxenforeignmemory libxendevicemodel
+libs-$(XEN_TARGET_ARCH)/ctrl/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
+	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= CONFIG_LIBXC_MINIOS=y -C libs-$(XEN_TARGET_ARCH)/ctrl
+
 #######
 # libxc
 #######
 
 .PHONY: libxc
-libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a
-libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: mk-headers-$(XEN_TARGET_ARCH) libxentoolcore libxentoollog libxenevtchn libxengnttab libxencall libxenforeignmemory libxendevicemodel cross-zlib
+libxc: libxc-$(XEN_TARGET_ARCH)/libxenguest.a
+libxc-$(XEN_TARGET_ARCH)/libxenguest.a: libxenevtchn libxenctrl cross-zlib
+libxc-$(XEN_TARGET_ARCH)/libxenguest.a: mk-headers-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= CONFIG_LIBXC_MINIOS=y -C libxc-$(XEN_TARGET_ARCH)
 
- libxc-$(XEN_TARGET_ARCH)/libxenguest.a: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a
-
 #######
 # ioemu
 #######
@@ -686,6 +698,7 @@ clean:
 	[ ! -e libs-$(XEN_TARGET_ARCH)/call/Makefile ] || $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/call clean
 	[ ! -e libs-$(XEN_TARGET_ARCH)/foreignmemory/Makefile ] || $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/foreignmemory clean
 	[ ! -e libs-$(XEN_TARGET_ARCH)/devicemodel/Makefile ] || $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/devicemodel clean
+	[ ! -e libs-$(XEN_TARGET_ARCH)/ctrl/Makefile ] || $(MAKE) DESTDIR= -C libs-$(XEN_TARGET_ARCH)/ctrl clean
 	[ ! -e libxc-$(XEN_TARGET_ARCH)/Makefile ] || $(MAKE) DESTDIR= -C libxc-$(XEN_TARGET_ARCH) clean
 	-[ ! -d ioemu ] || $(MAKE) DESTDIR= -C ioemu clean
 	-[ ! -d xenstore ] || $(MAKE) DESTDIR= -C xenstore clean
stubdom/mini-os.mk +1 -1
index 32528bb91f..b1387df3f8 100644
@@ -13,5 +13,5 @@ GNTTAB_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/gnttab
 CALL_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/call
 FOREIGNMEMORY_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/foreignmemory
 DEVICEMODEL_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/devicemodel
-CTRL_PATH = $(XEN_ROOT)/stubdom/libxc-$(MINIOS_TARGET_ARCH)
+CTRL_PATH = $(XEN_ROOT)/stubdom/libs-$(MINIOS_TARGET_ARCH)/ctrl
 GUEST_PATH = $(XEN_ROOT)/stubdom/libxc-$(MINIOS_TARGET_ARCH)
tools/Rules.mk +4 -6
index 35d237bba6..cf992b480f 100644
@@ -29,8 +29,9 @@ LIBS_LIBS += devicemodel
 USELIBS_devicemodel := toollog toolcore call
 LIBS_LIBS += hypfs
 USELIBS_hypfs := toollog toolcore call
+LIBS_LIBS += ctrl
+USELIBS_ctrl := toollog call evtchn gnttab foreignmemory devicemodel
 
-XEN_libxenctrl     = $(XEN_ROOT)/tools/libxc
 XEN_libxenguest    = $(XEN_ROOT)/tools/libxc
 XEN_libxenlight    = $(XEN_ROOT)/tools/libxl
 # Currently libxlutil lives in the same directory as libxenlight
@@ -120,13 +121,10 @@ $(foreach lib,$(LIBS_LIBS),$(eval $(call LIB_defs,$(lib))))
 
 # code which compiles against libxenctrl get __XEN_TOOLS__ and
 # therefore sees the unstable hypercall interfaces.
-CFLAGS_libxenctrl = -I$(XEN_libxenctrl)/include $(CFLAGS_libxentoollog) $(CFLAGS_libxenforeignmemory) $(CFLAGS_libxendevicemodel) $(CFLAGS_xeninclude) -D__XEN_TOOLS__
-SHDEPS_libxenctrl = $(SHLIB_libxentoollog) $(SHLIB_libxenevtchn) $(SHLIB_libxengnttab) $(SHLIB_libxencall) $(SHLIB_libxenforeignmemory) $(SHLIB_libxendevicemodel)
-LDLIBS_libxenctrl = $(SHDEPS_libxenctrl) $(XEN_libxenctrl)/libxenctrl$(libextension)
-SHLIB_libxenctrl  = $(SHDEPS_libxenctrl) -Wl,-rpath-link=$(XEN_libxenctrl)
+CFLAGS_libxenctrl += $(CFLAGS_libxentoollog) $(CFLAGS_libxenforeignmemory) $(CFLAGS_libxendevicemodel) -D__XEN_TOOLS__
 
 CFLAGS_libxenguest = -I$(XEN_libxenguest)/include $(CFLAGS_libxenevtchn) $(CFLAGS_libxenforeignmemory) $(CFLAGS_xeninclude)
-SHDEPS_libxenguest = $(SHLIB_libxenevtchn)
+SHDEPS_libxenguest = $(SHLIB_libxenevtchn) $(SHLIB_libxenctrl)
 LDLIBS_libxenguest = $(SHDEPS_libxenguest) $(XEN_libxenguest)/libxenguest$(libextension)
 SHLIB_libxenguest  = $(SHDEPS_libxenguest) -Wl,-rpath-link=$(XEN_libxenguest)
 
tools/libs/Makefile +1 -0
index 69cdfb5975..7648ea0e4c 100644
@@ -9,6 +9,7 @@ SUBDIRS-y += gnttab
 SUBDIRS-y += call
 SUBDIRS-y += foreignmemory
 SUBDIRS-y += devicemodel
+SUBDIRS-y += ctrl
 SUBDIRS-y += hypfs
 
 ifeq ($(CONFIG_RUMP),y)
tools/libs/ctrl/Makefile new file +68 -0

68 lines not on this page · raw message

tools/libs/ctrl/include/xenctrl.h renamed from tools/libxc/include/xenctrl.h +0 -0
similarity index 100%
rename from tools/libxc/include/xenctrl.h
rename to tools/libs/ctrl/include/xenctrl.h
tools/libs/ctrl/include/xenctrl_compat.h renamed from tools/libxc/include/xenctrl_compat.h +0 -0
similarity index 100%
rename from tools/libxc/include/xenctrl_compat.h
rename to tools/libs/ctrl/include/xenctrl_compat.h
tools/libs/ctrl/include/xenctrl_dom.h renamed from tools/libxc/include/xenctrl_dom.h +0 -0
similarity index 100%
rename from tools/libxc/include/xenctrl_dom.h
rename to tools/libs/ctrl/include/xenctrl_dom.h
tools/libs/ctrl/xc_altp2m.c renamed from tools/libxc/xc_altp2m.c +0 -0
similarity index 100%
rename from tools/libxc/xc_altp2m.c
rename to tools/libs/ctrl/xc_altp2m.c
tools/libs/ctrl/xc_arinc653.c renamed from tools/libxc/xc_arinc653.c +0 -0
similarity index 100%
rename from tools/libxc/xc_arinc653.c
rename to tools/libs/ctrl/xc_arinc653.c
tools/libs/ctrl/xc_bitops.h renamed from tools/libxc/xc_bitops.h +0 -0
similarity index 100%
rename from tools/libxc/xc_bitops.h
rename to tools/libs/ctrl/xc_bitops.h
tools/libs/ctrl/xc_core.c renamed from tools/libxc/xc_core.c +0 -0
similarity index 100%
rename from tools/libxc/xc_core.c
rename to tools/libs/ctrl/xc_core.c
tools/libs/ctrl/xc_core.h renamed from tools/libxc/xc_core.h +0 -0
similarity index 100%
rename from tools/libxc/xc_core.h
rename to tools/libs/ctrl/xc_core.h
tools/libs/ctrl/xc_core_arm.c renamed from tools/libxc/xc_core_arm.c +0 -0
similarity index 100%
rename from tools/libxc/xc_core_arm.c
rename to tools/libs/ctrl/xc_core_arm.c
tools/libs/ctrl/xc_core_arm.h renamed from tools/libxc/xc_core_arm.h +0 -0
similarity index 100%
rename from tools/libxc/xc_core_arm.h
rename to tools/libs/ctrl/xc_core_arm.h
tools/libs/ctrl/xc_core_x86.c renamed from tools/libxc/xc_core_x86.c +0 -0
similarity index 100%
rename from tools/libxc/xc_core_x86.c
rename to tools/libs/ctrl/xc_core_x86.c
tools/libs/ctrl/xc_core_x86.h renamed from tools/libxc/xc_core_x86.h +0 -0
similarity index 100%
rename from tools/libxc/xc_core_x86.h
rename to tools/libs/ctrl/xc_core_x86.h
tools/libs/ctrl/xc_cpu_hotplug.c renamed from tools/libxc/xc_cpu_hotplug.c +0 -0
similarity index 100%
rename from tools/libxc/xc_cpu_hotplug.c
rename to tools/libs/ctrl/xc_cpu_hotplug.c
tools/libs/ctrl/xc_cpupool.c renamed from tools/libxc/xc_cpupool.c +0 -0
similarity index 100%
rename from tools/libxc/xc_cpupool.c
rename to tools/libs/ctrl/xc_cpupool.c
tools/libs/ctrl/xc_csched.c renamed from tools/libxc/xc_csched.c +0 -0
similarity index 100%
rename from tools/libxc/xc_csched.c
rename to tools/libs/ctrl/xc_csched.c
tools/libs/ctrl/xc_csched2.c renamed from tools/libxc/xc_csched2.c +0 -0
similarity index 100%
rename from tools/libxc/xc_csched2.c
rename to tools/libs/ctrl/xc_csched2.c
tools/libs/ctrl/xc_devicemodel_compat.c renamed from tools/libxc/xc_devicemodel_compat.c +0 -0
similarity index 100%
rename from tools/libxc/xc_devicemodel_compat.c
rename to tools/libs/ctrl/xc_devicemodel_compat.c
tools/libs/ctrl/xc_domain.c renamed from tools/libxc/xc_domain.c +0 -0
similarity index 100%
rename from tools/libxc/xc_domain.c
rename to tools/libs/ctrl/xc_domain.c
tools/libs/ctrl/xc_evtchn.c renamed from tools/libxc/xc_evtchn.c +0 -0
similarity index 100%
rename from tools/libxc/xc_evtchn.c
rename to tools/libs/ctrl/xc_evtchn.c
tools/libs/ctrl/xc_evtchn_compat.c renamed from tools/libxc/xc_evtchn_compat.c +0 -0
similarity index 100%
rename from tools/libxc/xc_evtchn_compat.c
rename to tools/libs/ctrl/xc_evtchn_compat.c
tools/libs/ctrl/xc_flask.c renamed from tools/libxc/xc_flask.c +0 -0
similarity index 100%
rename from tools/libxc/xc_flask.c
rename to tools/libs/ctrl/xc_flask.c
tools/libs/ctrl/xc_foreign_memory.c renamed from tools/libxc/xc_foreign_memory.c +0 -0
similarity index 100%
rename from tools/libxc/xc_foreign_memory.c
rename to tools/libs/ctrl/xc_foreign_memory.c
tools/libs/ctrl/xc_freebsd.c renamed from tools/libxc/xc_freebsd.c +0 -0
similarity index 100%
rename from tools/libxc/xc_freebsd.c
rename to tools/libs/ctrl/xc_freebsd.c
tools/libs/ctrl/xc_gnttab.c renamed from tools/libxc/xc_gnttab.c +0 -0
similarity index 100%
rename from tools/libxc/xc_gnttab.c
rename to tools/libs/ctrl/xc_gnttab.c
tools/libs/ctrl/xc_gnttab_compat.c renamed from tools/libxc/xc_gnttab_compat.c +0 -0
similarity index 100%
rename from tools/libxc/xc_gnttab_compat.c
rename to tools/libs/ctrl/xc_gnttab_compat.c
tools/libs/ctrl/xc_hcall_buf.c renamed from tools/libxc/xc_hcall_buf.c +0 -0
similarity index 100%
rename from tools/libxc/xc_hcall_buf.c
rename to tools/libs/ctrl/xc_hcall_buf.c
tools/libs/ctrl/xc_kexec.c renamed from tools/libxc/xc_kexec.c +0 -0
similarity index 100%
rename from tools/libxc/xc_kexec.c
rename to tools/libs/ctrl/xc_kexec.c
tools/libs/ctrl/xc_linux.c renamed from tools/libxc/xc_linux.c +0 -0
similarity index 100%
rename from tools/libxc/xc_linux.c
rename to tools/libs/ctrl/xc_linux.c
tools/libs/ctrl/xc_mem_access.c renamed from tools/libxc/xc_mem_access.c +0 -0
similarity index 100%
rename from tools/libxc/xc_mem_access.c
rename to tools/libs/ctrl/xc_mem_access.c
tools/libs/ctrl/xc_mem_paging.c renamed from tools/libxc/xc_mem_paging.c +0 -0
similarity index 100%
rename from tools/libxc/xc_mem_paging.c
rename to tools/libs/ctrl/xc_mem_paging.c
tools/libs/ctrl/xc_memshr.c renamed from tools/libxc/xc_memshr.c +0 -0
similarity index 100%
rename from tools/libxc/xc_memshr.c
rename to tools/libs/ctrl/xc_memshr.c
tools/libs/ctrl/xc_minios.c renamed from tools/libxc/xc_minios.c +0 -0
similarity index 100%
rename from tools/libxc/xc_minios.c
rename to tools/libs/ctrl/xc_minios.c
tools/libs/ctrl/xc_misc.c renamed from tools/libxc/xc_misc.c +0 -0
similarity index 100%
rename from tools/libxc/xc_misc.c
rename to tools/libs/ctrl/xc_misc.c
tools/libs/ctrl/xc_monitor.c renamed from tools/libxc/xc_monitor.c +0 -0
similarity index 100%
rename from tools/libxc/xc_monitor.c
rename to tools/libs/ctrl/xc_monitor.c
tools/libs/ctrl/xc_msr_x86.h renamed from tools/libxc/xc_msr_x86.h +0 -0
similarity index 100%
rename from tools/libxc/xc_msr_x86.h
rename to tools/libs/ctrl/xc_msr_x86.h
tools/libs/ctrl/xc_netbsd.c renamed from tools/libxc/xc_netbsd.c +0 -0
similarity index 100%
rename from tools/libxc/xc_netbsd.c
rename to tools/libs/ctrl/xc_netbsd.c
tools/libs/ctrl/xc_pagetab.c renamed from tools/libxc/xc_pagetab.c +0 -0
similarity index 100%
rename from tools/libxc/xc_pagetab.c
rename to tools/libs/ctrl/xc_pagetab.c
tools/libs/ctrl/xc_physdev.c renamed from tools/libxc/xc_physdev.c +0 -0
similarity index 100%
rename from tools/libxc/xc_physdev.c
rename to tools/libs/ctrl/xc_physdev.c
tools/libs/ctrl/xc_pm.c renamed from tools/libxc/xc_pm.c +0 -0
similarity index 100%
rename from tools/libxc/xc_pm.c
rename to tools/libs/ctrl/xc_pm.c
tools/libs/ctrl/xc_private.c renamed from tools/libxc/xc_private.c +0 -0
similarity index 100%
rename from tools/libxc/xc_private.c
rename to tools/libs/ctrl/xc_private.c
tools/libs/ctrl/xc_private.h renamed from tools/libxc/xc_private.h +0 -0
similarity index 100%
rename from tools/libxc/xc_private.h
rename to tools/libs/ctrl/xc_private.h
tools/libs/ctrl/xc_psr.c renamed from tools/libxc/xc_psr.c +0 -0
similarity index 100%
rename from tools/libxc/xc_psr.c
rename to tools/libs/ctrl/xc_psr.c
tools/libs/ctrl/xc_resource.c renamed from tools/libxc/xc_resource.c +0 -0
similarity index 100%
rename from tools/libxc/xc_resource.c
rename to tools/libs/ctrl/xc_resource.c
tools/libs/ctrl/xc_resume.c renamed from tools/libxc/xc_resume.c +0 -0
similarity index 100%
rename from tools/libxc/xc_resume.c
rename to tools/libs/ctrl/xc_resume.c
tools/libs/ctrl/xc_rt.c renamed from tools/libxc/xc_rt.c +0 -0
similarity index 100%
rename from tools/libxc/xc_rt.c
rename to tools/libs/ctrl/xc_rt.c
tools/libs/ctrl/xc_solaris.c renamed from tools/libxc/xc_solaris.c +0 -0
similarity index 100%
rename from tools/libxc/xc_solaris.c
rename to tools/libs/ctrl/xc_solaris.c
tools/libs/ctrl/xc_tbuf.c renamed from tools/libxc/xc_tbuf.c +0 -0
similarity index 100%
rename from tools/libxc/xc_tbuf.c
rename to tools/libs/ctrl/xc_tbuf.c
tools/libs/ctrl/xc_vm_event.c renamed from tools/libxc/xc_vm_event.c +0 -0
similarity index 100%
rename from tools/libxc/xc_vm_event.c
rename to tools/libs/ctrl/xc_vm_event.c
tools/libs/ctrl/xencontrol.pc.in renamed from tools/libxc/xencontrol.pc.in +0 -0
similarity index 100%
rename from tools/libxc/xencontrol.pc.in
rename to tools/libs/ctrl/xencontrol.pc.in
tools/libxc/Makefile +11 -88

159 lines not on this page · raw message

tools/python/Makefile +1 -1
index 8d22c03676..8dc755d6e8 100644
@@ -33,7 +33,7 @@ uninstall:
 
 .PHONY: test
 test:
-	LD_LIBRARY_PATH=$$(readlink -f ../libxc):$$(readlink -f ../xenstore) $(PYTHON) -m unittest discover
+	LD_LIBRARY_PATH=$$(readlink -f ../libs/ctrl):$$(readlink -f ../xenstore) $(PYTHON) -m unittest discover
 
 .PHONY: clean
 clean:
tools/python/setup.py +4 -4
index 44696b3998..24b284af39 100644
@@ -9,7 +9,7 @@ extra_compile_args  = [ "-fno-strict-aliasing", "-Werror" ]
 PATH_XEN      = XEN_ROOT + "/tools/include"
 PATH_LIBXENTOOLLOG = XEN_ROOT + "/tools/libs/toollog"
 PATH_LIBXENEVTCHN = XEN_ROOT + "/tools/libs/evtchn"
-PATH_LIBXC    = XEN_ROOT + "/tools/libxc"
+PATH_LIBXENCTRL = XEN_ROOT + "/tools/libs/ctrl"
 PATH_LIBXL    = XEN_ROOT + "/tools/libxl"
 PATH_XENSTORE = XEN_ROOT + "/tools/xenstore"
 
@@ -18,11 +18,11 @@ xc = Extension("xc",
                include_dirs       = [ PATH_XEN,
                                       PATH_LIBXENTOOLLOG + "/include",
                                       PATH_LIBXENEVTCHN + "/include",
-                                      PATH_LIBXC + "/include",
+                                      PATH_LIBXENCTRL + "/include",
                                       "xen/lowlevel/xc" ],
-               library_dirs       = [ PATH_LIBXC ],
+               library_dirs       = [ PATH_LIBXENCTRL ],
                libraries          = [ "xenctrl" ],
-               depends            = [ PATH_LIBXC + "/libxenctrl.so" ],
+               depends            = [ PATH_LIBXENCTRL + "/libxenctrl.so" ],
                extra_link_args    = [ "-Wl,-rpath-link="+PATH_LIBXENTOOLLOG ],
                sources            = [ "xen/lowlevel/xc/xc.c" ])
 
Signature · 1 line
2.26.2
Reviewed-by on v2 17/17
#20 lore raw

Re: [PATCH II v2 17/17] tools: move libxenctrl below tools/libs

Juergen Gross, le lun. 17 août 2020 11:49:22 +0200, a ecrit:

stubdom/mini-os.mk

Quoted 9 lines
stubdom/Makefile +0 -0
index 6fcecadeb9..440adc2eb4 100644
stubdom/mini-os.mk +0 -0
index 32528bb91f..b1387df3f8 100644

For these,