qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/2] hw/sd: Add medium insertion status


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 1/2] hw/sd: Add medium insertion status
Date: Thu, 7 Jan 2016 21:45:56 +0000

On 7 January 2016 at 21:03, Max Reitz <address@hidden> wrote:
> Right now, the change_media_cb (sd_cardchange()) completely ignores its
> @load parameter. This means that issuing a blockdev-open-tray command
> will actually not have any effect.
>
> Fix this by keeping track of the medium insertion status in the SDState
> and updating it in sd_init() and sd_cardchange().
>
> Cc: qemu-stable <address@hidden>
> Signed-off-by: Max Reitz <address@hidden>
> ---
>  hw/sd/sd.c | 16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/hw/sd/sd.c b/hw/sd/sd.c
> index 1a9935c..0751ba2 100644
> --- a/hw/sd/sd.c
> +++ b/hw/sd/sd.c
> @@ -114,6 +114,7 @@ struct SDState {
>      uint8_t *buf;
>
>      bool enable;
> +    bool medium_inserted;

When would this be different from blk_is_inserted(sd->blk) ?

I don't see why we need a separate flag here rather
than querying the block layer.

If we do need a flag, why doesn't it need to be migrated?

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]