From: Kevin Wolf <kwolf@redhat.com>
To: Programmingkid <programmingkidx@gmail.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
qemu-devel qemu-devel <qemu-devel@nongnu.org>,
Qemu-block <qemu-block@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v5] raw-posix.c: Make physical devices usable in QEMU under Mac OS X host
Date: Fri, 20 Nov 2015 17:26:33 +0100 [thread overview]
Message-ID: <20151120162633.GE4130@noname.redhat.com> (raw)
In-Reply-To: <EF598E07-4676-494E-A8AD-A50EDE921662@gmail.com>
Am 27.07.2015 um 19:05 hat Programmingkid geschrieben:
> Mac OS X can be picky when it comes to allowing the user to use physical
> devices
> in QEMU. Most mounted volumes appear to be off limits to QEMU. If an issue is
> detected, a message is displayed showing the user how to unmount a volume.
>
> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
>
> ---
> Removed changes to GetBSDPath() to a separate patch.
> This patch now depends on the GetBSDPath patch.
Unfortunately, this patch was sent as HTML, so git am doesn't accept it.
I tried to manually get something working out of it, but I failed.
Possibly there are actual merge conflicts, too (even going back to
master@{2015-07-27}), but in any case I couldn't apply this.
Can you please rebase and send as a plain text patch that applies to
current master?
> @@ -2156,7 +2180,21 @@ static int hdev_open(BlockDriverState *bs, QDict
> *options, int flags,
> if (local_err) {
> error_propagate(errp, local_err);
> }
> - return ret;
> + }
> +
> +#if defined(__APPLE__) && defined(__MACH__)
> + /* if a physical device experienced an error while being opened */
> + if (strncmp(filename, "/dev/", 5) == 0 && (cdromOK == false || ret != 0))
> {
> + printf("If device %s is mounted on the desktop, unmount it"
> + " first before using it in QEMU.\n", filename);
> + printf("Command to unmount device: diskutil unmountDisk %s\n",
> + filename);
> + printf("Command to mount device: diskutil mountDisk %s\n", filename);
> + }
> +#endif /* defined(__APPLE__) && defined(__MACH__) */
> +
> + if (ret < 0) {
> + return ret;
> }
Why don't you simply include the #ifdef block in the first if (ret < 0)?
Or does ret > 0 happen and the message must be displayed for it?
Kevin
next prev parent reply other threads:[~2015-11-20 16:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-27 17:05 [Qemu-devel] [PATCH v5] raw-posix.c: Make physical devices usable in QEMU under Mac OS X host Programmingkid
2015-07-28 10:20 ` Stefan Hajnoczi
2015-09-28 15:25 ` [Qemu-devel] ping: " Programmingkid
2015-11-20 16:26 ` Kevin Wolf [this message]
2015-11-21 0:42 ` [Qemu-devel] " Programmingkid
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=20151120162633.GE4130@noname.redhat.com \
--to=kwolf@redhat.com \
--cc=programmingkidx@gmail.com \
--cc=qemu-block@nongnu.org \
--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 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.