[libvirt] [PATCH] zfs: fix storagepoolxml2xml test
by Roman Bogorodskiy
Commit c4d27bd dropped output of owner/group -1.
Update zfs tests accordingly.
---
tests/storagepoolxml2xmlout/pool-zfs-sourcedev.xml | 2 --
tests/storagepoolxml2xmlout/pool-zfs.xml | 2 --
2 files changed, 4 deletions(-)
diff --git a/tests/storagepoolxml2xmlout/pool-zfs-sourcedev.xml b/tests/storagepoolxml2xmlout/pool-zfs-sourcedev.xml
index bbd2e9f..89dcdbf 100644
--- a/tests/storagepoolxml2xmlout/pool-zfs-sourcedev.xml
+++ b/tests/storagepoolxml2xmlout/pool-zfs-sourcedev.xml
@@ -12,8 +12,6 @@
<path>/dev/zvol/testpool</path>
<permissions>
<mode>0755</mode>
- <owner>-1</owner>
- <group>-1</group>
</permissions>
</target>
</pool>
diff --git a/tests/storagepoolxml2xmlout/pool-zfs.xml b/tests/storagepoolxml2xmlout/pool-zfs.xml
index ff02329..c9e5df9 100644
--- a/tests/storagepoolxml2xmlout/pool-zfs.xml
+++ b/tests/storagepoolxml2xmlout/pool-zfs.xml
@@ -11,8 +11,6 @@
<path>/dev/zvol/testpool</path>
<permissions>
<mode>0755</mode>
- <owner>-1</owner>
- <group>-1</group>
</permissions>
</target>
</pool>
--
2.3.7
9 years, 6 months
[libvirt] [PATCH] bhyve: fix build with gcc48
by Roman Bogorodskiy
Build with gcc 4.8 fails with:
bhyve/bhyve_monitor.c: In function 'bhyveMonitorIO':
bhyve/bhyve_monitor.c:51:18: error: missing initializer for field 'tv_sec' of 'const struct timespec' [-Werror=missing-field-initializers]
const struct timespec zerowait = {};
Explicitly initialize zerowait to fix the build.
---
src/bhyve/bhyve_monitor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/bhyve/bhyve_monitor.c b/src/bhyve/bhyve_monitor.c
index 7f19c6e..1316720 100644
--- a/src/bhyve/bhyve_monitor.c
+++ b/src/bhyve/bhyve_monitor.c
@@ -48,7 +48,7 @@ struct _bhyveMonitor {
static void
bhyveMonitorIO(int watch, int kq, int events ATTRIBUTE_UNUSED, void *opaque)
{
- const struct timespec zerowait = {};
+ const struct timespec zerowait = { 0, 0 };
bhyveMonitorPtr mon = opaque;
struct kevent kev;
int rc, status;
--
2.3.7
9 years, 6 months
[libvirt] [PATCH] Add missing XDR_FLAGS
by Pavel Fedin
Fixes build problems on x86_64-cygwin host for aarch64 target:
CC lxc/libvirt_driver_lxc_impl_la-lxc_monitor_protocol.lo
In file included from lxc/lxc_monitor_protocol.c:7:0:
lxc/lxc_monitor_protocol.h:9:21: fatal error: rpc/rpc.h: No such file or directory
CC rpc/libvirt_setuid_rpc_client_la-virnetmessage.lo
In file included from rpc/virnetmessage.h:24:0,
from rpc/virnetmessage.c:26:
rpc/virnetprotocol.h:9:21: fatal error: rpc/rpc.h: No such file or directory
CC lxc/libvirt_lxc-lxc_monitor_protocol.o
In file included from lxc/lxc_monitor_protocol.c:7:0:
lxc/lxc_monitor_protocol.h:9:21: fatal error: rpc/rpc.h: No such file or directory
Signed-off-by: Pavel Fedin <p.fedin(a)samsung.com>
---
src/Makefile.am | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/Makefile.am b/src/Makefile.am
index 579421d..0d1f58b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1290,6 +1290,7 @@ endif ! WITH_DRIVER_MODULES
libvirt_driver_lxc_impl_la_CFLAGS = \
$(LIBNL_CFLAGS) \
$(FUSE_CFLAGS) \
+ $(XDR_CFLAGS) \
-I$(srcdir)/access \
-I$(srcdir)/conf \
$(AM_CFLAGS)
@@ -2216,6 +2217,7 @@ libvirt_setuid_rpc_client_la_CFLAGS = \
-I$(srcdir)/rpc \
$(AM_CFLAGS) \
$(SECDRIVER_CFLAGS) \
+ $(XDR_CFLAGS) \
$(NULL)
endif WITH_LXC
@@ -2665,6 +2667,7 @@ libvirt_lxc_CFLAGS = \
$(LIBNL_CFLAGS) \
$(FUSE_CFLAGS) \
$(DBUS_CFLAGS) \
+ $(XDR_CFLAGS) \
$(NULL)
if WITH_BLKID
libvirt_lxc_CFLAGS += $(BLKID_CFLAGS)
--
1.9.5.msysgit.0
9 years, 6 months
[libvirt] [PATCH 00/13] Admin API
by Martin Kletzander
This is a working part of the administration API with some usability
helpers. We're still missing documentation and proper client (for
which virsh needs to be split), but apart from the last three patches,
this series is ready to go in if we decide that the documentation and
client work can be done later on.
Martin Kletzander (13):
util: add virJSONValueCopy
Move daemon-related parts of virNetServer to virNetDaemon
Teach gendispatch how to handle admin dispatching files
Add admin protocol
Build client headers for admin protocol
Add admin error domain
Add libvirt-admin library
Add XML files with admin API specification
Add configuration options for permissions on daemon's admin socket
Add support for admin API in libvirt daemon
rpc: Add virNetServerGetNClients
admin: Add virAdmHello function
Example virt-admin
.gitignore | 5 +
Makefile.am | 4 +-
cfg.mk | 9 +-
configure.ac | 11 +-
daemon/Makefile.am | 34 +-
daemon/admin_server.c | 139 +++++++
daemon/admin_server.h | 36 ++
daemon/libvirtd-config.c | 5 +-
daemon/libvirtd-config.h | 1 +
daemon/libvirtd.aug | 1 +
daemon/libvirtd.c | 205 +++++++---
daemon/libvirtd.conf | 8 +
daemon/libvirtd.h | 14 +-
daemon/test_libvirtd.aug.in | 1 +
docs/Makefile.am | 23 +-
docs/apibuild.py | 10 +-
docs/internals.html.in | 4 +-
docs/internals/rpc.html.in | 7 +
include/libvirt/Makefile.am | 4 +-
include/libvirt/libvirt-admin.h | 63 ++++
include/libvirt/virterror.h | 3 +-
libvirt-admin.pc.in | 13 +
libvirt.spec.in | 10 +
po/POTFILES.in | 4 +
src/Makefile.am | 127 ++++++-
src/admin/admin_protocol.x | 78 ++++
src/admin_protocol-structs | 18 +
src/datatypes.c | 30 ++
src/datatypes.h | 37 ++
src/internal.h | 1 +
src/libvirt-admin.c | 412 ++++++++++++++++++++
src/libvirt_admin.syms | 19 +
src/libvirt_private.syms | 1 +
src/libvirt_remote.syms | 29 +-
src/locking/lock_daemon.c | 63 ++--
src/locking/lock_daemon_config.c | 2 +-
src/locking/lock_daemon_dispatch.c | 4 +-
src/lxc/lxc_controller.c | 65 ++--
src/rpc/gendispatch.pl | 130 ++++---
src/rpc/virnetdaemon.c | 746 +++++++++++++++++++++++++++++++++++++
src/rpc/virnetdaemon.h | 82 ++++
src/rpc/virnetserver.c | 536 ++++----------------------
src/rpc/virnetserver.h | 46 +--
src/rpc/virnetserverprogram.h | 3 +
src/util/virerror.c | 1 +
src/util/virjson.c | 65 +++-
src/util/virjson.h | 4 +-
tests/confdata/libvirtd.conf | 6 +
tests/confdata/libvirtd.out | 5 +
tests/jsontest.c | 111 ++++++
tools/virt-admin/Makefile.am | 70 ++++
tools/virt-admin/virt-admin.c | 72 ++++
tools/virt-admin/virt-admin.pod | 43 +++
53 files changed, 2735 insertions(+), 685 deletions(-)
create mode 100644 daemon/admin_server.c
create mode 100644 daemon/admin_server.h
create mode 100644 include/libvirt/libvirt-admin.h
create mode 100644 libvirt-admin.pc.in
create mode 100644 src/admin/admin_protocol.x
create mode 100644 src/admin_protocol-structs
create mode 100644 src/libvirt-admin.c
create mode 100644 src/libvirt_admin.syms
create mode 100644 src/rpc/virnetdaemon.c
create mode 100644 src/rpc/virnetdaemon.h
create mode 100644 tools/virt-admin/Makefile.am
create mode 100644 tools/virt-admin/virt-admin.c
create mode 100644 tools/virt-admin/virt-admin.pod
--
2.4.0
9 years, 6 months
[libvirt] [PATCHv2] netdev: fail when setting up an SRIOV VF if PF is offline
by Laine Stump
If an SRIOV PF is offline, the kernel won't complain if you set the
mac address and vlan tag for a VF via this PF, and it will even let
you assign the VF to a guest using PCI device assignment or macvtap
passthrough. But in this case (the PF isn't online), the device won't
be usable in the guest.
Silently setting the PF online would solve the connectivity problem,
but as pointed out by Dan Berrange, when an interface is set online
with no associated config, the kernel will by default turn on IPv6
autoconf, which could create unexpected security problems for the
host. For this reason, this patch instead logs an error and fails the
operation.
This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=893738
Originally filed against RHEL6, but present in every version of
libvirt until today.
---
src/util/virnetdev.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index e14b401..d0580a0 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -2258,6 +2258,28 @@ virNetDevReplaceVfConfig(const char *pflinkdev, int vf,
char macstr[VIR_MAC_STRING_BUFLEN];
char *fileData = NULL;
int ifindex = -1;
+ bool pfIsOnline;
+
+ /* Assure that PF is online prior to twiddling with the VF. It
+ * *should* be, but if the PF isn't online the changes made to the
+ * VF via the PF won't take effect, yet there will be no error
+ * reported. In the case that it isn't online, fail and report the
+ * error, since setting an unconfigured interface online
+ * automatically turns on IPv6 autoconfig, which may not be what
+ * the admin expects, so we want them to explicitly enable the PF
+ * in the host system network config.
+ */
+ if (virNetDevGetOnline(pflinkdev, &pfIsOnline) < 0)
+ goto cleanup;
+ if (!pfIsOnline) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "Unable to configure VF %d of PF '%s' "
+ "because the PF is not online. Please "
+ "change host network config to put the "
+ "PF online.",
+ vf, pflinkdev);
+ goto cleanup;
+ }
if (virNetDevGetVfConfig(pflinkdev, vf, &oldmac, &oldvlanid) < 0)
goto cleanup;
--
2.1.0
9 years, 6 months
[libvirt] Plans for next release
by Daniel Veillard
if we want to get it by next month, we should probably freeze on Tuesday
for an 1.2.16 on June 1st, we 'only' have 137 commits since 1.2.15 but
sticking to the monthly release is important.
I hope this works for everybody,
thanks,
Daniel
--
Daniel Veillard | Open Source and Standards, Red Hat
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | virtualization library http://libvirt.org/
9 years, 6 months
[libvirt] official libvirt mirror on github?
by Cole Robinson
Hey all,
Anyone considered setting up libvirt*.git mirrors on github? Given the
popularity of github these days, IMO it's unfortunate we don't have an
official mirror on there.
As far as the actual mirroring though, we'd probably need to set up hooks on
libvirt.org to push new commits up to github, there doesn't appear to be any
better way than that.
Thoughts?
- Cole
9 years, 6 months
[libvirt] [PATCHv2] util: make it more robust to calculate timeout value
by Wang Yufei
From: Zhang Bo <oscar.zhangbo(a)huawei.com>
When we change system clock to years ago, a certain CPU may use up 100% cputime.
The reason is that in function virEventPollCalculateTimeout(), we assign the
unsigned long long result to an INT variable,
*timeout = then - now; // timeout is INT, and then/now are long long
if (*timeout < 0)
*timeout = 0;
there's a chance that variable @then minus variable @now may be a very large number
that overflows INT value expression, then *timeout will be negative and be assigned to 0.
Next the 'poll' in function virEventPollRunOnce() will get into an 'endless' while loop there.
thus, the cpu that virEventPollRunOnce() thread runs on will go up to 100%.
Although as we discussed before in https://www.redhat.com/archives/libvir-list/2015-May/msg00400.html
it should be prohibited to set-time while other applications are running, but it does
seems to have no harm to make the codes more robust.
Signed-off-by: Wang Yufei <james.wangyufei(a)huawei.com>
Signed-off-by: Zhang Bo <oscar.zhangbo(a)huawei.com>
---
src/util/vireventpoll.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/util/vireventpoll.c b/src/util/vireventpoll.c
index ffda206..9c9e7af 100644
--- a/src/util/vireventpoll.c
+++ b/src/util/vireventpoll.c
@@ -357,9 +357,12 @@ static int virEventPollCalculateTimeout(int *timeout)
return -1;
EVENT_DEBUG("Schedule timeout then=%llu now=%llu", then, now);
- *timeout = then - now;
- if (*timeout < 0)
+ if (then <= now) {
*timeout = 0;
+ } else {
+ *timeout = (int) (then - now);
+ *timeout = (*timeout > 0) ? (*timeout) : (*timeout)*(-1);
+ }
} else {
*timeout = -1;
}
--
1.7.12.4
9 years, 6 months
[libvirt] [PATCH] Fix to list online cpus using virsh capabilities
by Kothapally Madhu Pavan
Virsh capabilities will list offline cpus as online when
libvirt is compiled with numactl option disabled. This
fix will list correct set of online cpus.
Signed-off-by: Kothapally Madhu Pavan <kmp(a)linux.vnet.ibm.com>
---
src/nodeinfo.c | 36 ++++++++++++++++++++++++------------
1 file changed, 24 insertions(+), 12 deletions(-)
diff --git a/src/nodeinfo.c b/src/nodeinfo.c
index 22df95c..602c76c 100644
--- a/src/nodeinfo.c
+++ b/src/nodeinfo.c
@@ -1639,28 +1639,38 @@ nodeCapsInitNUMAFake(virCapsPtr caps ATTRIBUTE_UNUSED)
{
virNodeInfo nodeinfo;
virCapsHostNUMACellCPUPtr cpus;
- int ncpus;
+ int ncpus, onlinecpus;
int s, c, t;
- int id;
+ int id, cid;
+ char *sysfs_cpudir = NULL;
if (nodeGetInfo(&nodeinfo) < 0)
return -1;
ncpus = VIR_NODEINFO_MAXCPUS(nodeinfo);
+ onlinecpus = nodeinfo.cpus;
+
+ if (VIR_ALLOC_N(cpus, onlinecpus) < 0)
+ return -1;
- if (VIR_ALLOC_N(cpus, ncpus) < 0)
+ if (virAsprintf(&sysfs_cpudir, SYSFS_CPU_PATH) < 0)
return -1;
id = 0;
+ cid = 0;
for (s = 0; s < nodeinfo.sockets; s++) {
for (c = 0; c < nodeinfo.cores; c++) {
for (t = 0; t < nodeinfo.threads; t++) {
- cpus[id].id = id;
- cpus[id].socket_id = s;
- cpus[id].core_id = c;
- if (!(cpus[id].siblings = virBitmapNew(ncpus)))
- goto error;
- ignore_value(virBitmapSetBit(cpus[id].siblings, id));
+ if (virNodeGetCpuValue(sysfs_cpudir, id, "online", 0)) {
+ cpus[cid].id = id;
+ cpus[cid].socket_id = s;
+ cpus[cid].core_id = c;
+ if (!(cpus[cid].siblings = virBitmapNew(ncpus)))
+ goto error;
+ ignore_value(virBitmapSetBit(cpus[cid].siblings, id));
+ cid++;
+ }
+
id++;
}
}
@@ -1668,17 +1678,19 @@ nodeCapsInitNUMAFake(virCapsPtr caps ATTRIBUTE_UNUSED)
if (virCapabilitiesAddHostNUMACell(caps, 0,
nodeinfo.memory,
- ncpus, cpus,
+ onlinecpus, cpus,
0, NULL,
0, NULL) < 0)
goto error;
+ VIR_FREE(sysfs_cpudir);
return 0;
error:
- for (; id >= 0; id--)
- virBitmapFree(cpus[id].siblings);
+ for (; cid >= 0; cid--)
+ virBitmapFree(cpus[cid].siblings);
VIR_FREE(cpus);
+ VIR_FREE(sysfs_cpudir);
return -1;
}
9 years, 6 months
[libvirt] [PATCH v5] inspector: recognize ppc64 and ppc64le archs (RHBZ#1211996)
by Maros Zatko
Patch extracts MSB/LSB info from /bin/file output and passes it as separate
parameret from elf_arch. Then it is sent to impl_file_architecture and checked/
Modified magic_for_file to handle regex changes.
Now with tests for file_architecture, and error reporting for unknown
endianness.
Fixes: RHBZ#1211996
Maros Zatko (1):
inspector: recognize ppc64 and ppc64le archs (RHBZ#1211996)
generator/actions.ml | 8 ++++++++
src/filearch.c | 28 +++++++++++++++++++---------
2 files changed, 27 insertions(+), 9 deletions(-)
--
1.9.3
9 years, 6 months