[adding bug-gnulib]
On 7/24/19 12:55 AM, Eric Blake wrote:
Add a new file checkpoint_conf.c that performs the translation to
and
from new XML describing a checkpoint. The code shares a common base
class with snapshots, since a checkpoint similarly represents the
domain state at a moment in time. Add some basic testing of round trip
XML handling through the new code.
+++ b/src/conf/checkpoint_conf.c
+#include <config.h>
+
+#include "configmake.h"
+#include "internal.h"
+#include "virbitmap.h"
+#include "virbuffer.h"
+#include "datatypes.h"
This causes a compilation failure on mingw, due to libvirt's
"datatypes.h" including <winsock.h> after the point at which gnulib's
"configmake.h" has already #define'd DATADIR into a string, but mingw's
winsock.h tries to use DATADIR as a data-type tag name:
make all-am
make[1]: Entering directory '/home/berrange/src/virt/libvirt/src'
CC conf/libvirt_conf_la-checkpoint_conf.lo
In file included from
/usr/i686-w64-mingw32/sys-root/mingw/include/objbase.h:66,
from
/usr/i686-w64-mingw32/sys-root/mingw/include/ole2.h:17,
from
/usr/i686-w64-mingw32/sys-root/mingw/include/wtypes.h:12,
from
/usr/i686-w64-mingw32/sys-root/mingw/include/winscard.h:10,
from
/usr/i686-w64-mingw32/sys-root/mingw/include/windows.h:97,
from
/usr/i686-w64-mingw32/sys-root/mingw/include/winsock2.h:23,
from ../gnulib/lib/unistd.h:48,
from ./driver.h:24,
from ./datatypes.h:26,
from conf/checkpoint_conf.c:28:
/usr/i686-w64-mingw32/sys-root/mingw/include/objidl.h:12275:2: error:
expected identifier or '(' before string constant
} DATADIR;
^~~~~~~~~
make[1]: *** [Makefile:10127: conf/libvirt_conf_la-checkpoint_conf.lo]
Error 1
And it's not the first time libvirt has run into this issue; I've found
the following commits in 2015 that worked around it:
https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=976abdf6
https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=bd205a90
Gnulib should work around this: perhaps "configmake.h" should include
<unistd.h> first when built on mingw, as that is sufficient to trigger
enough other headers to be included such that a later inclusion of
<winsock.h> after "configmake.h" no longer runs into an issue with the
DATADIR pollution breaking compilation, or perhaps gnulib can wrap
<winsock.h> in such a way that it no longer depends on a tag name
DATADIR. In the meantime, I'll push an obvious fix to libvirt to
reorder the header inclusions to work around the problem.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization:
qemu.org |
libvirt.org