On Sun, Mar 06, 2011 at 11:40:16AM -0600, Anthony Liguori wrote: > Hi, > > I've been looking at the qemuDomainMonitorCommand interface and I > see a few issues with it. > > The current interface can take a JSON string and return a JSON > string but it only works for successful commands. I'd like to hook > this interface up to libqmp but it would mean dropping all of the > error messages. Errors are extremely important because certain > workflows require parsing specific error output (like changing a > device with an encrypted disk) in the normal execution path. There is an 'unsigned int flags' param there, so we could trivally add an extra flag to indicate that libvirt should not interpret the errors & just pass back the raw data as it does with normal replies. So libvirt's error reporting would only be used for OS level errors, and not protocol level errors. > Additionally, there's no way to get QMP events. With QMP events, > it's important to expose the timestamp and tag fields too. That would be done via an extra method. We'd need a method to register a callback function to receive the events. > Is there a reason the raw QMP session wasn't exposed? This API is also usable by QEMUs with only HMP and exposing a raw QMP would really involve having a 2nd dedicated connection to the monitor which isn't something that works with QEMU chardevs - they're single connection only even if using something like UNIX sockets which is technically server/many-client > With registered events, we should be able to distinguish events > meant for libvirt with events registered by QMP passthrough so > perhaps we can also expose events in a new interface? There'd be no problem with having events reported back up through multiple callbacks. We can easily hook up a direct QMP events callback without disturbing existing libvirt events callbacks. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :| -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list