* [Qemu-devel] [RFC PATCH v1] Include errno values in printfs for some xc_ calls.
@ 2015-03-13 19:36 Konrad Rzeszutek Wilk
2015-03-13 19:36 ` [Qemu-devel] [PATCH RFC v1 1/2] xen/hw/passthrough: Use errno instead of ret for xc_physdev_map_* calls Konrad Rzeszutek Wilk
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Konrad Rzeszutek Wilk @ 2015-03-13 19:36 UTC (permalink / raw)
To: qemu-devel, stefano.stabellini, xen-devel
Hey,
I've just posted on xen-devel patches that make these two set of
xc_* function conform to the style of returning -1 for error and
stashing the Exx in errno. See:
http://lists.xen.org/archives/html/xen-devel/2015-03/msg01766.html
and
http://lists.xen.org/archives/html/xen-devel/2015-03/msg01769.html
(xc_domain_add_to_physmap fails uses do_memory_op).
hw/xen/xen_pt.c | 4 ++--
hw/xen/xen_pt_msi.c | 4 ++--
xen-hvm.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Qemu-devel] [PATCH RFC v1 1/2] xen/hw/passthrough: Use errno instead of ret for xc_physdev_map_* calls
2015-03-13 19:36 [Qemu-devel] [RFC PATCH v1] Include errno values in printfs for some xc_ calls Konrad Rzeszutek Wilk
@ 2015-03-13 19:36 ` Konrad Rzeszutek Wilk
2015-03-16 10:13 ` Stefano Stabellini
2015-03-13 19:36 ` [Qemu-devel] [PATCH RFC v1 2/2] xen-hvm: When using xc_domain_add_to_physmap also include errno when reporting Konrad Rzeszutek Wilk
2015-03-13 19:46 ` [Qemu-devel] [RFC PATCH v1] Include errno values in printfs for some xc_ calls Patchew Tool
2 siblings, 1 reply; 7+ messages in thread
From: Konrad Rzeszutek Wilk @ 2015-03-13 19:36 UTC (permalink / raw)
To: qemu-devel, stefano.stabellini, xen-devel; +Cc: Konrad Rzeszutek Wilk
As the libxc library follows (mostly) the return negative
for failure and stashes the error value in errno.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
hw/xen/xen_pt.c | 4 ++--
hw/xen/xen_pt_msi.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
index c1bf357..d2c187d 100644
--- a/hw/xen/xen_pt.c
+++ b/hw/xen/xen_pt.c
@@ -691,8 +691,8 @@ static int xen_pt_initfn(PCIDevice *d)
rc = xc_physdev_map_pirq(xen_xc, xen_domid, machine_irq, &pirq);
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);
/* Disable PCI intx assertion (turn on bit10 of devctl) */
xen_host_pci_set_word(&s->real_device,
diff --git a/hw/xen/xen_pt_msi.c b/hw/xen/xen_pt_msi.c
index 9ed9321..b01921a 100644
--- a/hw/xen/xen_pt_msi.c
+++ b/hw/xen/xen_pt_msi.c
@@ -132,8 +132,8 @@ static int msi_msix_setup(XenPCIPassthroughState *s,
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;
}
}
--
2.1.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Qemu-devel] [PATCH RFC v1 2/2] xen-hvm: When using xc_domain_add_to_physmap also include errno when reporting
2015-03-13 19:36 [Qemu-devel] [RFC PATCH v1] Include errno values in printfs for some xc_ calls Konrad Rzeszutek Wilk
2015-03-13 19:36 ` [Qemu-devel] [PATCH RFC v1 1/2] xen/hw/passthrough: Use errno instead of ret for xc_physdev_map_* calls Konrad Rzeszutek Wilk
@ 2015-03-13 19:36 ` Konrad Rzeszutek Wilk
2015-03-16 10:14 ` Stefano Stabellini
2015-03-13 19:46 ` [Qemu-devel] [RFC PATCH v1] Include errno values in printfs for some xc_ calls Patchew Tool
2 siblings, 1 reply; 7+ messages in thread
From: Konrad Rzeszutek Wilk @ 2015-03-13 19:36 UTC (permalink / raw)
To: qemu-devel, stefano.stabellini, xen-devel; +Cc: Konrad Rzeszutek Wilk
.errors - as it will most likely have the proper error value.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
xen-hvm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/xen-hvm.c b/xen-hvm.c
index 7548794..3d6fed3 100644
--- a/xen-hvm.c
+++ b/xen-hvm.c
@@ -348,7 +348,7 @@ go_physmap:
rc = xc_domain_add_to_physmap(xen_xc, xen_domid, XENMAPSPACE_gmfn, idx, gpfn);
if (rc) {
DPRINTF("add_to_physmap MFN %"PRI_xen_pfn" to PFN %"
- PRI_xen_pfn" failed: %d\n", idx, gpfn, rc);
+ PRI_xen_pfn" failed: %d (errno: %d)\n", idx, gpfn, rc, errno);
return -rc;
}
}
@@ -425,7 +425,7 @@ static int xen_remove_from_physmap(XenIOState *state,
rc = xc_domain_add_to_physmap(xen_xc, xen_domid, XENMAPSPACE_gmfn, idx, gpfn);
if (rc) {
fprintf(stderr, "add_to_physmap MFN %"PRI_xen_pfn" to PFN %"
- PRI_xen_pfn" failed: %d\n", idx, gpfn, rc);
+ PRI_xen_pfn" failed: %d (errno: %d)\n", idx, gpfn, rc, errno);
return -rc;
}
}
--
2.1.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [RFC PATCH v1] Include errno values in printfs for some xc_ calls.
2015-03-13 19:36 [Qemu-devel] [RFC PATCH v1] Include errno values in printfs for some xc_ calls Konrad Rzeszutek Wilk
2015-03-13 19:36 ` [Qemu-devel] [PATCH RFC v1 1/2] xen/hw/passthrough: Use errno instead of ret for xc_physdev_map_* calls Konrad Rzeszutek Wilk
2015-03-13 19:36 ` [Qemu-devel] [PATCH RFC v1 2/2] xen-hvm: When using xc_domain_add_to_physmap also include errno when reporting Konrad Rzeszutek Wilk
@ 2015-03-13 19:46 ` Patchew Tool
2 siblings, 0 replies; 7+ messages in thread
From: Patchew Tool @ 2015-03-13 19:46 UTC (permalink / raw)
To: qemu-devel
This series passed Patchew automatic testing, but there are some warnings.
Find the log fragments below, or open the following URL to see the full log:
http://qemu.patchew.org/testing/log/<1426275418-8411-1-git-send-email-konrad.wilk@oracle.com>
----------8<---------
docker run --net=none -v /var/tmp/patchew-tester/tmpJLu77j:/var/tmp/patchew-test patchew:fedora-20 timeout 3600 /var/tmp/patchew-test/qemu-devel.sh /var/tmp/patchew-test
*** Testing 'coding style check' ***
Checking 0001-xen-hw-passthrough--Use-errno-instead-of-ret-for-xc_physdev_map_--calls.patch
total: 0 errors, 0 warnings, 20 lines checked
0001-xen-hw-passthrough--Use-errno-instead-of-ret-for-xc_physdev_map_--calls.patch has no obvious style problems and is ready for submission.
Checking 0002-xen-hvm--When-using-xc_domain_add_to_physmap-also-include-errno-when-reporting.patch
command failed with exit code 0
$@
WARNING: line over 80 characters
#17: FILE: xen-hvm.c:351:
+ PRI_xen_pfn" failed: %d (errno: %d)\n", idx, gpfn, rc, errno);
WARNING: line over 80 characters
#26: FILE: xen-hvm.c:428:
+ PRI_xen_pfn" failed: %d (errno: %d)\n", idx, gpfn, rc, errno);
total: 0 errors, 2 warnings, 16 lines checked
0002-xen-hvm--When-using-xc_domain_add_to_physmap-also-include-errno-when-reporting.patch has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
*** Testing 'configure' ***
Install prefix /usr/local
BIOS directory /usr/local/share/qemu
binary directory /usr/local/bin
library directory /usr/local/lib
module directory /usr/local/lib/qemu
libexec directory /usr/local/libexec
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH RFC v1 1/2] xen/hw/passthrough: Use errno instead of ret for xc_physdev_map_* calls
2015-03-13 19:36 ` [Qemu-devel] [PATCH RFC v1 1/2] xen/hw/passthrough: Use errno instead of ret for xc_physdev_map_* calls Konrad Rzeszutek Wilk
@ 2015-03-16 10:13 ` Stefano Stabellini
2015-03-16 14:27 ` Konrad Rzeszutek Wilk
0 siblings, 1 reply; 7+ messages in thread
From: Stefano Stabellini @ 2015-03-16 10:13 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk; +Cc: xen-devel, qemu-devel, stefano.stabellini
On Fri, 13 Mar 2015, Konrad Rzeszutek Wilk wrote:
> As the libxc library follows (mostly) the return negative
> for failure and stashes the error value in errno.
>
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
I'll add it to my queue
> hw/xen/xen_pt.c | 4 ++--
> hw/xen/xen_pt_msi.c | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
> index c1bf357..d2c187d 100644
> --- a/hw/xen/xen_pt.c
> +++ b/hw/xen/xen_pt.c
> @@ -691,8 +691,8 @@ static int xen_pt_initfn(PCIDevice *d)
> rc = xc_physdev_map_pirq(xen_xc, xen_domid, machine_irq, &pirq);
>
> 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);
>
> /* Disable PCI intx assertion (turn on bit10 of devctl) */
> xen_host_pci_set_word(&s->real_device,
> diff --git a/hw/xen/xen_pt_msi.c b/hw/xen/xen_pt_msi.c
> index 9ed9321..b01921a 100644
> --- a/hw/xen/xen_pt_msi.c
> +++ b/hw/xen/xen_pt_msi.c
> @@ -132,8 +132,8 @@ static int msi_msix_setup(XenPCIPassthroughState *s,
> 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;
> }
> }
> --
> 2.1.0
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH RFC v1 2/2] xen-hvm: When using xc_domain_add_to_physmap also include errno when reporting
2015-03-13 19:36 ` [Qemu-devel] [PATCH RFC v1 2/2] xen-hvm: When using xc_domain_add_to_physmap also include errno when reporting Konrad Rzeszutek Wilk
@ 2015-03-16 10:14 ` Stefano Stabellini
0 siblings, 0 replies; 7+ messages in thread
From: Stefano Stabellini @ 2015-03-16 10:14 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk; +Cc: xen-devel, qemu-devel, stefano.stabellini
On Fri, 13 Mar 2015, Konrad Rzeszutek Wilk wrote:
> .errors - as it will most likely have the proper error value.
>
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> xen-hvm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/xen-hvm.c b/xen-hvm.c
> index 7548794..3d6fed3 100644
> --- a/xen-hvm.c
> +++ b/xen-hvm.c
> @@ -348,7 +348,7 @@ go_physmap:
> rc = xc_domain_add_to_physmap(xen_xc, xen_domid, XENMAPSPACE_gmfn, idx, gpfn);
> if (rc) {
> DPRINTF("add_to_physmap MFN %"PRI_xen_pfn" to PFN %"
> - PRI_xen_pfn" failed: %d\n", idx, gpfn, rc);
> + PRI_xen_pfn" failed: %d (errno: %d)\n", idx, gpfn, rc, errno);
> return -rc;
> }
> }
> @@ -425,7 +425,7 @@ static int xen_remove_from_physmap(XenIOState *state,
> rc = xc_domain_add_to_physmap(xen_xc, xen_domid, XENMAPSPACE_gmfn, idx, gpfn);
> if (rc) {
> fprintf(stderr, "add_to_physmap MFN %"PRI_xen_pfn" to PFN %"
> - PRI_xen_pfn" failed: %d\n", idx, gpfn, rc);
> + PRI_xen_pfn" failed: %d (errno: %d)\n", idx, gpfn, rc, errno);
> return -rc;
> }
> }
> --
> 2.1.0
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH RFC v1 1/2] xen/hw/passthrough: Use errno instead of ret for xc_physdev_map_* calls
2015-03-16 10:13 ` Stefano Stabellini
@ 2015-03-16 14:27 ` Konrad Rzeszutek Wilk
0 siblings, 0 replies; 7+ messages in thread
From: Konrad Rzeszutek Wilk @ 2015-03-16 14:27 UTC (permalink / raw)
To: Stefano Stabellini; +Cc: xen-devel, qemu-devel
On Mon, Mar 16, 2015 at 10:13:50AM +0000, Stefano Stabellini wrote:
> On Fri, 13 Mar 2015, Konrad Rzeszutek Wilk wrote:
> > As the libxc library follows (mostly) the return negative
> > for failure and stashes the error value in errno.
> >
> > Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>
> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>
> I'll add it to my queue
Thank you.
>
>
> > hw/xen/xen_pt.c | 4 ++--
> > hw/xen/xen_pt_msi.c | 4 ++--
> > 2 files changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
> > index c1bf357..d2c187d 100644
> > --- a/hw/xen/xen_pt.c
> > +++ b/hw/xen/xen_pt.c
> > @@ -691,8 +691,8 @@ static int xen_pt_initfn(PCIDevice *d)
> > rc = xc_physdev_map_pirq(xen_xc, xen_domid, machine_irq, &pirq);
> >
> > 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);
> >
> > /* Disable PCI intx assertion (turn on bit10 of devctl) */
> > xen_host_pci_set_word(&s->real_device,
> > diff --git a/hw/xen/xen_pt_msi.c b/hw/xen/xen_pt_msi.c
> > index 9ed9321..b01921a 100644
> > --- a/hw/xen/xen_pt_msi.c
> > +++ b/hw/xen/xen_pt_msi.c
> > @@ -132,8 +132,8 @@ static int msi_msix_setup(XenPCIPassthroughState *s,
> > 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;
> > }
> > }
> > --
> > 2.1.0
> >
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-03-16 14:27 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-13 19:36 [Qemu-devel] [RFC PATCH v1] Include errno values in printfs for some xc_ calls Konrad Rzeszutek Wilk
2015-03-13 19:36 ` [Qemu-devel] [PATCH RFC v1 1/2] xen/hw/passthrough: Use errno instead of ret for xc_physdev_map_* calls Konrad Rzeszutek Wilk
2015-03-16 10:13 ` Stefano Stabellini
2015-03-16 14:27 ` Konrad Rzeszutek Wilk
2015-03-13 19:36 ` [Qemu-devel] [PATCH RFC v1 2/2] xen-hvm: When using xc_domain_add_to_physmap also include errno when reporting Konrad Rzeszutek Wilk
2015-03-16 10:14 ` Stefano Stabellini
2015-03-13 19:46 ` [Qemu-devel] [RFC PATCH v1] Include errno values in printfs for some xc_ calls Patchew Tool
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).