|
From: | Programmingkid |
Subject: | Re: [Qemu-devel] [PATCH] block.c: fix real cdrom detection |
Date: | Sun, 28 Jun 2015 23:01:34 -0400 |
On Jun 28, 2015, at 8:29 PM, Laurent Vivier wrote:
--- block/raw-posix.c | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/block/raw-posix.c b/block/raw-posix.c index a967464..2d35580 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -2324,6 +2324,23 @@ static int hdev_create(const char *filename, QemuOpts *opts, return ret; } +#ifdef __APPLE__ + +static int cdrom_is_inserted(BlockDriverState *bs) +{ + static int count = 0; + int returnValue = 1; + + if(count == 0) { + returnValue = 0; // get around find_image_format() issue + } + + printf("count = %d for %s, returning %d\n", count, bs->filename, returnValue); + count++; + return returnValue; +} +#endif + static BlockDriver bdrv_host_device = { .format_name = "host_device", .protocol_name = "host_device", @@ -2365,6 +2382,10 @@ static BlockDriver bdrv_host_device = { .bdrv_ioctl = hdev_ioctl, .bdrv_aio_ioctl = hdev_aio_ioctl, #endif + +#ifdef __APPLE__ + .bdrv_is_inserted = cdrom_is_inserted, +#endif }; #ifdef __linux__ -- 1.7.5.4 |
[Prev in Thread] | Current Thread | [Next in Thread] |