[libvirt] [PATCH v2 0/2] Add support for portable-rpcgen from portablexdr library

This patch set allows to build libvirt natively under MinGW/MSYS using portablexdr library. An updated version of portablexdr with fixed bugs is available as part of MSYS2 project. Differences from v1: - Split into two parts - Reflect structure definiton change also in xc_monitor_protocol-structs, fix "make syntax-check" Pavel Fedin (2): Remove explicit enum from protocol structures Add support for portable-rpcgen from portablexdr library configure.ac | 2 +- src/lxc/lxc_monitor_protocol.x | 2 +- src/lxc_monitor_protocol-structs | 2 +- src/rpc/genprotocol.pl | 5 ++++- 4 files changed, 7 insertions(+), 4 deletions(-) -- 1.9.5.msysgit.0

Explicit 'enum' keyword does not work with portablexdr-rpcgeb, causing its parser to fail. Fix method is borrowed from virnetprotocol.x Signed-off-by: Pavel Fedin <p.fedin@samsung.com> --- src/lxc/lxc_monitor_protocol.x | 2 +- src/lxc_monitor_protocol-structs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lxc/lxc_monitor_protocol.x b/src/lxc/lxc_monitor_protocol.x index 3b66af5..205d7c2 100644 --- a/src/lxc/lxc_monitor_protocol.x +++ b/src/lxc/lxc_monitor_protocol.x @@ -30,7 +30,7 @@ enum virLXCMonitorExitStatus { }; struct virLXCMonitorExitEventMsg { - enum virLXCMonitorExitStatus status; + virLXCMonitorExitStatus status; }; struct virLXCMonitorInitEventMsg { diff --git a/src/lxc_monitor_protocol-structs b/src/lxc_monitor_protocol-structs index da72ec0..10c2af7 100644 --- a/src/lxc_monitor_protocol-structs +++ b/src/lxc_monitor_protocol-structs @@ -5,7 +5,7 @@ enum virLXCMonitorExitStatus { VIR_LXC_MONITOR_EXIT_STATUS_REBOOT = 2, }; struct virLXCMonitorExitEventMsg { - enum virLXCMonitorExitStatus status; + virLXCMonitorExitStatus status; }; struct virLXCMonitorInitEventMsg { uint64_t initpid; -- 1.9.5.msysgit.0

This allows to build libvirt under MinGW Signed-off-by: Pavel Fedin <p.fedin@samsung.com> --- configure.ac | 2 +- src/rpc/genprotocol.pl | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index cd6c972..6533b88 100644 --- a/configure.ac +++ b/configure.ac @@ -401,7 +401,7 @@ AM_CONDITIONAL([HAVE_LIBTASN1], [test "x$ac_cv_header_libtasn1_h" = "xyes"]) AC_CHECK_LIB([intl],[gettext],[]) dnl Do we have rpcgen? -AC_PATH_PROG([RPCGEN], [rpcgen], [no]) +AC_PATH_PROGS([RPCGEN], [rpcgen portable-rpcgen], [no]) AM_CONDITIONAL([HAVE_RPCGEN], [test "x$ac_cv_path_RPCGEN" != "xno"]) dnl Is this GLIBC's buggy rpcgen? AM_CONDITIONAL([HAVE_GLIBC_RPCGEN], diff --git a/src/rpc/genprotocol.pl b/src/rpc/genprotocol.pl index 6e6d6d4..1ac2507 100755 --- a/src/rpc/genprotocol.pl +++ b/src/rpc/genprotocol.pl @@ -38,7 +38,10 @@ my $target = shift; unlink $target; -open RPCGEN, "-|", $rpcgen, $mode, $xdrdef +if ($rpcgen =~ /portable-rpcgen/) { + $rpcgen = "$rpcgen -o -"; +} +open RPCGEN, "-|", "$rpcgen $mode $xdrdef" or die "cannot run $rpcgen $mode $xdrdef: $!"; open TARGET, ">$target" or die "cannot create $target: $!"; -- 1.9.5.msysgit.0

On Wed, Jul 08, 2015 at 02:29:21PM +0300, Pavel Fedin wrote:
This patch set allows to build libvirt natively under MinGW/MSYS using portablexdr library. An updated version of portablexdr with fixed bugs is available as part of MSYS2 project.
Differences from v1: - Split into two parts - Reflect structure definiton change also in xc_monitor_protocol-structs, fix "make syntax-check"
Pavel Fedin (2): Remove explicit enum from protocol structures Add support for portable-rpcgen from portablexdr library
ACK && Will push in a while (with one typo in commit message fixed).
configure.ac | 2 +- src/lxc/lxc_monitor_protocol.x | 2 +- src/lxc_monitor_protocol-structs | 2 +- src/rpc/genprotocol.pl | 5 ++++- 4 files changed, 7 insertions(+), 4 deletions(-)
-- 1.9.5.msysgit.0
participants (2)
-
Martin Kletzander
-
Pavel Fedin