Re: [RFC PATCH] qemu: new API for tracking arbitrary monitor events

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/19/2013 08:23 AM, Daniel P. Berrange wrote:
> On Thu, Dec 19, 2013 at 08:15:09AM -0700, Eric Blake wrote:
>> diff --git a/src/libvirt-qemu.c b/src/libvirt-qemu.c
>> index db52c65..849932d 100644

>> +    if (dom &&
>> +        !(VIR_IS_CONNECTED_DOMAIN(dom) && dom->conn == conn)) {
>> +        virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
>> +        virDispatchError(conn);
>> +        return -1;
>> +    }
>> +    virCheckNonNullArgGoto(cb, error)
> 
> 
> I have a gut feeling that we should restrict use of this API to
> authenticated users only. So add a check for a read-only connection
> here

Hmm.  It would match what we have for qemu-monitor-command; on the other
hand, it differs from what we have for normal events (libvirt events are
fine on a read-only connection).  I guess an argument in favor of
requiring write privileges is that qemu may expose details in its events
that are better left internal to libvirt (that is, libvirt has a chance
to scrub details before handing information to read-only guests, but
with raw event handling, there is no scrubbing).  And it's always easier
to relax things later than it is to add read-write restrictions later
and break existing callers that had grown used to read-only.

> 
> 
>> +    if ((conn->driver) && (conn->driver->connectDomainQemuMonitorEventRegister)) {
> 
> This is excessively bracketed isn't it

Copy-and-paste, all the way!  I'll clean it up.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]