[libvirt] [PATCH] build: avoid compilation warnings
by Eric Blake
Detected on cygwin:
util/util.c: In function 'virSetUIDGID':
util/util.c:2824: warning: format '%d' expects type 'int', but argument 7 has type 'gid_t' [-Wformat]
(and three other lines)
* src/util/util.c (virSetUIDGID): Cast, as is done elsewhere in
this file, to avoid printf type mismatch warnings.
---
Pushing under the build-breaker rule.
src/util/util.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/util/util.c b/src/util/util.c
index 197c571..60feb79 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -1,7 +1,7 @@
/*
* utils.c: common, generic utility functions
*
- * Copyright (C) 2006-2010 Red Hat, Inc.
+ * Copyright (C) 2006-2011 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
* Copyright (C) 2006, 2007 Binary Karma
* Copyright (C) 2006 Shuveb Hussain
@@ -2822,7 +2822,8 @@ virSetUIDGID(uid_t uid, gid_t gid)
if (gid > 0) {
if (setregid(gid, gid) < 0) {
virReportSystemError(errno,
- _("cannot change to '%d' group"), gid);
+ _("cannot change to '%d' group"),
+ (unsigned int) gid);
return -1;
}
}
@@ -2844,14 +2845,15 @@ virSetUIDGID(uid_t uid, gid_t gid)
getpwuid_r(uid, &pwd, buf, bufsize, &pwd_result);
if (!pwd_result) {
virReportSystemError(errno,
- _("cannot getpwuid_r(%d)"), uid);
+ _("cannot getpwuid_r(%d)"),
+ (unsigned int) uid);
VIR_FREE(buf);
return -1;
}
if (initgroups(pwd.pw_name, pwd.pw_gid) < 0) {
virReportSystemError(errno,
_("cannot initgroups(\"%s\", %d)"),
- pwd.pw_name, pwd.pw_gid);
+ pwd.pw_name, (unsigned int) pwd.pw_gid);
VIR_FREE(buf);
return -1;
}
@@ -2859,7 +2861,8 @@ virSetUIDGID(uid_t uid, gid_t gid)
# endif
if (setreuid(uid, uid) < 0) {
virReportSystemError(errno,
- _("cannot change to uid to '%d'"), uid);
+ _("cannot change to uid to '%d'"),
+ (unsigned int) uid);
return -1;
}
}
--
1.7.3.4
13 years, 12 months
[libvirt] [PATCH] node_device: udev driver does not handle SR-IOV devices
by Chris Wright
The udev driver does not update a PCI device with its SR-IOV capabilities,
when applicable, the way the hal driver does. As a result, dumping the
device's XML will not include the relevant physical or virtual function
information.
With this patch, the XML is correct:
# virsh nodedev-dumpxml pci_0000_09_00_0
<device>
<name>pci_0000_09_00_0</name>
<parent>pci_0000_00_1c_0</parent>
<driver>
<name>vxge</name>
</driver>
<capability type='pci'>
<domain>0</domain>
<bus>9</bus>
<slot>0</slot>
<function>0</function>
<product id='0x5833'>X3100 Series 10 Gigabit Ethernet PCIe</product>
<vendor id='0x17d5'>Neterion Inc.</vendor>
<capability type='virt_functions'>
<address domain='0x0000' bus='0x0a' slot='0x00' function='0x1'/>
<address domain='0x0000' bus='0x0a' slot='0x00' function='0x2'/>
<address domain='0x0000' bus='0x0a' slot='0x00' function='0x3'/>
</capability>
</capability>
</device>
# virsh nodedev-dumpxml pci_0000_0a_00_1
<device>
<name>pci_0000_0a_00_1</name>
<parent>pci_0000_00_1c_0</parent>
<driver>
<name>vxge</name>
</driver>
<capability type='pci'>
<domain>0</domain>
<bus>10</bus>
<slot>0</slot>
<function>1</function>
<product id='0x5833'>X3100 Series 10 Gigabit Ethernet PCIe</product>
<vendor id='0x17d5'>Neterion Inc.</vendor>
<capability type='phys_function'>
<address domain='0x0000' bus='0x09' slot='0x00' function='0x0'/>
</capability>
</capability>
</device>
Cc: Dave Allan <dallan(a)redhat.com>
Signed-off-by: Chris Wright <chrisw(a)redhat.com>
---
src/node_device/node_device_udev.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 02e44a1..379af86 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -419,11 +419,11 @@ out:
static int udevProcessPCI(struct udev_device *device,
virNodeDeviceDefPtr def)
{
- const char *devpath = NULL;
+ const char *syspath = NULL;
union _virNodeDevCapData *data = &def->caps->data;
int ret = -1;
- devpath = udev_device_get_devpath(device);
+ syspath = udev_device_get_syspath(device);
if (udevGetUintProperty(device,
"PCI_CLASS",
@@ -432,7 +432,7 @@ static int udevProcessPCI(struct udev_device *device,
goto out;
}
- char *p = strrchr(devpath, '/');
+ char *p = strrchr(syspath, '/');
if ((p == NULL) || (udevStrToLong_ui(p+1,
&p,
@@ -487,6 +487,9 @@ static int udevProcessPCI(struct udev_device *device,
goto out;
}
+ get_physical_function(syspath, data);
+ get_virtual_functions(syspath, data);
+
ret = 0;
out:
13 years, 12 months
[libvirt] libvirtd and listen_addr
by Daniel Huhardeaux
Hi,
at first, best wishes to all for this new year.
We have a request: would it be possible to start libvirtd listen_addr
*after* the VM network is up?
We have VPN through different libvirt+kvm servers and want to virsh
connect to the private VM network address of each server instead of his
VPN IP. The problem is that libvirt doesn't start with unknown IP
address. If network would be already up, libvirt could listen on this
address.
Regards
libvirtd (libvirt) 0.8.3 - Debian stable + backports
--
Daniel
13 years, 12 months