aboutsummaryrefslogtreecommitdiff
path: root/block.h
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2011-08-03 15:07:42 +0200
committerKevin Wolf <kwolf@redhat.com>2011-09-06 11:23:51 +0200
commit145feb176ffe6de1db6d05af064c841d7c16633c (patch)
treef69598e83c5a2b36fcecd043e7a234dcbeb77a2e /block.h
parent0e49de5232f47c9e58adb82c28d4f42be933d891 (diff)
downloadqemu-145feb176ffe6de1db6d05af064c841d7c16633c.zip
qemu-145feb176ffe6de1db6d05af064c841d7c16633c.tar.gz
qemu-145feb176ffe6de1db6d05af064c841d7c16633c.tar.bz2
block: Split change_cb() into change_media_cb(), resize_cb()
Multiplexing callbacks complicates matters needlessly. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.h')
-rw-r--r--block.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/block.h b/block.h
index a72cfc9..7e3f587 100644
--- a/block.h
+++ b/block.h
@@ -28,8 +28,18 @@ typedef struct QEMUSnapshotInfo {
uint64_t vm_clock_nsec; /* VM clock relative to boot */
} QEMUSnapshotInfo;
+/* Callbacks for block device models */
typedef struct BlockDevOps {
- void (*change_cb)(void *opaque, int reason);
+ /*
+ * Runs when virtual media changed (monitor commands eject, change)
+ * Beware: doesn't run when a host device's physical media
+ * changes. Sure would be useful if it did.
+ */
+ void (*change_media_cb)(void *opaque);
+ /*
+ * Runs when the size changed (e.g. monitor command block_resize)
+ */
+ void (*resize_cb)(void *opaque);
} BlockDevOps;
#define BDRV_O_RDWR 0x0002