All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Programmingkid <programmingkidx@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	qemu-devel qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v3] block/raw-posix.c: Fixes raw_getlength() on Mac OS X so that it reports the correct length of a real CD
Date: Fri, 2 Jan 2015 14:38:30 +0000	[thread overview]
Message-ID: <20150102143830.GN10823@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <96FCDECA-CC6E-4E30-A812-40FA3CA78C31@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1647 bytes --]

On Sun, Dec 28, 2014 at 04:18:38PM -0500, Programmingkid wrote:

Suggestion for concise subject line:

  block/raw-posix: fix raw_getlength() for host CD-ROMs on Mac

> This patch fixes the problem with raw_getlength() on Mac OS X so that it actually calculates the correct size of a volume. It has been updated to fix certain coding style issues. Booting and using a real CD in QEMU works again. 

Plain text emails are usually wrapped at 72 characters.  It makes it
easier to read the git log if you wrap lines.

Good job braving the nasty nest of #ifdefs in raw_getlength() :).  The
code change looks good.  Minor changes below - normally I'd make them
while merging your patch but I don't compile QEMU on Mac so I can't
compile test it.  Please send a new version of this patch.

> 
> signed-off-by: John Arbuckle <programmingkidx@gmail.com>

Not sure if tags are case-sensistive but it is usually written as
"Signed-off-by:".  The git -s option does this for you, that's usually
more convenient than typing it out manually.

> diff --git a/block/raw-posix.c b/block/raw-posix.c
> index e51293a..a090c9c 100644
> --- a/block/raw-posix.c
> +++ b/block/raw-posix.c
> @@ -1312,7 +1312,24 @@ again:
>          if (size == 0)
>  #endif
>  #if defined(__APPLE__) && defined(__MACH__)
> -        size = LLONG_MAX;
> +   {
> +        uint64_t sectors = 0;
> +        uint32_t sectorSize = 0;

Please follow QEMU coding style and use lower_case_with_underscore
variable names.

> +        int ret;

No need to shadow the local variable that was already declared at the
top of the function.  Please drop this.

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

  parent reply	other threads:[~2015-01-02 14:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-28 21:18 [Qemu-devel] [PATCH v3] block/raw-posix.c: Fixes raw_getlength() on Mac OS X so that it reports the correct length of a real CD Programmingkid
2014-12-28 21:24 ` Peter Maydell
2015-01-02 14:38 ` Stefan Hajnoczi [this message]
2015-01-02 16:47   ` Programmingkid
2015-01-02 17:20     ` Peter Maydell

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=20150102143830.GN10823@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=programmingkidx@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.