[libvirt] [PATCH] apparmor: Fix build
by Jiri Denemark
---
Pushed as a trivial build-breaker.
src/security/virt-aa-helper.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 888c416..86fd5c4 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -1022,7 +1022,8 @@ get_files(vahControl * ctl)
switch (dev->source.subsys.type) {
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: {
usbDevice *usb = usbGetDevice(dev->source.subsys.u.usb.bus,
- dev->source.subsys.u.usb.device);
+ dev->source.subsys.u.usb.device,
+ NULL);
if (usb == NULL)
continue;
--
1.8.0.2
12 years
[libvirt] [PATCH] .gitignore: add tests/sysinfotest
by Cole Robinson
---
Pushed since it's trivial
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index 32ae8a7..0557d59 100644
--- a/.gitignore
+++ b/.gitignore
@@ -164,6 +164,7 @@
/tests/ssh
/tests/statstest
/tests/storagebackendsheepdogtest
+/tests/sysinfotest
/tests/utiltest
/tests/viratomictest
/tests/virauthconfigtest
--
1.8.0.2
12 years
[libvirt] [PATCH] daemon: Preface polkit error output with 'polkit:'
by Cole Robinson
There's been a few bugs about an expected error from polkit:
https://bugzilla.redhat.com/show_bug.cgi?id=873799
https://bugzilla.redhat.com/show_bug.cgi?id=872166
The error is:
Authorization requires authentication but no agent is available.
The error means that polkit needs a password, but there is no polkit
agent registered in your session. Polkit agents are the bit of UI that
pop up and actually ask for your password.
Preface the error with the string 'polkit:' so folks can hopefully
make more sense of it.
---
daemon/remote.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/daemon/remote.c b/daemon/remote.c
index 41b8ea8..f85dae0 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -2887,9 +2887,10 @@ error:
if (authdismissed) {
virReportError(VIR_ERR_AUTH_CANCELLED, "%s",
_("authentication cancelled by user"));
+ } else if (pkout && *pkout) {
+ virReportError(VIR_ERR_AUTH_FAILED, "polkit: %s", pkout);
} else {
- virReportError(VIR_ERR_AUTH_FAILED, "%s",
- pkout && *pkout ? pkout : _("authentication failed"));
+ virReportError(VIR_ERR_AUTH_FAILED, "%s", _("authentication failed"));
}
VIR_FREE(pkout);
--
1.8.0.2
12 years
[libvirt] Network XML Description
by Fawad Khaliq
Hi all,
The XML description of a network does not contain information of the
Domains (VMs) plugged into a network. For example, there is a network named
'default' and there are two domains named: domainA and domainB. The Network
XML description of 'default' network cannot tell what domains are plugged
into it (in this scenario: domainA and domainB). What reasons could be
behind this Network XML format convention?
Thanks,
Fawad
12 years
[libvirt] [PATCH] build: libvirt-guests files misplaced in specfile
by Viktor Mihajlovski
In a non-systemd environment the post and preun scripts of libvirt-client
fail, since the required files are in libvirt-daemon. Moved them to client.
One curious thing: %{_unitdir}/libvirt-guests.service was contained in
both libvirt-client and libvirt-daemon. I removed the extra copy from
daemon.
Note: this should be checked by someone building RPMs for a systemd
machine. I don't have one at the moment.
Signed-off-by: Viktor Mihajlovski <mihajlov(a)linux.vnet.ibm.com>
---
libvirt.spec.in | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 7457a48..b826a8f 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1662,15 +1662,12 @@ fi
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/
-%attr(0755, root, root) %{_libexecdir}/libvirt-guests.sh
%if %{with_systemd}
%{_unitdir}/libvirtd.service
-%{_unitdir}/libvirt-guests.service
%{_unitdir}/virtlockd.service
%{_unitdir}/virtlockd.socket
%else
%{_sysconfdir}/rc.d/init.d/libvirtd
-%{_sysconfdir}/rc.d/init.d/libvirt-guests
%{_sysconfdir}/rc.d/init.d/virtlockd
%endif
%doc daemon/libvirtd.upstart
@@ -1948,8 +1945,11 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sysctl.d/libvirtd
%if %{with_systemd}
%{_unitdir}/libvirt-guests.service
+%else
+%{_sysconfdir}/rc.d/init.d/libvirt-guests
%endif
%config(noreplace) %{_sysconfdir}/sysconfig/libvirt-guests
+%attr(0755, root, root) %{_libexecdir}/libvirt-guests.sh
%dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/
%if %{with_sasl}
--
1.7.9.5
12 years
[libvirt] No VirtualBox Driver
by Arslan Waqar
Hi all,
I am new to the group and hence there might be a chance I might be asking a
simple question...
The thing is I compiled and installed libvirt from git. Then in my terminal
window I started virsh. It started. Then since I had Virtual Box installed
on my machine I ran "connect vbox:///session". Once I did this I got two
errors which said:
error: Failed to connect to the hypervisor
error: internal error unable to initialize VirtualBox driver API
I am unable to resolve this issue...Any input is welcome!
Thanks!
--
Regards,
Arslan Waqar.
12 years
[libvirt] [PATCH 0/4] Cleanup and fix parsing of vendor_id in the XML cpu definition
by Peter Krempa
This patchset contains Ken ICHIKAWA's patch to fix parsing of vendor_id (with
tweaked commit message) and my cleanups to pre-existing problems in the code
which I found while reviewing Ken's patch.
Ken ICHIKAWA (1):
conf: cpu: Fix parsing of vendor_id
Peter Krempa (3):
conf: cpu: Fix memory leak when specifying cpu vendor_id manually
conf: cpu: Refactor parsing of vendor_id and fallback attributes
conf: cpu: Break some long lines
src/conf/cpu_conf.c | 82 +++++++++++++++++++++++++----------------------------
1 file changed, 38 insertions(+), 44 deletions(-)
--
1.8.0.2
12 years
[libvirt] [PATCH] Socket identity support for FreeBSD.
by Roman Bogorodskiy
This adds an implementation of virNetSocketGetUNIXIdentity()
using LOCAL_PEERCRED socket option and xucred struct, defined
in <sys/ucred.h> on systems that have it.
---
configure.ac | 3 ++-
src/rpc/virnetsocket.c | 30 +++++++++++++++++++++++++++++-
2 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index bf32f95..1cb9e91 100644
--- a/configure.ac
+++ b/configure.ac
@@ -187,7 +187,8 @@ LIBS=$old_libs
dnl Availability of various common headers (non-fatal if missing).
AC_CHECK_HEADERS([pwd.h paths.h regex.h sys/un.h \
sys/poll.h syslog.h mntent.h net/ethernet.h linux/magic.h \
- sys/un.h sys/syscall.h netinet/tcp.h ifaddrs.h libtasn1.h])
+ sys/un.h sys/syscall.h netinet/tcp.h ifaddrs.h libtasn1.h \
+ sys/ucred.h])
dnl Check whether endian provides handy macros.
AC_CHECK_DECLS([htole64], [], [], [[#include <endian.h>]])
diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index a1b64d7..70c621f 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -35,6 +35,10 @@
# include <netinet/tcp.h>
#endif
+#ifdef HAVE_SYS_UCRED_H
+# include <sys/ucred.h>
+#endif
+
#include "c-ctype.h"
#include "virnetsocket.h"
#include "util.h"
@@ -1091,7 +1095,7 @@ int virNetSocketGetPort(virNetSocketPtr sock)
}
-#ifdef SO_PEERCRED
+#if defined(SO_PEERCRED)
int virNetSocketGetUNIXIdentity(virNetSocketPtr sock,
uid_t *uid,
gid_t *gid,
@@ -1115,6 +1119,30 @@ int virNetSocketGetUNIXIdentity(virNetSocketPtr sock,
virMutexUnlock(&sock->lock);
return 0;
}
+#elif defined(LOCAL_PEERCRED)
+int virNetSocketGetUNIXIdentity(virNetSocketPtr sock,
+ uid_t *uid,
+ gid_t *gid,
+ pid_t *pid)
+{
+ struct xucred cr;
+ socklen_t cr_len = sizeof(cr);
+ virMutexLock(&sock->lock);
+
+ if (getsockopt(sock->fd, SOL_SOCKET, LOCAL_PEERCRED, &cr, &cr_len) < 0) {
+ virReportSystemError(errno, "%s",
+ _("Failed to get client socket identity"));
+ virMutexUnlock(&sock->lock);
+ return -1;
+ }
+
+ *pid = -1;
+ *uid = cr.cr_uid;
+ *gid = cr.cr_gid;
+
+ virMutexUnlock(&sock->lock);
+ return 0;
+}
#else
int virNetSocketGetUNIXIdentity(virNetSocketPtr sock ATTRIBUTE_UNUSED,
uid_t *uid ATTRIBUTE_UNUSED,
--
1.8.0
12 years