* [PATCH 0 of 2] cosmetic fix to libxc for NetBSD
@ 2012-01-19 10:22 Roger Pau Monne
2012-01-19 10:23 ` [PATCH 1 of 2] libxc/NetBSD: return ioctl return value on error Roger Pau Monne
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Roger Pau Monne @ 2012-01-19 10:22 UTC (permalink / raw)
To: xen-devel
Just a cosmetic fix to NetBSD libxc hypercall and a comment explaining
why we return hypercall->retval instead of the output from ioctl.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1 of 2] libxc/NetBSD: return ioctl return value on error
2012-01-19 10:22 [PATCH 0 of 2] cosmetic fix to libxc for NetBSD Roger Pau Monne
@ 2012-01-19 10:23 ` Roger Pau Monne
2012-01-19 10:23 ` [PATCH 2 of 2] libxc: add comment to why NetBSD return hypercall->retval Roger Pau Monne
2012-01-19 10:27 ` [PATCH 0 of 2] cosmetic fix to libxc for NetBSD Roger Pau Monné
2 siblings, 0 replies; 5+ messages in thread
From: Roger Pau Monne @ 2012-01-19 10:23 UTC (permalink / raw)
To: xen-devel
# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1326968255 -3600
# Node ID d7d91b1eb79edf93230713d80ac6ac7738bdd71e
# Parent f14765a3013a27f9e3948ee97fbdb798b057db04
libxc/NetBSD: return ioctl return value on error
NetBSD libxc hypercall implementation was returning -errno on error,
instead of the actual error value from ioctl. Returning error is
easier to understand, and the caller can always check errno.
Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
diff -r f14765a3013a -r d7d91b1eb79e tools/libxc/xc_netbsd.c
--- a/tools/libxc/xc_netbsd.c Mon Jan 16 16:55:37 2012 +0100
+++ b/tools/libxc/xc_netbsd.c Thu Jan 19 11:17:35 2012 +0100
@@ -97,7 +97,7 @@ static int netbsd_privcmd_hypercall(xc_i
int error = ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
if (error < 0)
- return -errno;
+ return error;
else
return hypercall->retval;
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2 of 2] libxc: add comment to why NetBSD return hypercall->retval
2012-01-19 10:22 [PATCH 0 of 2] cosmetic fix to libxc for NetBSD Roger Pau Monne
2012-01-19 10:23 ` [PATCH 1 of 2] libxc/NetBSD: return ioctl return value on error Roger Pau Monne
@ 2012-01-19 10:23 ` Roger Pau Monne
2012-01-19 10:27 ` [PATCH 0 of 2] cosmetic fix to libxc for NetBSD Roger Pau Monné
2 siblings, 0 replies; 5+ messages in thread
From: Roger Pau Monne @ 2012-01-19 10:23 UTC (permalink / raw)
To: xen-devel
# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1326968470 -3600
# Node ID 484fb928e36c3150ed66cf102087565ded2769fd
# Parent d7d91b1eb79edf93230713d80ac6ac7738bdd71e
libxc: add comment to why NetBSD return hypercall->retval
Added a comment that explains why NetBSD return hypercall->retval on
success.
Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
diff -r d7d91b1eb79e -r 484fb928e36c tools/libxc/xc_netbsd.c
--- a/tools/libxc/xc_netbsd.c Thu Jan 19 11:17:35 2012 +0100
+++ b/tools/libxc/xc_netbsd.c Thu Jan 19 11:21:10 2012 +0100
@@ -96,6 +96,12 @@ static int netbsd_privcmd_hypercall(xc_i
int fd = (int)h;
int error = ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
+ /*
+ * Since NetBSD ioctl can only return 0 on success or < 0 on
+ * error, if we want to return a value from ioctl we should
+ * do so by setting hypercall->retval, to mimic Linux ioctl
+ * implementation.
+ */
if (error < 0)
return error;
else
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0 of 2] cosmetic fix to libxc for NetBSD
2012-01-19 10:22 [PATCH 0 of 2] cosmetic fix to libxc for NetBSD Roger Pau Monne
2012-01-19 10:23 ` [PATCH 1 of 2] libxc/NetBSD: return ioctl return value on error Roger Pau Monne
2012-01-19 10:23 ` [PATCH 2 of 2] libxc: add comment to why NetBSD return hypercall->retval Roger Pau Monne
@ 2012-01-19 10:27 ` Roger Pau Monné
2012-02-20 17:06 ` Ian Jackson
2 siblings, 1 reply; 5+ messages in thread
From: Roger Pau Monné @ 2012-01-19 10:27 UTC (permalink / raw)
To: xen-devel; +Cc: Olaf Hering
I've forgot to add the Reported-by:... stuff, sorry, could someone add:
Reported-by: "Olaf Hering" <olaf@aepfle.de>
to both patches if they are to be committed to the repository?
Thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0 of 2] cosmetic fix to libxc for NetBSD
2012-01-19 10:27 ` [PATCH 0 of 2] cosmetic fix to libxc for NetBSD Roger Pau Monné
@ 2012-02-20 17:06 ` Ian Jackson
0 siblings, 0 replies; 5+ messages in thread
From: Ian Jackson @ 2012-02-20 17:06 UTC (permalink / raw)
To: Roger Pau Monné; +Cc: Olaf Hering, xen-devel
Roger Pau Monné writes ("Re: [Xen-devel] [PATCH 0 of 2] cosmetic fix to libxc for NetBSD"):
> I've forgot to add the Reported-by:... stuff, sorry, could someone add:
>
> Reported-by: "Olaf Hering" <olaf@aepfle.de>
>
> to both patches if they are to be committed to the repository?
Thanks, I have done that and applied both.
Ian.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-02-20 17:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-19 10:22 [PATCH 0 of 2] cosmetic fix to libxc for NetBSD Roger Pau Monne
2012-01-19 10:23 ` [PATCH 1 of 2] libxc/NetBSD: return ioctl return value on error Roger Pau Monne
2012-01-19 10:23 ` [PATCH 2 of 2] libxc: add comment to why NetBSD return hypercall->retval Roger Pau Monne
2012-01-19 10:27 ` [PATCH 0 of 2] cosmetic fix to libxc for NetBSD Roger Pau Monné
2012-02-20 17:06 ` Ian Jackson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.