[PATCH] tools/libs/guest: fix out of tree builds of libxenguest users

Juergen Gross posted 1 patch 3 years, 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/xen tags/patchew/20200923052401.24917-1-jgross@suse.com
Maintainers: Ian Jackson <iwj@xenproject.org>, Wei Liu <wl@xen.org>
tools/libs/guest/include/xenguest.h | 2 ++
1 file changed, 2 insertions(+)
[PATCH] tools/libs/guest: fix out of tree builds of libxenguest users
Posted by Juergen Gross 3 years, 6 months ago
xenguest.h includes xenctrl_dom.h, which is including the Xen internal
xen/libelf/libelf.h. This results in build failures for components
using libxenguest when being built outside the Xen build environment.

Fix that by guarding the include of xenctrl_dom.h with
"#ifdef __XEN_TOOLS_".

Fixes: 7e0165c19387 ("tools/libxc: untangle libxenctrl from libxenguest")
Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 tools/libs/guest/include/xenguest.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/libs/guest/include/xenguest.h b/tools/libs/guest/include/xenguest.h
index 4643384790..5cd502f644 100644
--- a/tools/libs/guest/include/xenguest.h
+++ b/tools/libs/guest/include/xenguest.h
@@ -22,7 +22,9 @@
 #ifndef XENGUEST_H
 #define XENGUEST_H
 
+#ifdef __XEN_TOOLS__
 #include <xenctrl_dom.h>
+#endif
 
 #define XC_NUMA_NO_NODE   (~0U)
 
-- 
2.26.2