[libvirt] [PATCH] util: Avoid calling closedir(NULL)
by Jiri Denemark
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/util/virnetdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index ea95552..5c79c42 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -3104,63 +3104,63 @@ static int
virNetDevRDMAFeature(const char *ifname,
virBitmapPtr *out)
{
char *eth_devpath = NULL;
char *ib_devpath = NULL;
char *eth_res_buf = NULL;
char *ib_res_buf = NULL;
DIR *dirp = NULL;
struct dirent *dp;
int ret = -1;
if (!virFileExists(SYSFS_INFINIBAND_DIR))
return 0;
if (!(dirp = opendir(SYSFS_INFINIBAND_DIR))) {
virReportSystemError(errno,
_("Failed to opendir path '%s'"),
SYSFS_INFINIBAND_DIR);
- goto cleanup;
+ return -1;
}
if (virAsprintf(ð_devpath, SYSFS_NET_DIR "%s/device/resource", ifname) < 0)
goto cleanup;
if (!virFileExists(eth_devpath))
goto cleanup;
if (virFileReadAll(eth_devpath, RESOURCE_FILE_LEN, ð_res_buf) < 0)
goto cleanup;
while (virDirRead(dirp, &dp, SYSFS_INFINIBAND_DIR) > 0) {
if (dp->d_name[0] == '.')
continue;
if (virAsprintf(&ib_devpath, SYSFS_INFINIBAND_DIR "%s/device/resource",
dp->d_name) < 0)
continue;
if (virFileReadAll(ib_devpath, RESOURCE_FILE_LEN, &ib_res_buf) > 0 &&
STREQ(eth_res_buf, ib_res_buf)) {
ignore_value(virBitmapSetBit(*out, VIR_NET_DEV_FEAT_RDMA));
break;
}
VIR_FREE(ib_devpath);
VIR_FREE(ib_res_buf);
}
ret = 0;
cleanup:
closedir(dirp);
VIR_FREE(eth_devpath);
VIR_FREE(ib_devpath);
VIR_FREE(eth_res_buf);
VIR_FREE(ib_res_buf);
return ret;
}
/**
* virNetDevSendEthtoolIoctl
* This function sends ethtool ioctl request
*
* @ifname: name of the interface
* @cmd: reference to an ethtool command structure
*
* Returns 0 on success, -1 on failure.
*/
--
2.7.2
8 years, 10 months
[libvirt] [PATCH v2 0/2] Enable detection for zero writes
by Martin Kletzander
This is a second version with few things fixed. The main difference
is that now this series uses zeroes instead of zeros. The latter was
chosen at first just because there were more occurences in our
codebase, but the former is used now to minimise the confusion --
mainly when none of the versions were used when interfacing with the
user or mgmt app.
The naming is kept from the previous version despite the discussion as
I believe this is pretty general. Also the default value is not
changed to 'off' in order for it to be general enough (some
hypervisors might choose a different default in the future).
Martin Kletzander (2):
conf: Add support of zero-detection for disks
qemu: Add support for zero-detection writes
docs/formatdomain.html.in | 10 +++++
docs/schemas/domaincommon.rng | 12 ++++++
src/conf/domain_conf.c | 23 ++++++++++-
src/conf/domain_conf.h | 11 ++++++
src/libvirt_private.syms | 2 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 11 ++++++
tests/qemucapabilitiesdata/caps_2.1.1-1.caps | 1 +
tests/qemucapabilitiesdata/caps_2.4.0-1.caps | 1 +
tests/qemucapabilitiesdata/caps_2.5.0-1.caps | 1 +
tests/qemucapabilitiesdata/caps_2.6.0-1.caps | 1 +
.../qemuxml2argv-disk-drive-detect-zeroes.args | 27 +++++++++++++
.../qemuxml2argv-disk-drive-detect-zeroes.xml | 45 ++++++++++++++++++++++
tests/qemuxml2argvtest.c | 3 ++
.../qemuxml2xmlout-disk-drive-detect-zeroes.xml | 1 +
tests/qemuxml2xmltest.c | 1 +
17 files changed, 152 insertions(+), 1 deletion(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-drive-detect-zeroes.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-drive-detect-zeroes.xml
create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-detect-zeroes.xml
--
2.7.1
8 years, 10 months
[libvirt] [PATCH V2] Fix bug of attaching redirdev device
by Osier Yang
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1298070
The corresponding chardev must be attached first, otherwise the
the qemu command line won't be complete (missing the host part),
---
src/qemu/qemu_hotplug.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index ee305e7..40cead7 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1381,6 +1381,7 @@ int qemuDomainAttachRedirdevDevice(virQEMUDriverPtr driver,
int ret;
qemuDomainObjPrivatePtr priv = vm->privateData;
virDomainDefPtr def = vm->def;
+ char *charAlias = NULL;
char *devstr = NULL;
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
@@ -1391,6 +1392,10 @@ int qemuDomainAttachRedirdevDevice(virQEMUDriverPtr driver,
if (qemuAssignDeviceRedirdevAlias(vm->def, redirdev, -1) < 0)
goto error;
+
+ if (virAsprintf(&charAlias, "char%s", redirdev->info.alias) < 0)
+ goto error;
+
if (!(devstr = qemuBuildRedirdevDevStr(def, redirdev, priv->qemuCaps)))
goto error;
@@ -1398,6 +1403,14 @@ int qemuDomainAttachRedirdevDevice(virQEMUDriverPtr driver,
goto error;
qemuDomainObjEnterMonitor(driver, vm);
+ if (qemuMonitorAttachCharDev(priv->mon,
+ charAlias,
+ &(redirdev->source.chr)) < 0) {
+ ignore_value(qemuDomainObjExitMonitor(driver, vm));
+ goto error;
+ }
+ VIR_FREE(charAlias);
+
ret = qemuMonitorAddDevice(priv->mon, devstr);
if (qemuDomainObjExitMonitor(driver, vm) < 0)
@@ -1414,9 +1427,9 @@ int qemuDomainAttachRedirdevDevice(virQEMUDriverPtr driver,
return 0;
error:
+ VIR_FREE(charAlias);
VIR_FREE(devstr);
return -1;
-
}
static int
--
2.1.4
8 years, 10 months
[libvirt] [PATCH] vircgroupmock: Mock access("/sys/devices/system/cpu/present")
by Michal Privoznik
There's been a report on the upstream list [1] describing we
access /sys/devices/system/cpu/present directly on the host from
within our test suite. This may end up in unpredictable results
as no all linux systems are required to have that file. Mock
access to the file.
libvirt.git/tests $ ../run strace vircgrouptest
...
access("/sys/devices/system/cpu/present", F_OK) = 0
open("libvirt.git/tests/fakerootdir-DmE8Z9/not/really/sys/fs/cgroup//devices_system_cpu_present", O_RDONLY) = 4
read(4, "8-23,48-159\n", 5121) = 12
read(4, "", 5109) = 0
close(4) = 0
...
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
tests/vircgroupmock.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/vircgroupmock.c b/tests/vircgroupmock.c
index 9ce7d41..756ac51 100644
--- a/tests/vircgroupmock.c
+++ b/tests/vircgroupmock.c
@@ -541,7 +541,8 @@ int access(const char *path, int mode)
ret = realaccess(newpath, mode);
free(newpath);
} else if (STREQ(path, "/proc/cgroups") ||
- STREQ(path, "/proc/self/cgroup")) {
+ STREQ(path, "/proc/self/cgroup") ||
+ STREQ(path, SYSFS_CPU_PRESENT)) {
/* These files are readable for all. */
ret = (mode == F_OK || mode == R_OK) ? 0 : -1;
} else if (STREQ(path, "/proc/mounts")) {
--
2.4.10
8 years, 10 months
[libvirt] how to test libvirt?
by Zhangbo (Oscar)
Hi all:
AFAIK, there're several ways to test libvirt:
1) virt-test, which is driven by autotest or avocado-vt, based on qemu-kvm
2) test driver which is parall to other drivers such as qemu_driver and libxl_driver in libvirt.
3) make -c tests, which aims to do low level tests, that is to test function modules of libvirt.
4) libvirt-test-API
I've got 2 questions:
1) besides the 4 test suites, are there any other automatic-test tools?
2) is there any testsuite used to test libxl_driver, similar to virt-test?
Anyone knows that? Thanks in advance.
Oscar.
8 years, 10 months
[libvirt] [PATCH] build: accomodate selinux 2.5 header API change
by Eric Blake
Yet again, selinux has been adding const-correctness; this change
is ABI-compatible, but breaks API, which affects us when we try to
override things in our testsuite:
../../tests/securityselinuxhelper.c:307:24: error: conflicting types for 'selabel_open'
struct selabel_handle *selabel_open(unsigned int backend,
^~~~~~~~~~~~
In file included from ../../tests/securityselinuxhelper.c:32:0:
/usr/include/selinux/label.h:73:24: note: previous declaration of 'selabel_open' was here
The problem is a new 'const' prior to the second parameter.
Fix it the same way we did in commit 292d3f2d: check for the new
const at configure time.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under the build-breaker rule.
m4/virt-selinux.m4 | 17 ++++++++++++++++-
tests/securityselinuxhelper.c | 10 ++++++----
2 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/m4/virt-selinux.m4 b/m4/virt-selinux.m4
index 357b758..a65e978 100644
--- a/m4/virt-selinux.m4
+++ b/m4/virt-selinux.m4
@@ -1,6 +1,6 @@
dnl The libselinux.so library
dnl
-dnl Copyright (C) 2012-2014 Red Hat, Inc.
+dnl Copyright (C) 2012-2014, 2016 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
@@ -41,6 +41,21 @@ int setcon(char *context);
AC_DEFINE_UNQUOTED([VIR_SELINUX_CTX_CONST], [$lv_cv_setcon_const],
[Define to empty or 'const' depending on how SELinux qualifies its
security context parameters])
+ # ...and again for 2.5
+ AC_CACHE_CHECK([for selinux selabel_open parameter type],
+ [lv_cv_selabel_open_const],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <selinux/selinux.h>
+#include <selinux/label.h>
+struct selabel_handle *selabel_open(unsigned, struct selinux_opt *, unsigned);
+ ]])],
+ [lv_cv_selabel_open_const=''],
+ [lv_cv_selabel_open_const='const'])])
+ AC_DEFINE_UNQUOTED([VIR_SELINUX_OPEN_CONST], [$lv_cv_selabel_open_const],
+ [Define to empty or 'const' depending on how SELinux qualifies its
+ selabel_open parameter])
AC_MSG_CHECKING([SELinux mount point])
if test "$with_selinux_mount" = "check" || test -z "$with_selinux_mount"; then
diff --git a/tests/securityselinuxhelper.c b/tests/securityselinuxhelper.c
index 1252c15..2cfa43f 100644
--- a/tests/securityselinuxhelper.c
+++ b/tests/securityselinuxhelper.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011-2013 Red Hat, Inc.
+ * Copyright (C) 2011-2013, 2016 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -60,6 +60,7 @@ static const char *(*realselinux_lxc_contexts_path)(void);
#if HAVE_SELINUX_LABEL_H
static struct selabel_handle *(*realselabel_open)(unsigned int backend,
+ VIR_SELINUX_OPEN_CONST
struct selinux_opt *opts,
unsigned nopts);
static void (*realselabel_close)(struct selabel_handle *handle);
@@ -304,9 +305,10 @@ const char *selinux_lxc_contexts_path(void)
#endif
#if HAVE_SELINUX_LABEL_H
-struct selabel_handle *selabel_open(unsigned int backend,
- struct selinux_opt *opts,
- unsigned nopts)
+struct selabel_handle *
+selabel_open(unsigned int backend,
+ VIR_SELINUX_OPEN_CONST struct selinux_opt *opts,
+ unsigned nopts)
{
char *fake_handle;
--
2.5.0
8 years, 10 months
[libvirt] Dealing with GCC 6.0
by Martin Kletzander
So we recently started compiling with gcc 5 and there's a new thing now
and we don't build on gcc 6. I know it's just a development build, but
it finds new things, like:
fdstream.c: In function 'virFDStreamWrite':
fdstream.c:390:29: error: logical 'or' of equal expressions [-Werror=logical-op]
if (errno == EAGAIN || errno == EWOULDBLOCK) {
^~
fdstream.c: In function 'virFDStreamRead':
fdstream.c:440:29: error: logical 'or' of equal expressions [-Werror=logical-op]
if (errno == EAGAIN || errno == EWOULDBLOCK) {
^~
and
rpc/virnetsshsession.c: In function 'virNetSSHAuthenticateAgent':
rpc/virnetsshsession.c:548:56: error: logical 'and' of equal expressions [-Werror=logical-op]
if (ret != LIBSSH2_ERROR_AUTHENTICATION_FAILED &&
^~
rpc/virnetsshsession.c: In function 'virNetSSHAuthenticatePrivkey':
rpc/virnetsshsession.c:676:57: error: logical 'or' of equal expressions [-Werror=logical-op]
if (ret == LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED ||
^~
The first one is prety easy to fix, that's the only place where we use
EWOULDBLOCK, we are using only EAGAIN everywhere else. However, the
second one is not that easy to change for me as I'm not a libssh expert
and moreover, I would like to know other's opinions on how to tackle
that. We can disable the logical-op warning, but it might show
something that makes sense (really?). Or we can do bunch of very very
ugly "#if"s.
Anyone care to share an idea?
Have a nice day,
Martin
8 years, 10 months
[libvirt] [PATCH v2 0/4] implement vram64 attribute for QXL video device
by Pavel Hrdina
New in v2:
- added patch to always set primary video device as primary
- introduced new qemu monitor functions to update vram64 values after QEMU is
started only if QEMU supports this parameter
Pavel Hrdina (4):
domain_conf: always set primary video device as primary
docs/formatdomain: rewrite video documentation
qemu_capabilities: introduce QEMU_CAPS_QXL(_VGA)_VRAM64
qemu: introduce vram64 attribute for QXL video device
docs/formatdomain.html.in | 18 ++++----
docs/schemas/domaincommon.rng | 5 ++
src/conf/domain_conf.c | 40 +++++++++++++---
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 4 ++
src/qemu/qemu_capabilities.h | 2 +
src/qemu/qemu_command.c | 32 ++++++++++---
src/qemu/qemu_monitor.c | 35 ++++++++++++++
src/qemu/qemu_monitor.h | 4 ++
src/qemu/qemu_monitor_json.c | 54 ++++++++++++++++++++++
src/qemu/qemu_monitor_json.h | 3 ++
src/qemu/qemu_process.c | 24 ++++++----
tests/qemucapabilitiesdata/caps_1.2.2-1.caps | 2 +
tests/qemucapabilitiesdata/caps_1.3.1-1.caps | 2 +
tests/qemucapabilitiesdata/caps_1.4.2-1.caps | 2 +
tests/qemucapabilitiesdata/caps_1.5.3-1.caps | 2 +
tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 2 +
tests/qemucapabilitiesdata/caps_1.6.50-1.caps | 2 +
tests/qemucapabilitiesdata/caps_2.1.1-1.caps | 2 +
tests/qemucapabilitiesdata/caps_2.4.0-1.caps | 2 +
tests/qemucapabilitiesdata/caps_2.5.0-1.caps | 2 +
tests/qemucapabilitiesdata/caps_2.6.0-1.caps | 2 +
...qemuhotplug-console-compat-2+console-virtio.xml | 2 +-
.../qemuxml2argv-console-compat-2.xml | 2 +-
.../qemuxml2argv-video-qxl-device-vram64.args | 25 ++++++++++
.../qemuxml2argv-video-qxl-device-vram64.xml | 29 ++++++++++++
.../qemuxml2argv-video-qxl-sec-device-vram64.args | 27 +++++++++++
.../qemuxml2argv-video-qxl-sec-device-vram64.xml | 32 +++++++++++++
.../qemuxml2xmlout-graphics-listen-network.xml | 2 +-
.../qemuxml2xmlout-graphics-listen-network2.xml | 2 +-
.../qemuxml2xmlout-graphics-sdl-fullscreen.xml | 2 +-
.../qemuxml2xmlout-graphics-sdl.xml | 2 +-
.../qemuxml2xmlout-graphics-spice-compression.xml | 2 +-
.../qemuxml2xmlout-graphics-spice-qxl-vga.xml | 2 +-
.../qemuxml2xmlout-graphics-spice-timeout.xml | 2 +-
.../qemuxml2xmlout-graphics-spice.xml | 2 +-
.../qemuxml2xmlout-graphics-vnc-sasl.xml | 2 +-
.../qemuxml2xmlout-graphics-vnc-tls.xml | 2 +-
.../qemuxml2xmlout-graphics-vnc-websocket.xml | 2 +-
.../qemuxml2xmlout-graphics-vnc.xml | 2 +-
.../qemuxml2xmlout-interface-server.xml | 2 +-
.../qemuxml2xmlout-net-bandwidth.xml | 2 +-
.../qemuxml2xmlout-net-bandwidth2.xml | 2 +-
.../qemuxml2xmlout-pci-autoadd-addr.xml | 2 +-
.../qemuxml2xmlout-pci-autoadd-idx.xml | 2 +-
.../qemuxml2xmlout-pci-bridge.xml | 2 +-
.../qemuxml2xmlout-pcie-root-port.xml | 2 +-
.../qemuxml2xmlout-pcie-switch-downstream-port.xml | 2 +-
.../qemuxml2xmlout-pcie-switch-upstream-port.xml | 2 +-
.../qemuxml2xmlout-pcihole64-q35.xml | 2 +-
.../qemuxml2xmlout-q35-usb2-multi.xml | 2 +-
.../qemuxml2xmlout-q35-usb2-reorder.xml | 2 +-
.../qemuxml2xmloutdata/qemuxml2xmlout-q35-usb2.xml | 2 +-
tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml | 2 +-
...emuxml2xmlout-seclabel-dynamic-none-relabel.xml | 2 +-
.../qemuxml2xmlout-serial-spiceport.xml | 2 +-
.../qemuxml2xmlout-video-virtio-gpu-device.xml | 2 +-
.../qemuxml2xmlout-video-virtio-gpu-virgl.xml | 2 +-
58 files changed, 357 insertions(+), 62 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vram64.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vram64.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vram64.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vram64.xml
--
2.7.1
8 years, 10 months
[libvirt] [FOR 1.3.0 PATCH] conf: add net device prefix for Xen
by Jim Fehlig
In commit d2e5538b1, the libxl driver was changed to copy interface
names autogenerated by libxl to the corresponding network def in the
domain's virDomainDef object. The copied name is freed when the domain
transitions to the shutoff state. But when migrating a domain, the
autogenerated name is included in the XML sent to the destination host.
It is possible an interface with the same name already exists on the
destination host, causing migration to fail. Indeed the Xen project's
OSSTEST CI already encountered such a failure.
This patch defines another VIR_NET_GENERATED_PREFIX for Xen, allowing
the autogenerated names to be excluded when parsing and formatting
inactive config.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
This is an alternative approach to Joao's fix for this regression
https://www.redhat.com/archives/libvir-list/2015-December/msg00197.html
I think it is the same approach used by the qemu driver. My only
reservation is that it expands the potential for clashes with
user-defined names. I.e. with this change both 'vnet' and 'vif' are
reserved prefixes.
src/conf/domain_conf.c | 6 ++++--
src/conf/domain_conf.h | 4 ++++
src/libxl/libxl_domain.c | 5 +++--
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 2f5c0ed..debcf4e 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8428,7 +8428,8 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
ifname = virXMLPropString(cur, "dev");
if (ifname &&
(flags & VIR_DOMAIN_DEF_PARSE_INACTIVE) &&
- STRPREFIX(ifname, VIR_NET_GENERATED_PREFIX)) {
+ (STRPREFIX(ifname, VIR_NET_GENERATED_PREFIX) ||
+ STRPREFIX(ifname, VIR_NET_GENERATED_PREFIX_XEN))) {
/* An auto-generated target name, blank it out */
VIR_FREE(ifname);
}
@@ -19790,7 +19791,8 @@ virDomainNetDefFormat(virBufferPtr buf,
virBufferEscapeString(buf, "<backenddomain name='%s'/>\n", def->domain_name);
if (def->ifname &&
!((flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE) &&
- (STRPREFIX(def->ifname, VIR_NET_GENERATED_PREFIX)))) {
+ (STRPREFIX(def->ifname, VIR_NET_GENERATED_PREFIX) ||
+ STRPREFIX(def->ifname, VIR_NET_GENERATED_PREFIX_XEN)))) {
/* Skip auto-generated target names for inactive config. */
virBufferEscapeString(buf, "<target dev='%s'/>\n", def->ifname);
}
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 90d8e13..d2cc26f 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1085,6 +1085,10 @@ struct _virDomainNetDef {
* by libvirt, and cannot be used for a persistent network name. */
# define VIR_NET_GENERATED_PREFIX "vnet"
+/* Used for prefix of ifname of any network name generated dynamically
+ * by libvirt for Xen, and cannot be used for a persistent network name. */
+# define VIR_NET_GENERATED_PREFIX_XEN "vif"
+
typedef enum {
VIR_DOMAIN_CHR_DEVICE_STATE_DEFAULT = 0,
VIR_DOMAIN_CHR_DEVICE_STATE_CONNECTED,
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index ef92974..c5d84a4 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -734,7 +734,7 @@ libxlDomainCleanup(libxlDriverPrivatePtr driver,
for (i = 0; i < vm->def->nnets; i++) {
virDomainNetDefPtr net = vm->def->nets[i];
- if (STRPREFIX(net->ifname, "vif"))
+ if (STRPREFIX(net->ifname, VIR_NET_GENERATED_PREFIX_XEN))
VIR_FREE(net->ifname);
}
}
@@ -918,7 +918,8 @@ libxlDomainCreateIfaceNames(virDomainDefPtr def, libxl_domain_config *d_config)
if (net->ifname)
continue;
- ignore_value(virAsprintf(&net->ifname, "vif%d.%d%s",
+ ignore_value(virAsprintf(&net->ifname,
+ VIR_NET_GENERATED_PREFIX_XEN "%d.%d%s",
def->id, x_nic->devid, suffix));
}
}
--
2.6.1
8 years, 10 months
[libvirt] request for wiki account
by Adam Hunt
I would like to request an account to update the libvirt wiki.
first: Adam
last: Hunt
user: voxadam
email: voxadam(a)gmail.com
--adam
8 years, 10 months