qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Programmingkid <programmingkidx@gmail.com>,
	Laurent Vivier <lvivier@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Markus Armbruster <armbru@redhat.com>,
	Qemu-block <qemu-block@nongnu.org>,
	qemu-devel qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] block.c: fix real cdrom detection
Date: Thu, 25 Jun 2015 20:01:31 +0200	[thread overview]
Message-ID: <558C41FB.30705@redhat.com> (raw)
In-Reply-To: <47B5E901-9CCD-4737-A5F2-B790EBEF941A@gmail.com>



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

  reply	other threads:[~2015-06-25 18:01 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-23 17:56 [Qemu-devel] [PATCH] block.c: fix real cdrom detection Programmingkid
2015-06-23 18:06 ` John Snow
2015-06-23 18:26   ` Programmingkid
2015-06-25  6:53     ` Markus Armbruster
2015-06-25 15:14       ` Programmingkid
2015-06-25 15:32         ` Programmingkid
2015-06-25 15:47           ` Programmingkid
2015-06-25 15:48           ` Paolo Bonzini
2015-06-25 16:12             ` Laurent Vivier
2015-06-25 16:16               ` Paolo Bonzini
2015-06-25 17:19                 ` Laurent Vivier
2015-06-26  9:14                   ` Laurent Vivier
2015-06-26  9:20                   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-06-25 18:07                 ` [Qemu-devel] " Programmingkid
2015-06-25 20:51                   ` Paolo Bonzini
2015-06-25 17:56               ` Programmingkid
2015-06-25 18:01                 ` Paolo Bonzini [this message]
2015-06-25 18:01                 ` Peter Maydell
2015-06-28 23:43                   ` Programmingkid
2015-06-29  0:29                     ` Laurent Vivier
2015-06-29  0:56                       ` Programmingkid
2015-06-29  3:01                       ` Programmingkid
2015-06-29 10:36                         ` Laurent Vivier
2015-06-25 17:57             ` Programmingkid
2015-06-25 13:31     ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-06-25 15:11       ` Programmingkid
2015-06-26  9:34         ` Stefan Hajnoczi
2015-06-26 15:50           ` Programmingkid
2015-06-26 20:01             ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=558C41FB.30705@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=programmingkidx@gmail.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).