From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42438) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1o5b-0000fV-Jr for qemu-devel@nongnu.org; Wed, 25 Nov 2015 23:23:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1o5a-0004EX-HT for qemu-devel@nongnu.org; Wed, 25 Nov 2015 23:23:23 -0500 References: From: Eric Blake Message-ID: <5656892E.9020908@redhat.com> Date: Wed, 25 Nov 2015 21:23:10 -0700 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="L7t1Ek3w3q8NkKP3LASCrbIp8fwsmHo53" Subject: Re: [Qemu-devel] [PATCH v9] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Programmingkid , Kevin Wolf Cc: qemu-devel qemu-devel , Qemu-block This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --L7t1Ek3w3q8NkKP3LASCrbIp8fwsmHo53 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/25/2015 09:10 PM, Programmingkid wrote: > 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. >=20 > Signed-off-by: John Arbuckle >=20 > --- > Added DVD support - real DVD media can now be used in QEMU! > Changed name of FindEjectableCDMedia to FindEjectableOpticalMedia. > Added mediaType parameter to FindEjectableOpticalMedia() for media inde= ntification. > Removed unneeded FindEjectableCDMedia() prototype. > FindEjectableOpticalMedia() now searches for both DVD's and CD's. >=20 > +++ b/block/raw-posix.c > @@ -42,9 +42,9 @@ > #include > #include > #include > -//#include > +#include > #include > -#endif > +#endif /* (__APPLE__) && (__MACH__) */ > =20 I don't know if my review of v8 crossed your posting of this patch, but I suggested that this hunk belongs in its own patch. > #ifdef __sun__ > #define _POSIX_PTHREAD_SEMANTICS 1 > @@ -1975,32 +1975,44 @@ BlockDriver bdrv_file =3D { > /* host device */ > =20 > #if defined(__APPLE__) && defined(__MACH__) > -static kern_return_t FindEjectableCDMedia( io_iterator_t *mediaIterato= r ); > static kern_return_t GetBSDPath(io_iterator_t mediaIterator, char *bsd= Path, > CFIndex maxPathSize, int flags); > -kern_return_t FindEjectableCDMedia( io_iterator_t *mediaIterator ) > +static kern_return_t FindEjectableOpticalMedia(io_iterator_t *mediaIte= rator, > + char *= mediaType) Unusual indentation; more typical is: | static kern_return_t FindEjectableOpticalMedia(io_iterator_t *mediaIterator, | char *mediatType) > + int index; > + for (index =3D 0; index < ARRAY_SIZE(matching_array); index++) { > + classesToMatch =3D IOServiceMatching(matching_array[index]); > + if (classesToMatch =3D=3D NULL) { > + printf("IOServiceMatching returned a NULL dictionary.\n");= Leftover debugging? > + } else { > + CFDictionarySetValue(classesToMatch, CFSTR(kIOMediaEjectableKe= y), Missing indentation. > + kCFBoo= leanTrue); > + } > + kernResult =3D IOServiceGetMatchingServices(masterPort, classe= sToMatch, > + media= Iterator); More unusual indentation. > + if (KERN_SUCCESS !=3D kernResult) { > + printf("IOServiceGetMatchingServices returned %d\n", kernR= esult); > + } > =20 > + /* If you found a match, leave the loop */ > + if (*mediaIterator !=3D 0) { > + DPRINTF("Matching using %s\n", matching_array[index]); > + snprintf(mediaType, strlen(matching_array[index])+1, "%s",= Spaces around binary '+'. > + /* if a working partition on the device was not found */ > + if (partition_found =3D=3D false) { > + error_setg(errp, "Error: Failed to find a working partition on= " > + "= disc!\n"); and I already pointed out on v8 that this is not the correct usage of error_setg(). So, here's hoping v10 addresses the comments here and elsewhere. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --L7t1Ek3w3q8NkKP3LASCrbIp8fwsmHo53 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWVokuAAoJEKeha0olJ0NqpxUH/iCcWMPFY10/8STN42B7Y4s7 gxDFvHFenu9Ed57Qr3+lmKwgdP8M0sG8k9AM4r+4Sw8B1Xe/6Zw9Sl4gm7YSrmeA 4qm9QeK2RTVzQ2QLuoKZmAvYiapyBBUSv2Vb77u8N+ERQGxLP2CFwPdtn1FEpQDJ 7ONbKONR79Ka2azB9AeAhfqzSqfm+YKiAEbO/6xpS7dKVv5Xsw4aKHxk3Dl9/nXT a9lGXpp3G3uQBHVwRf0NxQOYntqLyuJA09RLB5pc7RzyDD4f3s/oNilQVSqDxVkn u6dGrtB7mnSDAuuu3gulkJpHaJnWhdVHeoDwtTy8yUWFGoRT3/jXwpqfUKZS7mw= =1jRT -----END PGP SIGNATURE----- --L7t1Ek3w3q8NkKP3LASCrbIp8fwsmHo53--