mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-31 14:23:53 -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
8
hw/sd.c
8
hw/sd.c
|
@ -420,14 +420,10 @@ static void sd_reset(SDState *sd, BlockDriverState *bdrv)
|
|||
sd->pwd_len = 0;
|
||||
}
|
||||
|
||||
static void sd_cardchange(void *opaque, int reason)
|
||||
static void sd_cardchange(void *opaque)
|
||||
{
|
||||
SDState *sd = opaque;
|
||||
|
||||
if (!(reason & CHANGE_MEDIA)) {
|
||||
return;
|
||||
}
|
||||
|
||||
qemu_set_irq(sd->inserted_cb, bdrv_is_inserted(sd->bdrv));
|
||||
if (bdrv_is_inserted(sd->bdrv)) {
|
||||
sd_reset(sd, sd->bdrv);
|
||||
|
@ -436,7 +432,7 @@ static void sd_cardchange(void *opaque, int reason)
|
|||
}
|
||||
|
||||
static const BlockDevOps sd_block_ops = {
|
||||
.change_cb = sd_cardchange,
|
||||
.change_media_cb = sd_cardchange,
|
||||
};
|
||||
|
||||
/* We do not model the chip select pin, so allow the board to select
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue