From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSO8p-0001oV-QH for qemu-devel@nongnu.org; Wed, 27 Jul 2016 08:40:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSO8m-00019v-3t for qemu-devel@nongnu.org; Wed, 27 Jul 2016 08:40:50 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:62928 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSO8l-00019b-VI for qemu-devel@nongnu.org; Wed, 27 Jul 2016 08:40:48 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u6RCYGoE039723 for ; Wed, 27 Jul 2016 08:40:46 -0400 Received: from e06smtp09.uk.ibm.com (e06smtp09.uk.ibm.com [195.75.94.105]) by mx0a-001b2d01.pphosted.com with ESMTP id 24eatj8gay-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 27 Jul 2016 08:40:46 -0400 Received: from localhost by e06smtp09.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 27 Jul 2016 13:40:44 +0100 References: <1468845016-43468-1-git-send-email-pasic@linux.vnet.ibm.com> <1469532873-78542-1-git-send-email-pasic@linux.vnet.ibm.com> <7c4bdb1e-f0aa-4a07-2780-37f4f92c6665@redhat.com> <57979B63.1060505@linux.vnet.ibm.com> From: Halil Pasic Date: Wed, 27 Jul 2016 14:40:20 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cbxg4i26xJhf92b94egw1CQAnOvWj2O6n" Message-Id: <5798ABB4.1070505@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH v2 1/1] block: improve error handling in raw_open List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-block@nongnu.org Cc: Kevin Wolf , Cornelia Huck , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --cbxg4i26xJhf92b94egw1CQAnOvWj2O6n From: Halil Pasic To: Max Reitz , qemu-block@nongnu.org Cc: Kevin Wolf , Cornelia Huck , qemu-devel@nongnu.org Message-ID: <5798ABB4.1070505@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH v2 1/1] block: improve error handling in raw_open References: <1468845016-43468-1-git-send-email-pasic@linux.vnet.ibm.com> <1469532873-78542-1-git-send-email-pasic@linux.vnet.ibm.com> <7c4bdb1e-f0aa-4a07-2780-37f4f92c6665@redhat.com> <57979B63.1060505@linux.vnet.ibm.com> In-Reply-To: Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 07/26/2016 07:47 PM, Max Reitz wrote: >> Frankly, I'm a bit uncomfortable with asking (do not want to be pushy)= , >> > but do you have an opinion on the 'error_report_err' issue (pointed >> > out in the cover letter part)? > You are using drive_add with QMP? As far as I know, one can only do so > with human-monitor-command which returns the error string like so: >=20 > {"return": "Could not open file: No such file or directory\r\n"} >=20 Yes, libvirt uses human-monitor-command, but are you sure the error message is propagated back as described above? Here is the call chain I'm talking about: #0 error_report_err (err=3D0x1329a9d0) at /mnt/devel/root/git/qemu/util/= error.c:228 #1 0x00000000100de4fe in drive_new (all_opts=3Dall_opts@entry=3D0x120440= 10, block_default_type=3D) at /mnt/devel/root/git/qemu/blo= ckdev.c:1134 #2 0x00000000100e47be in add_init_drive (optstr=3D) at /m= nt/devel/root/git/qemu/device-hotplug.c:46 #3 hmp_drive_add (mon=3D0x3ffe3f7d188, qdict=3D0x120b3af0) at /mnt/devel= /root/git/qemu/device-hotplug.c:66 #4 0x0000000010052092 in handle_hmp_command (mon=3Dmon@entry=3D0x3ffe3f7= d188, cmdline=3D0x110399ba "dummy file=3D/dev/sg924,if=3Dnone,id=3Ddrive-= hostdev912", cmdline@entry=3D0x110399b0 "drive_add dummy file=3D/dev/sg92= 4,if=3Dnone,id=3Ddrive-hostdev912") at /mnt/devel/root/git/qemu/monitor.c:2929 #5 0x0000000010052176 in qmp_human_monitor_command (command_line=3D0x110= 399b0 "drive_add dummy file=3D/dev/sg924,if=3Dnone,id=3Ddrive-hostdev912"= , has_cpu_index=3D, cpu_index=3D0, errp=3Derrp@entry=3D0x3= ffe3f7d310) at /mnt/devel/root/git/qemu/monitor.c:668 #6 0x00000000100f6faa in qmp_marshal_human_monitor_command (args=3D, ret=3D0x3ffe3f7d400, errp=3D0x3ffe3f7d3f8) at qmp-marshal.c:1= 777 [...] Now if you examine #1 drive_new(all_opts,block_default_type) you see, there is no errp argument and if you examine the code you see that the error from blockdev_init which gets propagated properly to this point gets "handled" by error_report_err (in QMP context! so does not much good on this code path). AFAIU this can not work. Or am I wrong? > Apart from that, as for QMP, in theory you're supposed to use > blockdev-add and device_add, I think (although blockdev-add is still > considered experimental...). And blockdev-add will return the error > string like so: >=20 > {"error": {"class": "GenericError", "desc": "Could not open file: No > such file or directory"}} >=20 I guess libvirt will eventually pick up blockdev-add so the problem should eventually go away. Cheers, Halil --cbxg4i26xJhf92b94egw1CQAnOvWj2O6n 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.0.14 (GNU/Linux) iQIcBAEBAgAGBQJXmKvJAAoJEA0vhuyXGx0AFQ4P/RQZwOICBKRIbYRrx8dmXNsU TFQnQWF920zGTogHAl7zCQZ1EgV6LGIQ/gaYKPnYwdfr1IXvoO1EVkajH/jb2L6H GNojo0v8yaPhUAQibwQDKxHkHaINRN1JTUzavkTpV9TD/U0di+Am6TfzGBetqmxa Tt8hcAqJ2AV5MTQcYpMXaqOSAJbdlw4IlK7N0aDTN82m0SKs0Mpm9gFi9ZUsV/cp lA8qSm+cJmAIbL3Y4qLMnBywQusTs5Z5NGPHCji+cNlyDzoBizjKhZhUPLxRxcwA 9d28jEQq8iddh923WxcG04IOkaFyu9KPf76i3GLEb59FPnzkeB4ELmjYVm3Wfnlu Ox1PTS6lEKlHd7gb/kzku/Ri9/Tkqtp6Rfzd9K11940AVzhHQvJX7Dbu/d8Ax3If lncu266Gr2Tc2CwqpZVVzRp2tGCXKCwn/HrX7zZXanGO84Av7NTR9CJOx550N4lA VpKKgDeQ7HSXMnt4V0NEWtAeQgfUCR/NhLanoIMF8fuGwIk8fSmlx/1DROExRkWA uJ3uhvNdvci47PvFaGc2aTFpUhmh5Rh9Gbb4yapoqMH5AoW3JwtcT/NZ/3a87F7o 2+27CfaLRYNR1q+DjmuIa/xCsswZ/6glBQWN7qaR80/RD1VDvPFlzPDgNj/w7vA3 QEG2hlGJ8WupNJUCa2pd =Do41 -----END PGP SIGNATURE----- --cbxg4i26xJhf92b94egw1CQAnOvWj2O6n--