From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [PATCH 2 of 4 v2] libxl: Rename pci_list_assignable to pci_assignable_list
Date: Fri, 11 May 2012 14:31:31 +0100 [thread overview]
Message-ID: <aa29f428a005383fed0e.1336743091@kodo2> (raw)
In-Reply-To: <patchbomb.1336743089@kodo2>
...to prepare for a consistent "pci_assignable_*" naming scheme.
Also move the man page entry into the PCI PASS-THROUGH section, rather
than the XEN HOST section.
No functional changes.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
diff -r 6e2d2728620b -r aa29f428a005 docs/man/xl.pod.1
--- a/docs/man/xl.pod.1 Fri May 11 13:50:47 2012 +0100
+++ b/docs/man/xl.pod.1 Fri May 11 13:51:12 2012 +0100
@@ -687,13 +687,6 @@ explanatory.
Prints the current uptime of the domains running.
-=item B<pci-list-assignable-devices>
-
-List all the assignable PCI devices.
-These are devices in the system which are configured to be
-available for passthrough and are bound to a suitable PCI
-backend driver in domain 0 rather than a real driver.
-
=back
=head1 SCHEDULER SUBCOMMANDS
@@ -1026,6 +1019,13 @@ List virtual network interfaces for a do
=over 4
+=item B<pci-assignable-list>
+
+List all the assignable PCI devices.
+These are devices in the system which are configured to be
+available for passthrough and are bound to a suitable PCI
+backend driver in domain 0 rather than a real driver.
+
=item B<pci-attach> I<domain-id> I<BDF>
Hot-plug a new pass-through pci device to the specified domain.
diff -r 6e2d2728620b -r aa29f428a005 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h Fri May 11 13:50:47 2012 +0100
+++ b/tools/libxl/libxl.h Fri May 11 13:51:12 2012 +0100
@@ -662,7 +662,7 @@ libxl_device_pci *libxl_device_pci_list(
* could be assigned to a domain (i.e. are bound to the backend
* driver) but are not currently.
*/
-libxl_device_pci *libxl_device_pci_list_assignable(libxl_ctx *ctx, int *num);
+libxl_device_pci *libxl_device_pci_assignable_list(libxl_ctx *ctx, int *num);
/* CPUID handling */
int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str);
diff -r 6e2d2728620b -r aa29f428a005 tools/libxl/libxl_pci.c
--- a/tools/libxl/libxl_pci.c Fri May 11 13:50:47 2012 +0100
+++ b/tools/libxl/libxl_pci.c Fri May 11 13:51:12 2012 +0100
@@ -357,7 +357,7 @@ static int sysfs_write_bdf(libxl__gc *gc
return 0;
}
-libxl_device_pci *libxl_device_pci_list_assignable(libxl_ctx *ctx, int *num)
+libxl_device_pci *libxl_device_pci_assignable_list(libxl_ctx *ctx, int *num)
{
GC_INIT(ctx);
libxl_device_pci *pcidevs = NULL, *new, *assigned;
@@ -684,7 +684,7 @@ static int libxl_pcidev_assignable(libxl
libxl_device_pci *pcidevs;
int num, i;
- pcidevs = libxl_device_pci_list_assignable(ctx, &num);
+ pcidevs = libxl_device_pci_assignable_list(ctx, &num);
for (i = 0; i < num; i++) {
if (pcidevs[i].domain == pcidev->domain &&
pcidevs[i].bus == pcidev->bus &&
diff -r 6e2d2728620b -r aa29f428a005 tools/libxl/xl.h
--- a/tools/libxl/xl.h Fri May 11 13:50:47 2012 +0100
+++ b/tools/libxl/xl.h Fri May 11 13:51:12 2012 +0100
@@ -34,9 +34,9 @@ int main_cd_insert(int argc, char **argv
int main_console(int argc, char **argv);
int main_vncviewer(int argc, char **argv);
int main_pcilist(int argc, char **argv);
-int main_pcilist_assignable(int argc, char **argv);
int main_pcidetach(int argc, char **argv);
int main_pciattach(int argc, char **argv);
+int main_pciassignable_list(int argc, char **argv);
int main_restore(int argc, char **argv);
int main_migrate_receive(int argc, char **argv);
int main_save(int argc, char **argv);
diff -r 6e2d2728620b -r aa29f428a005 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c Fri May 11 13:50:47 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c Fri May 11 13:51:12 2012 +0100
@@ -2223,34 +2223,6 @@ int main_vncviewer(int argc, char **argv
return 0;
}
-static void pcilist_assignable(void)
-{
- libxl_device_pci *pcidevs;
- int num, i;
-
- pcidevs = libxl_device_pci_list_assignable(ctx, &num);
-
- if ( pcidevs == NULL )
- return;
- for (i = 0; i < num; i++) {
- printf("%04x:%02x:%02x.%01x\n",
- pcidevs[i].domain, pcidevs[i].bus, pcidevs[i].dev, pcidevs[i].func);
- libxl_device_pci_dispose(&pcidevs[i]);
- }
- free(pcidevs);
-}
-
-int main_pcilist_assignable(int argc, char **argv)
-{
- int opt;
-
- if ((opt = def_getopt(argc, argv, "", "pci-list-assignable-devices", 0)) != -1)
- return opt;
-
- pcilist_assignable();
- return 0;
-}
-
static void pcilist(const char *dom)
{
libxl_device_pci *pcidevs;
@@ -2368,6 +2340,34 @@ int main_pciattach(int argc, char **argv
return 0;
}
+static void pciassignable_list(void)
+{
+ libxl_device_pci *pcidevs;
+ int num, i;
+
+ pcidevs = libxl_device_pci_assignable_list(ctx, &num);
+
+ if ( pcidevs == NULL )
+ return;
+ for (i = 0; i < num; i++) {
+ printf("%04x:%02x:%02x.%01x\n",
+ pcidevs[i].domain, pcidevs[i].bus, pcidevs[i].dev, pcidevs[i].func);
+ libxl_device_pci_dispose(&pcidevs[i]);
+ }
+ free(pcidevs);
+}
+
+int main_pciassignable_list(int argc, char **argv)
+{
+ int opt;
+
+ if ((opt = def_getopt(argc, argv, "", "pci-assignable-list", 0)) != -1)
+ return opt;
+
+ pciassignable_list();
+ return 0;
+}
+
static void pause_domain(const char *p)
{
find_domain(p);
diff -r 6e2d2728620b -r aa29f428a005 tools/libxl/xl_cmdtable.c
--- a/tools/libxl/xl_cmdtable.c Fri May 11 13:50:47 2012 +0100
+++ b/tools/libxl/xl_cmdtable.c Fri May 11 13:51:12 2012 +0100
@@ -86,8 +86,8 @@ struct cmd_spec cmd_table[] = {
"List pass-through pci devices for a domain",
"<Domain>",
},
- { "pci-list-assignable-devices",
- &main_pcilist_assignable, 0,
+ { "pci-assignable-list",
+ &main_pciassignable_list, 0,
"List all the assignable pci devices",
"",
},
diff -r 6e2d2728620b -r aa29f428a005 tools/python/xen/lowlevel/xl/xl.c
--- a/tools/python/xen/lowlevel/xl/xl.c Fri May 11 13:50:47 2012 +0100
+++ b/tools/python/xen/lowlevel/xl/xl.c Fri May 11 13:51:12 2012 +0100
@@ -566,13 +566,13 @@ static PyObject *pyxl_pci_parse(XlObject
return (PyObject *)pci;
}
-static PyObject *pyxl_pci_list_assignable(XlObject *self, PyObject *args)
+static PyObject *pyxl_pci_assignable_list(XlObject *self, PyObject *args)
{
libxl_device_pci *dev;
PyObject *list;
int nr_dev, i;
- dev = libxl_device_pci_list_assignable(self->ctx, &nr_dev);
+ dev = libxl_device_pci_assignable_list(self->ctx, &nr_dev);
if ( dev == NULL ) {
PyErr_SetString(xl_error_obj, "Cannot list assignable devices");
return NULL;
@@ -662,8 +662,8 @@ static PyMethodDef pyxl_methods[] = {
"Parse pass-through PCI device spec (BDF)"},
{"device_pci_list", (PyCFunction)pyxl_pci_list, METH_VARARGS,
"List PCI devices assigned to a domain"},
- {"device_pci_list_assignable",
- (PyCFunction)pyxl_pci_list_assignable, METH_NOARGS,
+ {"device_pci_assignable_list",
+ (PyCFunction)pyxl_pci_assignable_list, METH_NOARGS,
"List assignable PCI devices"},
{ NULL, NULL, 0, NULL }
};
next prev parent reply other threads:[~2012-05-11 13:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-11 13:31 [PATCH 0 of 4 v2] Add commands to automatically prep devices for pass-through George Dunlap
2012-05-11 13:31 ` [PATCH 1 of 4 v2] libxl: Make a helper function write a BDF to a sysfs path George Dunlap
2012-05-11 13:31 ` George Dunlap [this message]
2012-05-11 13:31 ` [PATCH 3 of 4 v2] libxl: Introduce pci_assignable_add and pci_assignable_remove George Dunlap
2012-05-14 9:21 ` Ian Campbell
2012-05-14 10:06 ` George Dunlap
2012-05-21 14:13 ` Konrad Rzeszutek Wilk
2012-05-22 8:15 ` Ian Campbell
2012-05-11 13:31 ` [PATCH 4 of 4 v2] xl: Add pci_assignable_add and remove commands George Dunlap
2012-05-14 9:24 ` Ian Campbell
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=aa29f428a005383fed0e.1336743091@kodo2 \
--to=george.dunlap@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/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).