mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
block: tell drivers about an image resize
Extend the change_cb callback with a reason argument, and use it to tell drivers about size changes. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
6d4a2b3a47
commit
db97ee6a97
5 changed files with 25 additions and 8 deletions
|
@ -1584,11 +1584,15 @@ static void ide_cfata_metadata_write(IDEState *s)
|
|||
}
|
||||
|
||||
/* called when the inserted state of the media has changed */
|
||||
static void cdrom_change_cb(void *opaque)
|
||||
static void cdrom_change_cb(void *opaque, int reason)
|
||||
{
|
||||
IDEState *s = opaque;
|
||||
uint64_t nb_sectors;
|
||||
|
||||
if (!(reason & CHANGE_MEDIA)) {
|
||||
return;
|
||||
}
|
||||
|
||||
bdrv_get_geometry(s->bs, &nb_sectors);
|
||||
s->nb_sectors = nb_sectors;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue