All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libxc: NetBSD: implement xc_evtchn_bind_unbound_port
@ 2010-12-02 12:37 Ian Campbell
  2010-12-02 13:54 ` Christoph Egger
  2010-12-13 16:43 ` Stefano Stabellini
  0 siblings, 2 replies; 3+ messages in thread
From: Ian Campbell @ 2010-12-02 12:37 UTC (permalink / raw)
  To: xen-devel; +Cc: Christoph Egger

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1291293181 0
# Node ID 9c0c5aa7b9fec2740fe3647d89d2a1437ffeddd8
# Parent  55acbaeab0badc9cded7c1b56af79e45d0f78929
libxc: NetBSD: implement xc_evtchn_bind_unbound_port.

Doesn't actually appear to be used anywhere but is defined for other
OSes.

The NetBSD evtchn.h contains comments "Return allocated port" for
several ioctls which currently return the allocated port as a member
of the argument structure and not as the ioctl return value (I think
this is a cut and paste error).

I have assumed that this ioctl follows the same pattern as the
existing NetBSD ioctls and removed the misleading comments.

Not even compile tested.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r 55acbaeab0ba -r 9c0c5aa7b9fe tools/include/xen-sys/NetBSD/evtchn.h
--- a/tools/include/xen-sys/NetBSD/evtchn.h	Thu Dec 02 12:33:01 2010 +0000
+++ b/tools/include/xen-sys/NetBSD/evtchn.h	Thu Dec 02 12:33:01 2010 +0000
@@ -33,7 +33,6 @@
 
 /*
  * Bind a fresh port to VIRQ @virq.
- * Return allocated port.
  */
 #define IOCTL_EVTCHN_BIND_VIRQ				\
 	_IOWR('E', 4, struct ioctl_evtchn_bind_virq)
@@ -44,7 +43,6 @@ struct ioctl_evtchn_bind_virq {
 
 /*
  * Bind a fresh port to remote <@remote_domain, @remote_port>.
- * Return allocated port.
  */
 #define IOCTL_EVTCHN_BIND_INTERDOMAIN			\
 	_IOWR('E', 5, struct ioctl_evtchn_bind_interdomain)
@@ -55,7 +53,6 @@ struct ioctl_evtchn_bind_interdomain {
 
 /*
  * Allocate a fresh port for binding to @remote_domain.
- * Return allocated port.
  */
 #define IOCTL_EVTCHN_BIND_UNBOUND_PORT			\
 	_IOWR('E', 6, struct ioctl_evtchn_bind_unbound_port)
diff -r 55acbaeab0ba -r 9c0c5aa7b9fe tools/libxc/xc_netbsd.c
--- a/tools/libxc/xc_netbsd.c	Thu Dec 02 12:33:01 2010 +0000
+++ b/tools/libxc/xc_netbsd.c	Thu Dec 02 12:33:01 2010 +0000
@@ -206,6 +206,21 @@ int xc_evtchn_notify(int xce_handle, evt
 }
 
 evtchn_port_or_error_t
+xc_evtchn_bind_unbound_port(int xce_handle, int domid)
+{
+    struct ioctl_evtchn_bind_unbound_port bind;
+    int ret;
+
+    bind.remote_domain = domid;
+
+    ret = ioctl(xce_handle, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
+    if (ret == 0)
+	return bind.port;
+    else
+	return -1;
+}
+
+evtchn_port_or_error_t
 xc_evtchn_bind_interdomain(int xce_handle, int domid,
                            evtchn_port_t remote_port)
 {

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] libxc: NetBSD: implement xc_evtchn_bind_unbound_port
  2010-12-02 12:37 [PATCH] libxc: NetBSD: implement xc_evtchn_bind_unbound_port Ian Campbell
@ 2010-12-02 13:54 ` Christoph Egger
  2010-12-13 16:43 ` Stefano Stabellini
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Egger @ 2010-12-02 13:54 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel@lists.xensource.com


Works for me. Thanks for doing this.

Acked-by: Christoph Egger <Christoph.Egger@amd.com>

On Thursday 02 December 2010 13:37:12 Ian Campbell wrote:
> # HG changeset patch
> # User Ian Campbell <ian.campbell@citrix.com>
> # Date 1291293181 0
> # Node ID 9c0c5aa7b9fec2740fe3647d89d2a1437ffeddd8
> # Parent  55acbaeab0badc9cded7c1b56af79e45d0f78929
> libxc: NetBSD: implement xc_evtchn_bind_unbound_port.
>
> Doesn't actually appear to be used anywhere but is defined for other
> OSes.
>
> The NetBSD evtchn.h contains comments "Return allocated port" for
> several ioctls which currently return the allocated port as a member
> of the argument structure and not as the ioctl return value (I think
> this is a cut and paste error).
>
> I have assumed that this ioctl follows the same pattern as the
> existing NetBSD ioctls and removed the misleading comments.
>
> Not even compile tested.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>
> diff -r 55acbaeab0ba -r 9c0c5aa7b9fe tools/include/xen-sys/NetBSD/evtchn.h
> --- a/tools/include/xen-sys/NetBSD/evtchn.h	Thu Dec 02 12:33:01 2010 +0000
> +++ b/tools/include/xen-sys/NetBSD/evtchn.h	Thu Dec 02 12:33:01 2010 +0000
> @@ -33,7 +33,6 @@
>
>  /*
>   * Bind a fresh port to VIRQ @virq.
> - * Return allocated port.
>   */
>  #define IOCTL_EVTCHN_BIND_VIRQ				\
>  	_IOWR('E', 4, struct ioctl_evtchn_bind_virq)
> @@ -44,7 +43,6 @@ struct ioctl_evtchn_bind_virq {
>
>  /*
>   * Bind a fresh port to remote <@remote_domain, @remote_port>.
> - * Return allocated port.
>   */
>  #define IOCTL_EVTCHN_BIND_INTERDOMAIN			\
>  	_IOWR('E', 5, struct ioctl_evtchn_bind_interdomain)
> @@ -55,7 +53,6 @@ struct ioctl_evtchn_bind_interdomain {
>
>  /*
>   * Allocate a fresh port for binding to @remote_domain.
> - * Return allocated port.
>   */
>  #define IOCTL_EVTCHN_BIND_UNBOUND_PORT			\
>  	_IOWR('E', 6, struct ioctl_evtchn_bind_unbound_port)
> diff -r 55acbaeab0ba -r 9c0c5aa7b9fe tools/libxc/xc_netbsd.c
> --- a/tools/libxc/xc_netbsd.c	Thu Dec 02 12:33:01 2010 +0000
> +++ b/tools/libxc/xc_netbsd.c	Thu Dec 02 12:33:01 2010 +0000
> @@ -206,6 +206,21 @@ int xc_evtchn_notify(int xce_handle, evt
>  }
>
>  evtchn_port_or_error_t
> +xc_evtchn_bind_unbound_port(int xce_handle, int domid)
> +{
> +    struct ioctl_evtchn_bind_unbound_port bind;
> +    int ret;
> +
> +    bind.remote_domain = domid;
> +
> +    ret = ioctl(xce_handle, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
> +    if (ret == 0)
> +	return bind.port;
> +    else
> +	return -1;
> +}
> +
> +evtchn_port_or_error_t
>  xc_evtchn_bind_interdomain(int xce_handle, int domid,
>                             evtchn_port_t remote_port)
>  {



-- 
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] libxc: NetBSD: implement xc_evtchn_bind_unbound_port
  2010-12-02 12:37 [PATCH] libxc: NetBSD: implement xc_evtchn_bind_unbound_port Ian Campbell
  2010-12-02 13:54 ` Christoph Egger
@ 2010-12-13 16:43 ` Stefano Stabellini
  1 sibling, 0 replies; 3+ messages in thread
From: Stefano Stabellini @ 2010-12-13 16:43 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Egger, xen-devel@lists.xensource.com

On Thu, 2 Dec 2010, Ian Campbell wrote:
> # HG changeset patch
> # User Ian Campbell <ian.campbell@citrix.com>
> # Date 1291293181 0
> # Node ID 9c0c5aa7b9fec2740fe3647d89d2a1437ffeddd8
> # Parent  55acbaeab0badc9cded7c1b56af79e45d0f78929
> libxc: NetBSD: implement xc_evtchn_bind_unbound_port.
> 
> Doesn't actually appear to be used anywhere but is defined for other
> OSes.
> 
> The NetBSD evtchn.h contains comments "Return allocated port" for
> several ioctls which currently return the allocated port as a member
> of the argument structure and not as the ioctl return value (I think
> this is a cut and paste error).
> 
> I have assumed that this ioctl follows the same pattern as the
> existing NetBSD ioctls and removed the misleading comments.
> 
> Not even compile tested.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> 

applied, thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-12-13 16:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-02 12:37 [PATCH] libxc: NetBSD: implement xc_evtchn_bind_unbound_port Ian Campbell
2010-12-02 13:54 ` Christoph Egger
2010-12-13 16:43 ` Stefano Stabellini

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.