From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51358) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XniWP-0002V0-Lm for qemu-devel@nongnu.org; Mon, 10 Nov 2014 01:32:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XniWK-0000Y3-7B for qemu-devel@nongnu.org; Mon, 10 Nov 2014 01:32:17 -0500 Received: from mail-pa0-x231.google.com ([2607:f8b0:400e:c03::231]:43101) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XniWK-0000XM-08 for qemu-devel@nongnu.org; Mon, 10 Nov 2014 01:32:12 -0500 Received: by mail-pa0-f49.google.com with SMTP id lj1so7492730pab.8 for ; Sun, 09 Nov 2014 22:32:09 -0800 (PST) Date: Mon, 10 Nov 2014 14:32:15 +0800 From: Amos Kong Message-ID: <20141110063215.GA3112@air.redhat.com> References: <1415598889-11244-1-git-send-email-syeon.hwang@samsung.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cWoXeonUoKmBZSoM" Content-Disposition: inline In-Reply-To: <1415598889-11244-1-git-send-email-syeon.hwang@samsung.com> Subject: Re: [Qemu-devel] [PATCH v3] error: passing a negative value to an os_errno is wrong List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: SeokYeon Hwang Cc: mreitz@redhat.com, paolo.bonzini@gmail.com, qemu-devel@nongnu.org, armbru@redhat.com --cWoXeonUoKmBZSoM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 10, 2014 at 02:54:49PM +0900, SeokYeon Hwang wrote: > Added 'assert(os_errno > 0)' in 'error_set_errno()'. > Fixed errno since it passes wrong value to 'error_set_errno()'. >=20 > Signed-off-by: SeokYeon Hwang Reviewed-by: Amos Kong > --- > hw/pci/pcie.c | 2 +- > util/error.c | 1 + > 2 files changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c > index 58455bd..2902f7d 100644 > --- a/hw/pci/pcie.c > +++ b/hw/pci/pcie.c > @@ -229,7 +229,7 @@ static void pcie_cap_slot_hotplug_common(PCIDevice *h= otplug_dev, > /* the slot is electromechanically locked. > * This error is propagated up to qdev and then to HMP/QMP. > */ > - error_setg_errno(errp, -EBUSY, "slot is electromechanically lock= ed"); > + error_setg_errno(errp, EBUSY, "slot is electromechanically locke= d"); > } > } > =20 > diff --git a/util/error.c b/util/error.c > index 2ace0d8..6c9d995 100644 > --- a/util/error.c > +++ b/util/error.c > @@ -62,6 +62,7 @@ void error_set_errno(Error **errp, int os_errno, ErrorC= lass err_class, > return; > } > assert(*errp =3D=3D NULL); > + assert(os_errno >=3D 0); > =20 > err =3D g_malloc0(sizeof(*err)); > =20 > --=20 > 2.1.0 >=20 --=20 Amos. --cWoXeonUoKmBZSoM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJUYFvvAAoJELxSv6I5vP9jDbkP/1/qNcYdWGk4PUE8BGfl87wd yTnja+s8CHSDxElr51+a9/BKNa87rY3IV+5bTmfFvW9vWmuFHPkuN+DAFlMYj0kC JwRBkXdVdPOAoW++VZ/qvqwIOQ2h9zpkvDFZdi5sK9B8hWwmXLwHGlZT2I0uwHu4 hVgN4Bg/6JZnEV3mjLyZI4nZJnuFYD/cVMaVMmWlWZyz7MkytnB0+LiGfyLJ4YEq zC7vxT7/2fjMhac/PvGhsuejqAPDq+jozIr7TdOGx7ky4YfBy3wbeBvYkn8AsOhG TNzfYbDLRI9CClO3jwuxe5huhJF0N70JkKg2CzIKQ3bG1msAvLkU9vldN0yF532K tonmaopgEbbaaiRVP9xX0rhjdLAYtbzng2QnnR1yEKEUJ6SlZqictkbOfuXKBKPV lhRazU8JefPnt7THMI1tKCuSJN7AM7qWLjOHm8PpsYLVT6ZDUyl7H6r3+x9k62qM M2J9xXM/MYWlYVn+m367Pc96A+yZZAUFeaRd1sA+Nea61z/HGqD63o9qqort4QEk za5+ALC2Be7kaT9Ex2s11yHrwa1XiinXLMbv9nHoP3ebB0z9L2NyYhwYaMUsP/7u OXx4XTzCvuWVvAd0ZbAaM/iMQWCHewcgclXqgc+Iix5j8qDF4fzcqGHh57zfSxVp 6RYWzOeorD4MYzUqvqxp =mX/O -----END PGP SIGNATURE----- --cWoXeonUoKmBZSoM--