[libvirt] [PATCH] udev: fix regression with qemu:///session
Eric Blake
eblake at redhat.com
Mon Mar 21 16:53:26 UTC 2011
On 03/21/2011 10:34 AM, Daniel P. Berrange wrote:
> On Wed, Mar 16, 2011 at 03:48:52PM -0600, Eric Blake wrote:
>> 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.
>> if ((pciret = pci_system_init()) != 0) {
>> - char ebuf[256];
>> - VIR_ERROR(_("Failed to initialize libpciaccess: %s"),
>> - virStrerror(pciret, ebuf, sizeof ebuf));
>> - ret = -1;
>> - goto out;
>> + /* Ignore failure as non-root; udev is not as helpful in that
>> + * situation, but a non-privileged user won't benefit much
>> + * from udev in the first place. */
>> + if (privileged || errno != EACCES) {
>> + char ebuf[256];
>> + VIR_ERROR(_("Failed to initialize libpciaccess: %s"),
>> + virStrerror(pciret, ebuf, sizeof ebuf));
>> + ret = -1;
>> + goto out;
>> + }
>> }
>>
>> if (VIR_ALLOC(priv) < 0) {
>
> ACK, though it works fine without this on Fedora 14 hosts.
> So I guess its only older libpciaccess that has trouble
> as non-root
Makes sense; my RHEL testing was with libpciaccess-0.10.9, but Fedora 14
is at libpciaccess-0.12.0.
Pushed.
--
Eric Blake eblake at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110321/2f0857a5/attachment-0001.sig>
More information about the libvir-list
mailing list