mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
libxl: Rename pci_list_assignable to pci_assignable_list
...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> Committed-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
1 parent
494372a3f2
commit
0773a6e830
7 files changed
+45
-45
No files matched your search
+7
-7
@@ -711,13 +711,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
|
||||
@@ -1050,6 +1043,13 @@ List virtual network interfaces for a domain.
|
||||
|
||||
=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.
|
||||
|
||||
+1
-1
@@ -722,7 +722,7 @@ libxl_device_pci *libxl_device_pci_list(libxl_ctx *ctx, uint32_t domid, int *num
|
||||
* 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);
|
||||
|
||||
@@ -357,7 +357,7 @@ static int sysfs_write_bdf(libxl__gc *gc, const char * sysfs_path,
|
||||
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_ctx *ctx, libxl_device_pci *pcidev)
|
||||
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 &&
|
||||
|
||||
+1
-1
@@ -35,9 +35,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);
|
||||
|
||||
+28
-28
@@ -2291,34 +2291,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;
|
||||
@@ -2440,6 +2412,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);
|
||||
|
||||
@@ -89,8 +89,8 @@ struct cmd_spec cmd_table[] = {
|
||||
"List pass-through pci devices for a domain",
|
||||
"<Domain>",
|
||||
},
|
||||
{ "pci-list-assignable-devices",
|
||||
&main_pcilist_assignable, 0, 0,
|
||||
{ "pci-assignable-list",
|
||||
&main_pciassignable_list, 0, 0,
|
||||
"List all the assignable pci devices",
|
||||
"",
|
||||
},
|
||||
|
||||
@@ -566,13 +566,13 @@ static PyObject *pyxl_pci_parse(XlObject *self, PyObject *args)
|
||||
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 }
|
||||
};
|
||||
|
||||