]> git.proxmox.com Git - mirror_qemu.git/commitdiff
qapi/block: Add "fatal" to BLOCK_IMAGE_CORRUPTED
authorMax Reitz <mreitz@redhat.com>
Fri, 5 Sep 2014 14:07:15 +0000 (16:07 +0200)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 22 Sep 2014 10:39:26 +0000 (11:39 +0100)
Not every BLOCK_IMAGE_CORRUPTED event must be fatal; for example, when
reading from an image, they should generally not be. Nonetheless, even
an image only read from may of course be corrupted and this can be
detected during normal operation. In this case, a non-fatal event should
be emitted, but the image should not be marked corrupt (in accordance to
"fatal" set to false).

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1409926039-29044-2-git-send-email-mreitz@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/qcow2-refcount.c
qapi/block-core.json

index 43665b86e73ce029b64f04273941fa7e46d59c2f..0bd75d2fe6c325543b98e584238f47c22361b8d4 100644 (file)
@@ -1853,6 +1853,7 @@ int qcow2_pre_write_overlap_check(BlockDriverState *bs, int ign, int64_t offset,
                                               offset,
                                               true,
                                               size,
+                                              true,
                                               &error_abort);
         g_free(message);
 
index 1692627e009766dee626568559143856a7fb7999..ef7faaab5e8015c9219e9bee4e62d73f858ea94b 100644 (file)
 ##
 # @BLOCK_IMAGE_CORRUPTED
 #
-# Emitted when a disk image is being marked corrupt
+# Emitted when a corruption has been detected in a disk image
 #
 # @device: device name
 #
 # @size: #optional, if the corruption resulted from an image access, this is
 #        the access size
 #
+# fatal: if set, the image is marked corrupt and therefore unusable after this
+#        event and must be repaired (Since 2.2; before, every
+#        BLOCK_IMAGE_CORRUPTED event was fatal)
+#
 # Since: 1.7
 ##
 { 'event': 'BLOCK_IMAGE_CORRUPTED',
   'data': { 'device' : 'str',
             'msg'    : 'str',
             '*offset': 'int',
-            '*size'  : 'int' } }
+            '*size'  : 'int',
+            'fatal'  : 'bool' } }
 
 ##
 # @BLOCK_IO_ERROR