From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40971) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0qMQ-0002hk-CX for qemu-devel@nongnu.org; Fri, 05 Jun 2015 08:04:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0qMJ-0005Ci-VO for qemu-devel@nongnu.org; Fri, 05 Jun 2015 08:04:30 -0400 Received: from mail.emea.novell.com ([130.57.118.101]:40918) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0qMJ-0005CQ-JU for qemu-devel@nongnu.org; Fri, 05 Jun 2015 08:04:23 -0400 Message-Id: <5571AC62020000780008156F@mail.emea.novell.com> Date: Fri, 05 Jun 2015 13:04:18 +0100 From: "Jan Beulich" References: <5571AA3B020000780008152E@mail.emea.novell.com> In-Reply-To: <5571AA3B020000780008152E@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part8EBAA752.2__=" Subject: [Qemu-devel] [PATCH 5/6] xen/pass-through: log errno values rather than function return ones List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: xen-devel , Stefano Stabellini This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part8EBAA752.2__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Functions setting errno commonly return just -1, which is of no particular use in the log file. Signed-off-by: Jan Beulich --- a/qemu/upstream/hw/xen/xen_pt.c +++ b/qemu/upstream/hw/xen/xen_pt.c @@ -609,8 +609,8 @@ static void xen_pt_region_update(XenPCIP guest_port, machine_port, size, op); if (rc) { - XEN_PT_ERR(d, "%s ioport mapping failed! (rc: %i)\n", - adding ? "create new" : "remove old", rc); + XEN_PT_ERR(d, "%s ioport mapping failed! (err: %i)\n", + adding ? "create new" : "remove old", errno); } } else { pcibus_t guest_addr =3D sec->offset_within_address_space; @@ -623,8 +623,8 @@ static void xen_pt_region_update(XenPCIP XEN_PFN(size + XC_PAGE_SIZE - 1), op); if (rc) { - XEN_PT_ERR(d, "%s mem mapping failed! (rc: %i)\n", - adding ? "create new" : "remove old", rc); + XEN_PT_ERR(d, "%s mem mapping failed! (err: %i)\n", + adding ? "create new" : "remove old", errno); } } } @@ -738,8 +738,8 @@ static int xen_pt_initfn(PCIDevice *d) rc =3D xc_physdev_map_pirq(xen_xc, xen_domid, machine_irq, &pirq); =20 if (rc < 0) { - XEN_PT_ERR(d, "Mapping machine irq %u to pirq %i failed, (rc: = %d)\n", - machine_irq, pirq, rc); + XEN_PT_ERR(d, "Mapping machine irq %u to pirq %i failed, (err: = %d)\n", + machine_irq, pirq, errno); =20 /* Disable PCI intx assertion (turn on bit10 of devctl) */ cmd |=3D PCI_COMMAND_INTX_DISABLE; @@ -760,8 +760,8 @@ static int xen_pt_initfn(PCIDevice *d) PCI_SLOT(d->devfn), e_intx); if (rc < 0) { - XEN_PT_ERR(d, "Binding of interrupt %i failed! (rc: %d)\n", - e_intx, rc); + XEN_PT_ERR(d, "Binding of interrupt %i failed! (err: %d)\n", + e_intx, errno); =20 /* Disable PCI intx assertion (turn on bit10 of devctl) */ cmd |=3D PCI_COMMAND_INTX_DISABLE; @@ -770,7 +770,7 @@ static int xen_pt_initfn(PCIDevice *d) if (xen_pt_mapped_machine_irq[machine_irq] =3D=3D 0) { if (xc_physdev_unmap_pirq(xen_xc, xen_domid, machine_irq))= { XEN_PT_ERR(d, "Unmapping of machine interrupt %i = failed!" - " (rc: %d)\n", machine_irq, rc); + " (err: %d)\n", machine_irq, errno); } } s->machine_irq =3D 0; @@ -808,9 +808,9 @@ static void xen_pt_unregister_device(PCI 0 /* isa_irq */); if (rc < 0) { XEN_PT_ERR(d, "unbinding of interrupt INT%c failed." - " (machine irq: %i, rc: %d)" + " (machine irq: %i, err: %d)" " But bravely continuing on..\n", - 'a' + intx, machine_irq, rc); + 'a' + intx, machine_irq, errno); } } =20 @@ -828,9 +828,9 @@ static void xen_pt_unregister_device(PCI rc =3D xc_physdev_unmap_pirq(xen_xc, xen_domid, machine_irq); =20 if (rc < 0) { - XEN_PT_ERR(d, "unmapping of interrupt %i failed. (rc: = %d)" + XEN_PT_ERR(d, "unmapping of interrupt %i failed. (err: = %d)" " But bravely continuing on..\n", - machine_irq, rc); + machine_irq, errno); } } } --- a/qemu/upstream/hw/xen/xen_pt_msi.c +++ b/qemu/upstream/hw/xen/xen_pt_msi.c @@ -133,8 +133,8 @@ static int msi_msix_setup(XenPCIPassthro msix_entry, table_base); if (rc) { XEN_PT_ERR(&s->dev, - "Mapping of MSI%s (rc: %i, vec: %#x, entry = %#x)\n", - is_msix ? "-X" : "", rc, gvec, msix_entry); + "Mapping of MSI%s (err: %i, vec: %#x, entry = %#x)\n", + is_msix ? "-X" : "", errno, gvec, msix_entry); return rc; } } @@ -167,12 +167,12 @@ static int msi_msix_update(XenPCIPassthr pirq, gflags, table_addr); =20 if (rc) { - XEN_PT_ERR(d, "Updating of MSI%s failed. (rc: %d)\n", - is_msix ? "-X" : "", rc); + XEN_PT_ERR(d, "Updating of MSI%s failed. (err: %d)\n", + is_msix ? "-X" : "", errno); =20 if (xc_physdev_unmap_pirq(xen_xc, xen_domid, *old_pirq)) { - XEN_PT_ERR(d, "Unmapping of MSI%s pirq %d failed.\n", - is_msix ? "-X" : "", *old_pirq); + XEN_PT_ERR(d, "Unmapping of MSI%s pirq %d failed. (err: = %d)\n", + is_msix ? "-X" : "", *old_pirq, errno); } *old_pirq =3D XEN_PT_UNASSIGNED_PIRQ; } @@ -200,8 +200,8 @@ static int msi_msix_disable(XenPCIPassth is_msix ? "-X" : "", pirq, gvec); rc =3D xc_domain_unbind_msi_irq(xen_xc, xen_domid, gvec, pirq, = gflags); if (rc) { - XEN_PT_ERR(d, "Unbinding of MSI%s failed. (pirq: %d, gvec: = %#x)\n", - is_msix ? "-X" : "", pirq, gvec); + XEN_PT_ERR(d, "Unbinding of MSI%s failed. (err: %d, pirq: %d, = gvec: %#x)\n", + is_msix ? "-X" : "", errno, pirq, gvec); return rc; } } @@ -209,8 +209,8 @@ static int msi_msix_disable(XenPCIPassth XEN_PT_LOG(d, "Unmap MSI%s pirq %d\n", is_msix ? "-X" : "", pirq); rc =3D xc_physdev_unmap_pirq(xen_xc, xen_domid, pirq); if (rc) { - XEN_PT_ERR(d, "Unmapping of MSI%s pirq %d failed. (rc: %i)\n", - is_msix ? "-X" : "", pirq, rc); + XEN_PT_ERR(d, "Unmapping of MSI%s pirq %d failed. (err: %i)\n", + is_msix ? "-X" : "", pirq, errno); return rc; } =20 @@ -410,8 +410,8 @@ int xen_pt_msix_update_remap(XenPCIPasst ret =3D xc_domain_unbind_pt_irq(xen_xc, xen_domid, entry->pirq= , PT_IRQ_TYPE_MSI, 0, 0, 0, 0); if (ret) { - XEN_PT_ERR(&s->dev, "unbind MSI-X entry %d failed\n", - entry->pirq); + XEN_PT_ERR(&s->dev, "unbind MSI-X entry %d failed (err: = %d)\n", + entry->pirq, errno); } entry->updated =3D true; } --=__Part8EBAA752.2__= Content-Type: text/plain; name="qemu-pt-log-errno.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="qemu-pt-log-errno.patch" xen/pass-through: log errno values rather than function return ones=0A=0AFu= nctions setting errno commonly return just -1, which is of no=0Aparticular = use in the log file.=0A=0ASigned-off-by: Jan Beulich =0A= =0A--- a/qemu/upstream/hw/xen/xen_pt.c=0A+++ b/qemu/upstream/hw/xen/xen_pt.= c=0A@@ -609,8 +609,8 @@ static void xen_pt_region_update(XenPCIP=0A = guest_port, machine_port, size,=0A = op);=0A if (rc) {=0A- = XEN_PT_ERR(d, "%s ioport mapping failed! (rc: %i)\n",=0A- = adding ? "create new" : "remove old", rc);=0A+ XEN_PT_ERR(d= , "%s ioport mapping failed! (err: %i)\n",=0A+ = adding ? "create new" : "remove old", errno);=0A }=0A } else = {=0A pcibus_t guest_addr =3D sec->offset_within_address_space;=0A@@= -623,8 +623,8 @@ static void xen_pt_region_update(XenPCIP=0A = XEN_PFN(size + XC_PAGE_SIZE - 1),=0A = op);=0A if (rc) {=0A- = XEN_PT_ERR(d, "%s mem mapping failed! (rc: %i)\n",=0A- = adding ? "create new" : "remove old", rc);=0A+ XEN_PT_ERR(d, = "%s mem mapping failed! (err: %i)\n",=0A+ adding ? = "create new" : "remove old", errno);=0A }=0A }=0A }=0A@@ = -738,8 +738,8 @@ static int xen_pt_initfn(PCIDevice *d)=0A rc =3D = xc_physdev_map_pirq(xen_xc, xen_domid, machine_irq, &pirq);=0A =0A if = (rc < 0) {=0A- XEN_PT_ERR(d, "Mapping machine irq %u to pirq %i = failed, (rc: %d)\n",=0A- machine_irq, pirq, rc);=0A+ = XEN_PT_ERR(d, "Mapping machine irq %u to pirq %i failed, (err: = %d)\n",=0A+ machine_irq, pirq, errno);=0A =0A /* = Disable PCI intx assertion (turn on bit10 of devctl) */=0A cmd = |=3D PCI_COMMAND_INTX_DISABLE;=0A@@ -760,8 +760,8 @@ static int xen_pt_init= fn(PCIDevice *d)=0A PCI_SLOT(d->devf= n),=0A e_intx);=0A if (rc < = 0) {=0A- XEN_PT_ERR(d, "Binding of interrupt %i failed! (rc: = %d)\n",=0A- e_intx, rc);=0A+ XEN_PT_ERR(d,= "Binding of interrupt %i failed! (err: %d)\n",=0A+ = e_intx, errno);=0A =0A /* Disable PCI intx assertion (turn on = bit10 of devctl) */=0A cmd |=3D PCI_COMMAND_INTX_DISABLE;=0A@@ = -770,7 +770,7 @@ static int xen_pt_initfn(PCIDevice *d)=0A if = (xen_pt_mapped_machine_irq[machine_irq] =3D=3D 0) {=0A if = (xc_physdev_unmap_pirq(xen_xc, xen_domid, machine_irq)) {=0A = XEN_PT_ERR(d, "Unmapping of machine interrupt %i failed!"=0A- = " (rc: %d)\n", machine_irq, rc);=0A+ = " (err: %d)\n", machine_irq, errno);=0A = }=0A }=0A s->machine_irq =3D 0;=0A@@ -808,9 +808,9 = @@ static void xen_pt_unregister_device(PCI=0A = 0 /* isa_irq */);=0A if (rc < 0) {=0A = XEN_PT_ERR(d, "unbinding of interrupt INT%c failed."=0A- = " (machine irq: %i, rc: %d)"=0A+ " (machine irq: = %i, err: %d)"=0A " But bravely continuing = on..\n",=0A- 'a' + intx, machine_irq, rc);=0A+ = 'a' + intx, machine_irq, errno);=0A }=0A }=0A = =0A@@ -828,9 +828,9 @@ static void xen_pt_unregister_device(PCI=0A = rc =3D xc_physdev_unmap_pirq(xen_xc, xen_domid, machine_irq);=0A =0A = if (rc < 0) {=0A- XEN_PT_ERR(d, "unmapping of = interrupt %i failed. (rc: %d)"=0A+ XEN_PT_ERR(d, "unmapping = of interrupt %i failed. (err: %d)"=0A " But = bravely continuing on..\n",=0A- machine_irq, = rc);=0A+ machine_irq, errno);=0A = }=0A }=0A }=0A--- a/qemu/upstream/hw/xen/xen_pt_msi.c=0A+++ = b/qemu/upstream/hw/xen/xen_pt_msi.c=0A@@ -133,8 +133,8 @@ static int = msi_msix_setup(XenPCIPassthro=0A = msix_entry, table_base);=0A if (rc) {=0A XEN_PT_ERR(&s-= >dev,=0A- "Mapping of MSI%s (rc: %i, vec: %#x, entry = %#x)\n",=0A- is_msix ? "-X" : "", rc, gvec, = msix_entry);=0A+ "Mapping of MSI%s (err: %i, vec: = %#x, entry %#x)\n",=0A+ is_msix ? "-X" : "", errno, = gvec, msix_entry);=0A return rc;=0A }=0A }=0A@@ = -167,12 +167,12 @@ static int msi_msix_update(XenPCIPassthr=0A = pirq, gflags, table_addr);=0A =0A if (rc) {=0A- = XEN_PT_ERR(d, "Updating of MSI%s failed. (rc: %d)\n",=0A- = is_msix ? "-X" : "", rc);=0A+ XEN_PT_ERR(d, "Updating of = MSI%s failed. (err: %d)\n",=0A+ is_msix ? "-X" : "", = errno);=0A =0A if (xc_physdev_unmap_pirq(xen_xc, xen_domid, = *old_pirq)) {=0A- XEN_PT_ERR(d, "Unmapping of MSI%s pirq %d = failed.\n",=0A- is_msix ? "-X" : "", *old_pirq);=0A+ = XEN_PT_ERR(d, "Unmapping of MSI%s pirq %d failed. (err: = %d)\n",=0A+ is_msix ? "-X" : "", *old_pirq, = errno);=0A }=0A *old_pirq =3D XEN_PT_UNASSIGNED_PIRQ;=0A = }=0A@@ -200,8 +200,8 @@ static int msi_msix_disable(XenPCIPassth=0A = is_msix ? "-X" : "", pirq, gvec);=0A rc =3D = xc_domain_unbind_msi_irq(xen_xc, xen_domid, gvec, pirq, gflags);=0A = if (rc) {=0A- XEN_PT_ERR(d, "Unbinding of MSI%s failed. (pirq: = %d, gvec: %#x)\n",=0A- is_msix ? "-X" : "", pirq, = gvec);=0A+ XEN_PT_ERR(d, "Unbinding of MSI%s failed. (err: %d, = pirq: %d, gvec: %#x)\n",=0A+ is_msix ? "-X" : "", = errno, pirq, gvec);=0A return rc;=0A }=0A }=0A@@ = -209,8 +209,8 @@ static int msi_msix_disable(XenPCIPassth=0A XEN_PT_LOG= (d, "Unmap MSI%s pirq %d\n", is_msix ? "-X" : "", pirq);=0A rc =3D = xc_physdev_unmap_pirq(xen_xc, xen_domid, pirq);=0A if (rc) {=0A- = XEN_PT_ERR(d, "Unmapping of MSI%s pirq %d failed. (rc: %i)\n",=0A- = is_msix ? "-X" : "", pirq, rc);=0A+ XEN_PT_ERR(d, = "Unmapping of MSI%s pirq %d failed. (err: %i)\n",=0A+ = is_msix ? "-X" : "", pirq, errno);=0A return rc;=0A }=0A =0A@@ = -410,8 +410,8 @@ int xen_pt_msix_update_remap(XenPCIPasst=0A = ret =3D xc_domain_unbind_pt_irq(xen_xc, xen_domid, entry->pirq,=0A = PT_IRQ_TYPE_MSI, 0, 0, 0, 0);=0A = if (ret) {=0A- XEN_PT_ERR(&s->dev, "unbind MSI-X entry = %d failed\n",=0A- entry->pirq);=0A+ = XEN_PT_ERR(&s->dev, "unbind MSI-X entry %d failed (err: %d)\n",=0A+ = entry->pirq, errno);=0A }=0A = entry->updated =3D true;=0A }=0A --=__Part8EBAA752.2__=-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: [PATCH 5/6] xen/pass-through: log errno values rather than function return ones Date: Fri, 05 Jun 2015 13:04:18 +0100 Message-ID: <5571AC62020000780008156F@mail.emea.novell.com> References: <5571AA3B020000780008152E@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part8EBAA752.1__=" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z0qMK-0000Ci-W7 for xen-devel@lists.xenproject.org; Fri, 05 Jun 2015 12:04:25 +0000 In-Reply-To: <5571AA3B020000780008152E@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: qemu-devel@nongnu.org Cc: xen-devel , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part8EBAA752.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Functions setting errno commonly return just -1, which is of no particular use in the log file. Signed-off-by: Jan Beulich --- a/qemu/upstream/hw/xen/xen_pt.c +++ b/qemu/upstream/hw/xen/xen_pt.c @@ -609,8 +609,8 @@ static void xen_pt_region_update(XenPCIP guest_port, machine_port, size, op); if (rc) { - XEN_PT_ERR(d, "%s ioport mapping failed! (rc: %i)\n", - adding ? "create new" : "remove old", rc); + XEN_PT_ERR(d, "%s ioport mapping failed! (err: %i)\n", + adding ? "create new" : "remove old", errno); } } else { pcibus_t guest_addr =3D sec->offset_within_address_space; @@ -623,8 +623,8 @@ static void xen_pt_region_update(XenPCIP XEN_PFN(size + XC_PAGE_SIZE - 1), op); if (rc) { - XEN_PT_ERR(d, "%s mem mapping failed! (rc: %i)\n", - adding ? "create new" : "remove old", rc); + XEN_PT_ERR(d, "%s mem mapping failed! (err: %i)\n", + adding ? "create new" : "remove old", errno); } } } @@ -738,8 +738,8 @@ static int xen_pt_initfn(PCIDevice *d) rc =3D xc_physdev_map_pirq(xen_xc, xen_domid, machine_irq, &pirq); =20 if (rc < 0) { - XEN_PT_ERR(d, "Mapping machine irq %u to pirq %i failed, (rc: = %d)\n", - machine_irq, pirq, rc); + XEN_PT_ERR(d, "Mapping machine irq %u to pirq %i failed, (err: = %d)\n", + machine_irq, pirq, errno); =20 /* Disable PCI intx assertion (turn on bit10 of devctl) */ cmd |=3D PCI_COMMAND_INTX_DISABLE; @@ -760,8 +760,8 @@ static int xen_pt_initfn(PCIDevice *d) PCI_SLOT(d->devfn), e_intx); if (rc < 0) { - XEN_PT_ERR(d, "Binding of interrupt %i failed! (rc: %d)\n", - e_intx, rc); + XEN_PT_ERR(d, "Binding of interrupt %i failed! (err: %d)\n", + e_intx, errno); =20 /* Disable PCI intx assertion (turn on bit10 of devctl) */ cmd |=3D PCI_COMMAND_INTX_DISABLE; @@ -770,7 +770,7 @@ static int xen_pt_initfn(PCIDevice *d) if (xen_pt_mapped_machine_irq[machine_irq] =3D=3D 0) { if (xc_physdev_unmap_pirq(xen_xc, xen_domid, machine_irq))= { XEN_PT_ERR(d, "Unmapping of machine interrupt %i = failed!" - " (rc: %d)\n", machine_irq, rc); + " (err: %d)\n", machine_irq, errno); } } s->machine_irq =3D 0; @@ -808,9 +808,9 @@ static void xen_pt_unregister_device(PCI 0 /* isa_irq */); if (rc < 0) { XEN_PT_ERR(d, "unbinding of interrupt INT%c failed." - " (machine irq: %i, rc: %d)" + " (machine irq: %i, err: %d)" " But bravely continuing on..\n", - 'a' + intx, machine_irq, rc); + 'a' + intx, machine_irq, errno); } } =20 @@ -828,9 +828,9 @@ static void xen_pt_unregister_device(PCI rc =3D xc_physdev_unmap_pirq(xen_xc, xen_domid, machine_irq); =20 if (rc < 0) { - XEN_PT_ERR(d, "unmapping of interrupt %i failed. (rc: = %d)" + XEN_PT_ERR(d, "unmapping of interrupt %i failed. (err: = %d)" " But bravely continuing on..\n", - machine_irq, rc); + machine_irq, errno); } } } --- a/qemu/upstream/hw/xen/xen_pt_msi.c +++ b/qemu/upstream/hw/xen/xen_pt_msi.c @@ -133,8 +133,8 @@ static int msi_msix_setup(XenPCIPassthro msix_entry, table_base); if (rc) { XEN_PT_ERR(&s->dev, - "Mapping of MSI%s (rc: %i, vec: %#x, entry = %#x)\n", - is_msix ? "-X" : "", rc, gvec, msix_entry); + "Mapping of MSI%s (err: %i, vec: %#x, entry = %#x)\n", + is_msix ? "-X" : "", errno, gvec, msix_entry); return rc; } } @@ -167,12 +167,12 @@ static int msi_msix_update(XenPCIPassthr pirq, gflags, table_addr); =20 if (rc) { - XEN_PT_ERR(d, "Updating of MSI%s failed. (rc: %d)\n", - is_msix ? "-X" : "", rc); + XEN_PT_ERR(d, "Updating of MSI%s failed. (err: %d)\n", + is_msix ? "-X" : "", errno); =20 if (xc_physdev_unmap_pirq(xen_xc, xen_domid, *old_pirq)) { - XEN_PT_ERR(d, "Unmapping of MSI%s pirq %d failed.\n", - is_msix ? "-X" : "", *old_pirq); + XEN_PT_ERR(d, "Unmapping of MSI%s pirq %d failed. (err: = %d)\n", + is_msix ? "-X" : "", *old_pirq, errno); } *old_pirq =3D XEN_PT_UNASSIGNED_PIRQ; } @@ -200,8 +200,8 @@ static int msi_msix_disable(XenPCIPassth is_msix ? "-X" : "", pirq, gvec); rc =3D xc_domain_unbind_msi_irq(xen_xc, xen_domid, gvec, pirq, = gflags); if (rc) { - XEN_PT_ERR(d, "Unbinding of MSI%s failed. (pirq: %d, gvec: = %#x)\n", - is_msix ? "-X" : "", pirq, gvec); + XEN_PT_ERR(d, "Unbinding of MSI%s failed. (err: %d, pirq: %d, = gvec: %#x)\n", + is_msix ? "-X" : "", errno, pirq, gvec); return rc; } } @@ -209,8 +209,8 @@ static int msi_msix_disable(XenPCIPassth XEN_PT_LOG(d, "Unmap MSI%s pirq %d\n", is_msix ? "-X" : "", pirq); rc =3D xc_physdev_unmap_pirq(xen_xc, xen_domid, pirq); if (rc) { - XEN_PT_ERR(d, "Unmapping of MSI%s pirq %d failed. (rc: %i)\n", - is_msix ? "-X" : "", pirq, rc); + XEN_PT_ERR(d, "Unmapping of MSI%s pirq %d failed. (err: %i)\n", + is_msix ? "-X" : "", pirq, errno); return rc; } =20 @@ -410,8 +410,8 @@ int xen_pt_msix_update_remap(XenPCIPasst ret =3D xc_domain_unbind_pt_irq(xen_xc, xen_domid, entry->pirq= , PT_IRQ_TYPE_MSI, 0, 0, 0, 0); if (ret) { - XEN_PT_ERR(&s->dev, "unbind MSI-X entry %d failed\n", - entry->pirq); + XEN_PT_ERR(&s->dev, "unbind MSI-X entry %d failed (err: = %d)\n", + entry->pirq, errno); } entry->updated =3D true; } --=__Part8EBAA752.1__= Content-Type: text/plain; name="qemu-pt-log-errno.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="qemu-pt-log-errno.patch" xen/pass-through: log errno values rather than function return ones=0A=0AFu= nctions setting errno commonly return just -1, which is of no=0Aparticular = use in the log file.=0A=0ASigned-off-by: Jan Beulich =0A= =0A--- a/qemu/upstream/hw/xen/xen_pt.c=0A+++ b/qemu/upstream/hw/xen/xen_pt.= c=0A@@ -609,8 +609,8 @@ static void xen_pt_region_update(XenPCIP=0A = guest_port, machine_port, size,=0A = op);=0A if (rc) {=0A- = XEN_PT_ERR(d, "%s ioport mapping failed! (rc: %i)\n",=0A- = adding ? "create new" : "remove old", rc);=0A+ XEN_PT_ERR(d= , "%s ioport mapping failed! (err: %i)\n",=0A+ = adding ? "create new" : "remove old", errno);=0A }=0A } else = {=0A pcibus_t guest_addr =3D sec->offset_within_address_space;=0A@@= -623,8 +623,8 @@ static void xen_pt_region_update(XenPCIP=0A = XEN_PFN(size + XC_PAGE_SIZE - 1),=0A = op);=0A if (rc) {=0A- = XEN_PT_ERR(d, "%s mem mapping failed! (rc: %i)\n",=0A- = adding ? "create new" : "remove old", rc);=0A+ XEN_PT_ERR(d, = "%s mem mapping failed! (err: %i)\n",=0A+ adding ? = "create new" : "remove old", errno);=0A }=0A }=0A }=0A@@ = -738,8 +738,8 @@ static int xen_pt_initfn(PCIDevice *d)=0A rc =3D = xc_physdev_map_pirq(xen_xc, xen_domid, machine_irq, &pirq);=0A =0A if = (rc < 0) {=0A- XEN_PT_ERR(d, "Mapping machine irq %u to pirq %i = failed, (rc: %d)\n",=0A- machine_irq, pirq, rc);=0A+ = XEN_PT_ERR(d, "Mapping machine irq %u to pirq %i failed, (err: = %d)\n",=0A+ machine_irq, pirq, errno);=0A =0A /* = Disable PCI intx assertion (turn on bit10 of devctl) */=0A cmd = |=3D PCI_COMMAND_INTX_DISABLE;=0A@@ -760,8 +760,8 @@ static int xen_pt_init= fn(PCIDevice *d)=0A PCI_SLOT(d->devf= n),=0A e_intx);=0A if (rc < = 0) {=0A- XEN_PT_ERR(d, "Binding of interrupt %i failed! (rc: = %d)\n",=0A- e_intx, rc);=0A+ XEN_PT_ERR(d,= "Binding of interrupt %i failed! (err: %d)\n",=0A+ = e_intx, errno);=0A =0A /* Disable PCI intx assertion (turn on = bit10 of devctl) */=0A cmd |=3D PCI_COMMAND_INTX_DISABLE;=0A@@ = -770,7 +770,7 @@ static int xen_pt_initfn(PCIDevice *d)=0A if = (xen_pt_mapped_machine_irq[machine_irq] =3D=3D 0) {=0A if = (xc_physdev_unmap_pirq(xen_xc, xen_domid, machine_irq)) {=0A = XEN_PT_ERR(d, "Unmapping of machine interrupt %i failed!"=0A- = " (rc: %d)\n", machine_irq, rc);=0A+ = " (err: %d)\n", machine_irq, errno);=0A = }=0A }=0A s->machine_irq =3D 0;=0A@@ -808,9 +808,9 = @@ static void xen_pt_unregister_device(PCI=0A = 0 /* isa_irq */);=0A if (rc < 0) {=0A = XEN_PT_ERR(d, "unbinding of interrupt INT%c failed."=0A- = " (machine irq: %i, rc: %d)"=0A+ " (machine irq: = %i, err: %d)"=0A " But bravely continuing = on..\n",=0A- 'a' + intx, machine_irq, rc);=0A+ = 'a' + intx, machine_irq, errno);=0A }=0A }=0A = =0A@@ -828,9 +828,9 @@ static void xen_pt_unregister_device(PCI=0A = rc =3D xc_physdev_unmap_pirq(xen_xc, xen_domid, machine_irq);=0A =0A = if (rc < 0) {=0A- XEN_PT_ERR(d, "unmapping of = interrupt %i failed. (rc: %d)"=0A+ XEN_PT_ERR(d, "unmapping = of interrupt %i failed. (err: %d)"=0A " But = bravely continuing on..\n",=0A- machine_irq, = rc);=0A+ machine_irq, errno);=0A = }=0A }=0A }=0A--- a/qemu/upstream/hw/xen/xen_pt_msi.c=0A+++ = b/qemu/upstream/hw/xen/xen_pt_msi.c=0A@@ -133,8 +133,8 @@ static int = msi_msix_setup(XenPCIPassthro=0A = msix_entry, table_base);=0A if (rc) {=0A XEN_PT_ERR(&s-= >dev,=0A- "Mapping of MSI%s (rc: %i, vec: %#x, entry = %#x)\n",=0A- is_msix ? "-X" : "", rc, gvec, = msix_entry);=0A+ "Mapping of MSI%s (err: %i, vec: = %#x, entry %#x)\n",=0A+ is_msix ? "-X" : "", errno, = gvec, msix_entry);=0A return rc;=0A }=0A }=0A@@ = -167,12 +167,12 @@ static int msi_msix_update(XenPCIPassthr=0A = pirq, gflags, table_addr);=0A =0A if (rc) {=0A- = XEN_PT_ERR(d, "Updating of MSI%s failed. (rc: %d)\n",=0A- = is_msix ? "-X" : "", rc);=0A+ XEN_PT_ERR(d, "Updating of = MSI%s failed. (err: %d)\n",=0A+ is_msix ? "-X" : "", = errno);=0A =0A if (xc_physdev_unmap_pirq(xen_xc, xen_domid, = *old_pirq)) {=0A- XEN_PT_ERR(d, "Unmapping of MSI%s pirq %d = failed.\n",=0A- is_msix ? "-X" : "", *old_pirq);=0A+ = XEN_PT_ERR(d, "Unmapping of MSI%s pirq %d failed. (err: = %d)\n",=0A+ is_msix ? "-X" : "", *old_pirq, = errno);=0A }=0A *old_pirq =3D XEN_PT_UNASSIGNED_PIRQ;=0A = }=0A@@ -200,8 +200,8 @@ static int msi_msix_disable(XenPCIPassth=0A = is_msix ? "-X" : "", pirq, gvec);=0A rc =3D = xc_domain_unbind_msi_irq(xen_xc, xen_domid, gvec, pirq, gflags);=0A = if (rc) {=0A- XEN_PT_ERR(d, "Unbinding of MSI%s failed. (pirq: = %d, gvec: %#x)\n",=0A- is_msix ? "-X" : "", pirq, = gvec);=0A+ XEN_PT_ERR(d, "Unbinding of MSI%s failed. (err: %d, = pirq: %d, gvec: %#x)\n",=0A+ is_msix ? "-X" : "", = errno, pirq, gvec);=0A return rc;=0A }=0A }=0A@@ = -209,8 +209,8 @@ static int msi_msix_disable(XenPCIPassth=0A XEN_PT_LOG= (d, "Unmap MSI%s pirq %d\n", is_msix ? "-X" : "", pirq);=0A rc =3D = xc_physdev_unmap_pirq(xen_xc, xen_domid, pirq);=0A if (rc) {=0A- = XEN_PT_ERR(d, "Unmapping of MSI%s pirq %d failed. (rc: %i)\n",=0A- = is_msix ? "-X" : "", pirq, rc);=0A+ XEN_PT_ERR(d, = "Unmapping of MSI%s pirq %d failed. (err: %i)\n",=0A+ = is_msix ? "-X" : "", pirq, errno);=0A return rc;=0A }=0A =0A@@ = -410,8 +410,8 @@ int xen_pt_msix_update_remap(XenPCIPasst=0A = ret =3D xc_domain_unbind_pt_irq(xen_xc, xen_domid, entry->pirq,=0A = PT_IRQ_TYPE_MSI, 0, 0, 0, 0);=0A = if (ret) {=0A- XEN_PT_ERR(&s->dev, "unbind MSI-X entry = %d failed\n",=0A- entry->pirq);=0A+ = XEN_PT_ERR(&s->dev, "unbind MSI-X entry %d failed (err: %d)\n",=0A+ = entry->pirq, errno);=0A }=0A = entry->updated =3D true;=0A }=0A --=__Part8EBAA752.1__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__Part8EBAA752.1__=--