[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] block.c: fix real cdrom detection
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] block.c: fix real cdrom detection |
Date: |
Thu, 25 Jun 2015 20:01:31 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
On 25/06/2015 19:56, Programmingkid wrote:
>> In fact, programmingkid, you should fix it in hdev_open() where
>> there is already a #if __APPLE__ .
>
> Nice to hear from you again Laurent. The only way a solution in
> hdev_open() would work is if it could prevent find_image_format()
> from executing. Otherwise find_image_format() would just quit QEMU
> with an error.
You have to implement an is_inserted function like this one that is
already there for FreeBSD:
static int cdrom_is_inserted(BlockDriverState *bs)
{
return raw_getlength(bs) > 0;
}
The point you're changing is _already_ testing bdrv_is_inserted.
Look at the block starting like this:
#if defined (__FreeBSD__) || defined(__FreeBSD_kernel__)
static int cdrom_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
and create a similar one that is #ifdef __APPLE__. Feel free to remove
pieces that you don't know how to do in OS X / CoreFoundation.
Paolo
- Re: [Qemu-devel] [PATCH] block.c: fix real cdrom detection, (continued)
- Re: [Qemu-devel] [PATCH] block.c: fix real cdrom detection, Programmingkid, 2015/06/25
- Re: [Qemu-devel] [PATCH] block.c: fix real cdrom detection, Paolo Bonzini, 2015/06/25
- Re: [Qemu-devel] [PATCH] block.c: fix real cdrom detection, Laurent Vivier, 2015/06/25
- Re: [Qemu-devel] [PATCH] block.c: fix real cdrom detection, Paolo Bonzini, 2015/06/25
- Re: [Qemu-devel] [PATCH] block.c: fix real cdrom detection, Laurent Vivier, 2015/06/25
- Re: [Qemu-devel] [PATCH] block.c: fix real cdrom detection, Laurent Vivier, 2015/06/26
- Re: [Qemu-devel] [Qemu-block] [PATCH] block.c: fix real cdrom detection, Stefan Hajnoczi, 2015/06/26
- Re: [Qemu-devel] [PATCH] block.c: fix real cdrom detection, Programmingkid, 2015/06/25
- Re: [Qemu-devel] [PATCH] block.c: fix real cdrom detection, Paolo Bonzini, 2015/06/25
- Re: [Qemu-devel] [PATCH] block.c: fix real cdrom detection, Programmingkid, 2015/06/25
- Re: [Qemu-devel] [PATCH] block.c: fix real cdrom detection,
Paolo Bonzini <=
- Re: [Qemu-devel] [PATCH] block.c: fix real cdrom detection, Peter Maydell, 2015/06/25
- Re: [Qemu-devel] [PATCH] block.c: fix real cdrom detection, Programmingkid, 2015/06/28
- Re: [Qemu-devel] [PATCH] block.c: fix real cdrom detection, Laurent Vivier, 2015/06/28
- Re: [Qemu-devel] [PATCH] block.c: fix real cdrom detection, Programmingkid, 2015/06/28
- Re: [Qemu-devel] [PATCH] block.c: fix real cdrom detection, Programmingkid, 2015/06/28
- Re: [Qemu-devel] [PATCH] block.c: fix real cdrom detection, Laurent Vivier, 2015/06/29
- Re: [Qemu-devel] [PATCH] block.c: fix real cdrom detection, Programmingkid, 2015/06/25
- Re: [Qemu-devel] [Qemu-block] [PATCH] block.c: fix real cdrom detection, Stefan Hajnoczi, 2015/06/25
- Re: [Qemu-devel] [Qemu-block] [PATCH] block.c: fix real cdrom detection, Programmingkid, 2015/06/25
- Re: [Qemu-devel] [Qemu-block] [PATCH] block.c: fix real cdrom detection, Stefan Hajnoczi, 2015/06/26