qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Programmingkid <programmingkidx@gmail.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
	qemu-devel qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v5] block/raw-posix.c: Fixes raw_getlength() on Mac OS X so that it reports the correct length of a real CD
Date: Tue, 13 Jan 2015 18:54:15 +0000	[thread overview]
Message-ID: <CAFEAcA9Py8bYjxh_5e9=MO_08jczf9aOnftMyc9o_vwu9UNmLQ@mail.gmail.com> (raw)
In-Reply-To: <46E17E6E-EB3E-4E7F-85D9-824BAE8E5C29@gmail.com>

On 13 January 2015 at 18:45, Programmingkid <programmingkidx@gmail.com> wrote:
>
> On Jan 13, 2015, at 1:34 PM, Peter Maydell wrote:
>
>> On 13 January 2015 at 18:26, Programmingkid <programmingkidx@gmail.com> wrote:
>>> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
>>> +        uint64_t sectors = 0;
>>> +        uint32_t sector_size = 0;
>>> +
>>> +        /* Query the number of sectors on the disk */
>>> +        ret = ioctl(fd, DKIOCGETBLOCKCOUNT, &sectors);
>>> +        if (ret == -1) {
>>> +            return 0;
>>
>> We should be falling back to lseek, not returning 0...

> I did try using lseek, but it doesn't work with Mac OS X block
> devices. It would always fail.

Right, but for block devices the ioctl will succeed, I thought?
We'll only try lseek() if the ioctl fails (hence "fall back").

-- PMM

      reply	other threads:[~2015-01-13 18:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-13 18:26 [Qemu-devel] [PATCH v5] block/raw-posix.c: Fixes raw_getlength() on Mac OS X so that it reports the correct length of a real CD Programmingkid
2015-01-13 18:34 ` Peter Maydell
2015-01-13 18:45   ` Programmingkid
2015-01-13 18:54     ` Peter Maydell [this message]

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='CAFEAcA9Py8bYjxh_5e9=MO_08jczf9aOnftMyc9o_vwu9UNmLQ@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=programmingkidx@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /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).