your distribution's network configuration tools. See the [wiki][net]
for guidance and examples.
+### gatewaydev
+
+Specifies the name of the network interface which has an IP and which
+is in the network the VIF should communicate with. This is used in the host
+by the vif-route hotplug script. See [wiki][vifroute] for guidance and
+examples.
+
+NOTE: netdev is a deprecated alias of this option.
+
### type
This keyword is valid for HVM guests only.
[oui]: http://en.wikipedia.org/wiki/Organizationally_Unique_Identifier
[net]: http://wiki.xen.org/wiki/HostConfiguration/Networking
+[vifroute]: http://wiki.xen.org/wiki/Vif-route
if (rc) goto out;
front = flexarray_make(gc, 16, 1);
- back = flexarray_make(gc, 16, 1);
+ back = flexarray_make(gc, 18, 1);
if (nic->devid == -1) {
if ((nic->devid = libxl__device_nextid(gc, domid, "vif") < 0)) {
flexarray_append(back, "ip");
flexarray_append(back, libxl__strdup(gc, nic->ip));
}
+ if (nic->gatewaydev) {
+ flexarray_append(back, "gatewaydev");
+ flexarray_append(back, libxl__strdup(gc, nic->gatewaydev));
+ }
if (nic->rate_interval_usecs > 0) {
flexarray_append(back, "rate");
char *script, libxl__device *dev)
{
const char *type = libxl__device_kind_to_string(dev->backend_kind);
+ char *be_path = libxl__device_backend_path(gc, dev);
char **env;
+ char *gatewaydev;
int nr = 0;
libxl_nic_type nictype;
- const int arraysize = 13;
+ gatewaydev = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/%s", be_path,
+ "gatewaydev"));
+
+ const int arraysize = 15;
GCNEW_ARRAY(env, arraysize);
env[nr++] = "script";
env[nr++] = script;
env[nr++] = GCSPRINTF("backend/%s/%u/%d", type, dev->domid, dev->devid);
env[nr++] = "XENBUS_BASE_PATH";
env[nr++] = "backend";
+ env[nr++] = "netdev";
+ env[nr++] = gatewaydev ? : "";
if (dev->backend_kind == LIBXL__DEVICE_KIND_VIF) {
if (libxl__nic_type(gc, dev, &nictype)) {
LOG(ERROR, "unable to get nictype");
("nictype", libxl_nic_type),
("rate_bytes_per_interval", uint64),
("rate_interval_usecs", uint32),
+ ("gatewaydev", string),
])
libxl_device_pci = Struct("device_pci", [
parse_vif_rate(&config, (p2 + 1), nic);
} else if (!strcmp(p, "accel")) {
fprintf(stderr, "the accel parameter for vifs is currently not supported\n");
+ } else if (!strcmp(p, "netdev")) {
+ fprintf(stderr, "the netdev parameter is deprecated, "
+ "please use gatewaydev instead\n");
+ free(nic->gatewaydev);
+ nic->gatewaydev = strdup(p2 + 1);
+ } else if (!strcmp(p, "gatewaydev")) {
+ free(nic->gatewaydev);
+ nic->gatewaydev = strdup(p2 + 1);
}
} while ((p = strtok(NULL, ",")) != NULL);
skip_nic:
}
} else if (MATCH_OPTION("bridge", *argv, oparg)) {
replace_string(&nic.bridge, oparg);
+ } else if (MATCH_OPTION("netdev", *argv, oparg)) {
+ fprintf(stderr, "the netdev parameter is deprecated, "
+ "please use gatewaydev instead\n");
+ replace_string(&nic.gatewaydev, oparg);
+ } else if (MATCH_OPTION("gatewaydev", *argv, oparg)) {
+ replace_string(&nic.gatewaydev, oparg);
} else if (MATCH_OPTION("ip", *argv, oparg)) {
replace_string(&nic.ip, oparg);
} else if (MATCH_OPTION("script", *argv, oparg)) {