[libvirt] [PATCH] Sanitize qemu monitor output

Cole Robinson crobinso at redhat.com
Mon Dec 1 22:36:34 UTC 2008


The attached patch cleans up output we read from the qemu monitor. This
is a simplified form of a patch I posted awhile ago. From the patch:

/* The monitor doesn't dump clean output after we have written to
 * it. Every character we write dumps a bunch of useless stuff,
 * so the result looks like "cXcoXcomXcommXcommaXcommanXcommand"
 * Try to throw away everything before the first full command
 * occurence, and inbetween the command and the newline starting
 * the response
 */

This extra output makes our qemu log files _huge_ if doing things like
polling disk/net stats, and prevents us from returning any useful error
message printed from the monitor (say for media/disk eject, disk/net
stats, etc).

I've been running with this patch for a while and haven't hit any issues.

Thanks,
Cole
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libvirt-monitor-sanitize.patch
Type: text/x-patch
Size: 2551 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20081201/f1fcc27d/attachment-0001.bin>


More information about the libvir-list mailing list