Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ else
XEN_BUILD_TAG=
endif

if WITH_XEN490
XEN490_BUILD_TAG=with_xen490
else
XEN490_BUILD_TAG=
endif

if WITH_LIBVIRT
LIBVIRT_BUILD_TAG=with_libvirt
else
Expand All @@ -13,7 +19,7 @@ endif

COMMIT=`git describe --dirty --always --tags 2> /dev/null || true`
GOLDFLAGS="-X main.gitCommit=${COMMIT} -X main.version=${VERSION}"
HYPER_BULD_TAGS=$(XEN_BUILD_TAG) $(LIBVIRT_BUILD_TAG)
HYPER_BULD_TAGS=$(XEN_BUILD_TAG) $(XEN490_BUILD_TAG) $(LIBVIRT_BUILD_TAG)

all-local: build-runv
clean-local:
Expand Down
14 changes: 13 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,23 @@ if test "x$with_xen" != "xno" ; then
fi
fi

XEN_REQUIRED="4.5.0"
XENPV_REQUIRED="4.9.0"

if test "$with_xen" = yes; then
PKG_CHECK_MODULES([xenlight], [xenlight >= $XEN_REQUIRED], [with_xen=yes], [with_xen=no])
PKG_CHECK_MODULES([xenlight], [xenlight >= $XENPV_REQUIRED], [with_xen490=yes], [with_xen490=no])
fi

if test "x$with_xen" != "xno" ; then
AC_DEFINE_UNQUOTED([WITH_XEN], 1, [run hyperd with xen])
AC_DEFINE_UNQUOTED([WITH_XEN], 1, [run runv with xen])
fi
if test "x$with_xen490" = "xyes" ; then
AC_DEFINE_UNQUOTED([WITH_XEN490], 1, [run runv with xen 4.9 or above])
fi

AM_CONDITIONAL([WITH_XEN], [test "x$with_xen" == "xyes"])
AM_CONDITIONAL([WITH_XEN490], [test "x$with_xen490" == "xyes"])

AC_CONFIG_FILES([Makefile])

Expand Down
2 changes: 1 addition & 1 deletion hypervisor/xen/xen.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func (xc *XenContext) AddNic(ctx *hypervisor.VmContext, host *hypervisor.HostNic
glog.V(1).Infof("add network for %d - ip: %s, br: %s, gw: %s, dev: %s, hw: %s", xc.domId, guest.Ipaddr,
host.Bridge, host.Bridge, dev, hw.String())

res := HyperxlNicAdd(xc.driver.Ctx, (uint32)(xc.domId), guest.Ipaddr[0], host.Bridge, host.Bridge, dev, []byte(hw))
res := HyperxlNicAdd(xc.driver.Ctx, (uint32)(xc.domId), guest.Ipaddr, host.Bridge, host.Bridge, dev, []byte(hw))
if res != 0 {
glog.V(1).Infof("nic %s insert succeeded [faked] ", guest.Device)
result <- callback
Expand Down
2 changes: 1 addition & 1 deletion hypervisor/xenpv/xenpv.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build linux,with_xen
// +build linux,with_xen490

package xenpv

Expand Down
2 changes: 1 addition & 1 deletion hypervisor/xenpv/xenpv_unsupported.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build !with_xen
// +build !with_xen490

package xenpv

Expand Down
14 changes: 13 additions & 1 deletion lib/runvxenlight/xenlight-runv.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build linux,with_xen
// +build linux,with_xen490

/*
*
Expand Down Expand Up @@ -54,13 +54,25 @@ static int runvxl_domain_create_new(libxl_ctx *ctx, runvxl_domain_config *config
libxl_domain_config_init(&d_config);

d_config.num_p9s = 1;
#ifndef LIBXL_HAVE_P9S
//this flag is introduce since tag 4.10.0-rc1, introduce a field rename
d_config.p9 = malloc(sizeof(libxl_device_p9));
if (d_config.p9 == NULL) {
return -1;
}
d_config.p9->tag = config->p9_tag;
d_config.p9->path = config->p9_path;
d_config.p9->security_model = "none";
#else //LIBXL_HAVE_P9S
d_config.p9s = malloc(sizeof(libxl_device_p9));
if (d_config.p9s == NULL) {
return -1;
}
d_config.p9s->tag = config->p9_tag;
d_config.p9s->path = config->p9_path;
d_config.p9s->security_model = "none";
#endif //LIBXL_HAVE_P9S


d_config.num_channels = 2;
d_config.channels = malloc(sizeof(libxl_device_channel) * 2);
Expand Down
2 changes: 2 additions & 0 deletions lib/runvxenlight/xenlight.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build linux,with_xen490

/*
* Copyright (C) 2016 George W. Dunlap, Citrix Systems UK Ltd
*
Expand Down