mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -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
7
hw/sd.c
7
hw/sd.c
|
@ -422,9 +422,14 @@ static void sd_reset(SDState *sd, BlockDriverState *bdrv)
|
|||
sd->pwd_len = 0;
|
||||
}
|
||||
|
||||
static void sd_cardchange(void *opaque)
|
||||
static void sd_cardchange(void *opaque, int reason)
|
||||
{
|
||||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue