On 08/30/2013 06:34 AM, Max Reitz wrote: > Two new functions are added; the first one checks a given range in the > image file for overlaps with metadata (main header, L1 tables, L2 > tables, refcount table and blocks). > > The second one should be used immediately before writing to the image > file as it calls the first function and, upon collision, marks the > image as corrupt and makes the BDS unusable, thereby preventing > further access. > > Both functions take a bitmask argument specifying the structures which > should be checked for overlaps, making it possible to also check > metadata writes against colliding with other structures. > > Signed-off-by: Max Reitz > --- > block/qcow2-refcount.c | 172 ++++++++++++++++++++++++++++++++++++++++++++++ > block/qcow2.h | 39 +++++++++++ > include/monitor/monitor.h | 1 + > monitor.c | 1 + > 4 files changed, 213 insertions(+) I know this is already in the QMP queue, but... > +++ b/include/monitor/monitor.h > @@ -48,6 +48,7 @@ typedef enum MonitorEvent { > QEVENT_BALLOON_CHANGE, > QEVENT_SPICE_MIGRATE_COMPLETED, > QEVENT_GUEST_PANICKED, > + QEVENT_BLOCK_IMAGE_CORRUPTED, > > /* Add to 'monitor_event_names' array in monitor.c when > * defining new events here */ > diff --git a/monitor.c b/monitor.c > index ee9744c..2c542e1 100644 > --- a/monitor.c > +++ b/monitor.c > @@ -504,6 +504,7 @@ static const char *monitor_event_names[] = { > [QEVENT_BALLOON_CHANGE] = "BALLOON_CHANGE", > [QEVENT_SPICE_MIGRATE_COMPLETED] = "SPICE_MIGRATE_COMPLETED", > [QEVENT_GUEST_PANICKED] = "GUEST_PANICKED", > + [QEVENT_BLOCK_IMAGE_CORRUPTED] = "BLOCK_IMAGE_CORRUPTED", > }; You are missing documentation for this new event. Please provide a followup patch to qmp-events.txt. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org