mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 14:53:54 -06:00
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>
This commit is contained in:
parent
0e49de5232
commit
145feb176f
6 changed files with 33 additions and 29 deletions
12
block.h
12
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue