From: David Vrabel <david.vrabel@citrix.com>
To: xen-devel@lists.xen.org
Cc: Ian Jackson <ian.jackson@eu.citrix.com>,
Keir Fraser <keir@xen.org>,
David Vrabel <david.vrabel@citrix.com>,
Jan Beulich <jbeulich@suse.com>,
Ian Campbell <ian.campbell@citrix.com>
Subject: [PATCH 10/11] libxc: add xc_evtchn_set_limit()
Date: Fri, 13 Sep 2013 17:56:12 +0100 [thread overview]
Message-ID: <1379091373-30293-11-git-send-email-david.vrabel@citrix.com> (raw)
In-Reply-To: <1379091373-30293-1-git-send-email-david.vrabel@citrix.com>
From: David Vrabel <david.vrabel@citrix.com>
Add xc_evtchn_set_limit(), a wrapper around the EVTCHNOP_set_limit
hypercall.
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
---
tools/libxc/xc_evtchn.c | 6 ++++++
tools/libxc/xenctrl.h | 13 +++++++++++++
2 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/tools/libxc/xc_evtchn.c b/tools/libxc/xc_evtchn.c
index 2e0679e..fd9d120 100644
--- a/tools/libxc/xc_evtchn.c
+++ b/tools/libxc/xc_evtchn.c
@@ -78,6 +78,12 @@ int xc_evtchn_status(xc_interface *xch, xc_evtchn_status_t *status)
sizeof(*status), 1);
}
+int xc_evtchn_set_limit(xc_interface *xch, domid_t domid, uint32_t max_port)
+{
+ struct evtchn_set_limit arg = { .domid = domid, max_port = max_port };
+ return do_evtchn_op(xch, EVTCHNOP_set_limit, &arg, sizeof(arg), 0);
+}
+
int xc_evtchn_fd(xc_evtchn *xce)
{
return xce->ops->u.evtchn.fd(xce, xce->ops_handle);
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index f2cebaf..f5b1aa3 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -964,6 +964,19 @@ int xc_evtchn_reset(xc_interface *xch,
typedef struct evtchn_status xc_evtchn_status_t;
int xc_evtchn_status(xc_interface *xch, xc_evtchn_status_t *status);
+/**
+ * Set the maximum port number that a domain may use.
+ *
+ * The toolstack may use this to limit the amount of Xen resources
+ * (xenheap, global mapping pages, etc.) the domain may use for event
+ * channels.
+ *
+ * @parm xch a handle to an open hypervisor interface
+ * @parm domid the ID of the domain
+ * @parm max_port the new maximum port number
+ */
+int xc_evtchn_set_limit(xc_interface *xch, domid_t domid, uint32_t max_port);
+
/*
* Return a handle to the event channel driver, or NULL on failure, in
* which case errno will be set appropriately.
--
1.7.2.5
next prev parent reply other threads:[~2013-09-13 16:56 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-13 16:56 [PATCHv3 0/11] Xen: FIFO-based event channel ABI David Vrabel
2013-09-13 16:56 ` [PATCH 01/11] debug: remove some event channel info from the 'i' and 'q' debug keys David Vrabel
2013-09-13 16:56 ` [PATCH 02/11] evtchn: refactor low-level event channel port ops David Vrabel
2013-09-15 13:06 ` Stefano Stabellini
2013-09-15 13:11 ` Stefano Stabellini
2013-09-16 10:08 ` David Vrabel
2013-09-15 13:20 ` Ian Campbell
2013-09-13 16:56 ` [PATCH 03/11] evtchn: print ABI specific state with the 'e' debug key David Vrabel
2013-09-13 16:56 ` [PATCH 04/11] evtchn: use a per-domain variable for the max number of event channels David Vrabel
2013-09-13 16:56 ` [PATCH 05/11] evtchn: dynamically allocate d->evtchn David Vrabel
2013-09-13 16:56 ` [PATCH 06/11] evtchn: alter internal object handling scheme David Vrabel
2013-09-13 16:56 ` [PATCH 07/11] evtchn: add FIFO-based event channel ABI David Vrabel
2013-09-16 6:59 ` Jan Beulich
2013-09-13 16:56 ` [PATCH 08/11] evtchn: implement EVTCHNOP_set_priority and add the set_priority hook David Vrabel
2013-09-13 16:56 ` [PATCH 09/11] evtchn: implement EVTCHNOP_set_limit David Vrabel
2013-09-13 18:32 ` Daniel De Graaf
2013-09-16 7:07 ` Jan Beulich
2013-09-16 10:00 ` David Vrabel
2013-09-16 10:33 ` Jan Beulich
2013-09-16 10:57 ` David Vrabel
2013-09-13 16:56 ` David Vrabel [this message]
2013-09-13 16:56 ` [PATCH 11/11] evtchn: add FIFO-based event channel hypercalls and port ops David Vrabel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1379091373-30293-11-git-send-email-david.vrabel@citrix.com \
--to=david.vrabel@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=keir@xen.org \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).