[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] ping: [PATCH v13] block/raw-posix.c: Make physical devi
From: |
Programmingkid |
Subject: |
Re: [Qemu-devel] ping: [PATCH v13] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host |
Date: |
Wed, 3 Feb 2016 10:54:05 -0500 |
On Feb 2, 2016, at 11:36 PM, Eric Blake wrote:
> On 02/02/2016 09:21 PM, Programmingkid wrote:
>
>>>> #if defined(__APPLE__) && defined(__MACH__)
>>>> /* if a physical device experienced an error while being opened */
>>>> if (strncmp((*bsd_path ? bsd_path : filename), "/dev/", 5) == 0) {
>>>> print_unmounting_directions(*bsd_path ? bsd_path : filename);
>>>> return -1;
>>>> }
>>>
>>> A bit repetitive. You don't use filename after the fact, so shorter
>>> would be:
>>>
>>> #if defined(__APPLE__)...
>>> if (*bsd_path) {
>>> filename = filename;
>
> Oops, I shouldn't be writing emails late at night. Let's try this again.
>
> if (*bsd_path) {
> filename = bsd_path;
> }
> if (strncmp(filename, ...
>
> Hopefully that makes more sense.
So you want this:
#if defined(__APPLE__) && defined(__MACH__)
if (*bsd_path) {
filename = bsd_path;
}
/* if a physical device experienced an error while being opened */
if (strncmp(filename, "/dev/", 5) == 0) {
print_unmounting_directions(filename);
return -1;
}
#endif /* defined(__APPLE__) && defined(__MACH__) */
- Re: [Qemu-devel] ping: [PATCH v13] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host, (continued)
- Re: [Qemu-devel] ping: [PATCH v13] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host, Daniel P. Berrange, 2016/02/02
- Re: [Qemu-devel] ping: [PATCH v13] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host, Programmingkid, 2016/02/02
- Re: [Qemu-devel] ping: [PATCH v13] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host, Eric Blake, 2016/02/02
- Re: [Qemu-devel] ping: [PATCH v13] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host, Programmingkid, 2016/02/02
- Re: [Qemu-devel] ping: [PATCH v13] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host, Programmingkid, 2016/02/02
- Re: [Qemu-devel] ping: [PATCH v13] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host, Eric Blake, 2016/02/02
- Re: [Qemu-devel] ping: [PATCH v13] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host, Programmingkid, 2016/02/02
- Re: [Qemu-devel] ping: [PATCH v13] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host, Eric Blake, 2016/02/02
- Re: [Qemu-devel] ping: [PATCH v13] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host, Programmingkid, 2016/02/02
- Re: [Qemu-devel] ping: [PATCH v13] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host, Eric Blake, 2016/02/02
- Re: [Qemu-devel] ping: [PATCH v13] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host,
Programmingkid <=
- Re: [Qemu-devel] ping: [PATCH v13] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host, Eric Blake, 2016/02/04
- Re: [Qemu-devel] ping: [PATCH v13] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host, Eric Blake, 2016/02/02
- Re: [Qemu-devel] ping: [PATCH v13] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host, Kevin Wolf, 2016/02/03