mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00: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:
committed by
Kevin Wolf
parent
0e49de5232
commit
145feb176f
@@ -783,15 +783,11 @@ 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, int reason)
|
||||
static void ide_cd_change_cb(void *opaque)
|
||||
{
|
||||
IDEState *s = opaque;
|
||||
uint64_t nb_sectors;
|
||||
|
||||
if (!(reason & CHANGE_MEDIA)) {
|
||||
return;
|
||||
}
|
||||
|
||||
bdrv_get_geometry(s->bs, &nb_sectors);
|
||||
s->nb_sectors = nb_sectors;
|
||||
|
||||
@@ -1743,7 +1739,7 @@ void ide_bus_reset(IDEBus *bus)
|
||||
}
|
||||
|
||||
static const BlockDevOps ide_cd_block_ops = {
|
||||
.change_cb = cdrom_change_cb,
|
||||
.change_media_cb = ide_cd_change_cb,
|
||||
};
|
||||
|
||||
int ide_init_drive(IDEState *s, BlockDriverState *bs, IDEDriveKind kind,
|
||||
|
||||
Reference in New Issue
Block a user