mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 23:37:42 +00:00
udev: fix regression with qemu:///session
https://bugzilla.redhat.com/show_bug.cgi?id=684655 points out a regression introduced in commit 2215050edd - non-root users can't connect to qemu:///session because libvirtd dies when it can't use pciaccess initialization. * src/node_device/node_device_udev.c (udevDeviceMonitorStartup): Don't abort udev driver (and libvirtd overall) if non-root user can't use pciaccess.
This commit is contained in:
parent
dd5564f218
commit
4c7508b4de
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* node_device_udev.c: node device enumeration - libudev implementation
|
* node_device_udev.c: node device enumeration - libudev implementation
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2010 Red Hat, Inc.
|
* Copyright (C) 2009-2011 Red Hat, Inc.
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
@ -1589,7 +1589,7 @@ out:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int udevDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
|
static int udevDeviceMonitorStartup(int privileged)
|
||||||
{
|
{
|
||||||
udevPrivate *priv = NULL;
|
udevPrivate *priv = NULL;
|
||||||
struct udev *udev = NULL;
|
struct udev *udev = NULL;
|
||||||
@ -1597,11 +1597,16 @@ static int udevDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
|
|||||||
int pciret;
|
int pciret;
|
||||||
|
|
||||||
if ((pciret = pci_system_init()) != 0) {
|
if ((pciret = pci_system_init()) != 0) {
|
||||||
char ebuf[256];
|
/* Ignore failure as non-root; udev is not as helpful in that
|
||||||
VIR_ERROR(_("Failed to initialize libpciaccess: %s"),
|
* situation, but a non-privileged user won't benefit much
|
||||||
virStrerror(pciret, ebuf, sizeof ebuf));
|
* from udev in the first place. */
|
||||||
ret = -1;
|
if (privileged || errno != EACCES) {
|
||||||
goto out;
|
char ebuf[256];
|
||||||
|
VIR_ERROR(_("Failed to initialize libpciaccess: %s"),
|
||||||
|
virStrerror(pciret, ebuf, sizeof ebuf));
|
||||||
|
ret = -1;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VIR_ALLOC(priv) < 0) {
|
if (VIR_ALLOC(priv) < 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user