qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v5] raw-posix.c: Make physical devices usable in


From: Kevin Wolf
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
User-agent: Mutt/1.5.21 (2010-09-15)

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 <address@hidden>
> 
> ---
> 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
address@hidden), 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]