FreeBSD Bugzilla – Attachment 171166 Details for
Bug 210111
[bhyve][patch] print list of supported PCI and LPC devices
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch, v1
bhyve_supported_devices.diff (text/plain), 2.65 KB, created by
Roman Bogorodskiy
on 2016-06-07 17:36:59 UTC
(
hide
)
Description:
proposed patch, v1
Filename:
MIME Type:
Creator:
Roman Bogorodskiy
Created:
2016-06-07 17:36:59 UTC
Size:
2.65 KB
patch
obsolete
>diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c >index bfa135b..64724f6 100644 >--- a/usr.sbin/bhyve/bhyverun.c >+++ b/usr.sbin/bhyve/bhyverun.c >@@ -803,13 +803,19 @@ main(int argc, char *argv[]) > gdb_port = atoi(optarg); > break; > case 'l': >- if (lpc_device_parse(optarg) != 0) { >+ if (strncmp(optarg, "help", strlen(optarg)) == 0) { >+ lpc_print_supported_devices(); >+ exit(0); >+ } else if (lpc_device_parse(optarg) != 0) { > errx(EX_USAGE, "invalid lpc device " > "configuration '%s'", optarg); > } > break; > case 's': >- if (pci_parse_slot(optarg) != 0) >+ if (strncmp(optarg, "help", strlen(optarg)) == 0) { >+ pci_print_supported_devices(); >+ exit(0); >+ } else if (pci_parse_slot(optarg) != 0) > exit(1); > else > break; >diff --git a/usr.sbin/bhyve/pci_emul.c b/usr.sbin/bhyve/pci_emul.c >index 523d7b0..d3eac97 100644 >--- a/usr.sbin/bhyve/pci_emul.c >+++ b/usr.sbin/bhyve/pci_emul.c >@@ -235,6 +235,17 @@ done: > return (error); > } > >+void >+pci_print_supported_devices() >+{ >+ struct pci_devemu **pdpp, *pdp; >+ >+ SET_FOREACH(pdpp, pci_devemu_set) { >+ pdp = *pdpp; >+ printf("%s\n", pdp->pe_emu); >+ } >+} >+ > static int > pci_valid_pba_offset(struct pci_devinst *pi, uint64_t offset) > { >diff --git a/usr.sbin/bhyve/pci_emul.h b/usr.sbin/bhyve/pci_emul.h >index d6e5490..b0b8f4a 100644 >--- a/usr.sbin/bhyve/pci_emul.h >+++ b/usr.sbin/bhyve/pci_emul.h >@@ -229,6 +229,7 @@ int pci_msix_table_bar(struct pci_devinst *pi); > int pci_msix_pba_bar(struct pci_devinst *pi); > int pci_msi_msgnum(struct pci_devinst *pi); > int pci_parse_slot(char *opt); >+void pci_print_supported_devices(); > void pci_populate_msicap(struct msicap *cap, int msgs, int nextptr); > int pci_emul_add_msixcap(struct pci_devinst *pi, int msgnum, int barnum); > int pci_emul_msix_twrite(struct pci_devinst *pi, uint64_t offset, int size, >diff --git a/usr.sbin/bhyve/pci_lpc.c b/usr.sbin/bhyve/pci_lpc.c >index 2203a00..52ab531 100644 >--- a/usr.sbin/bhyve/pci_lpc.c >+++ b/usr.sbin/bhyve/pci_lpc.c >@@ -112,6 +112,16 @@ done: > return (error); > } > >+void >+lpc_print_supported_devices() >+{ >+ size_t i; >+ >+ printf("bootrom\n"); >+ for (i = 0; i < LPC_UART_NUM; i++) >+ printf("%s\n", lpc_uart_names[i]); >+} >+ > const char * > lpc_bootrom(void) > { >diff --git a/usr.sbin/bhyve/pci_lpc.h b/usr.sbin/bhyve/pci_lpc.h >index 431f5cf..17107c6 100644 >--- a/usr.sbin/bhyve/pci_lpc.h >+++ b/usr.sbin/bhyve/pci_lpc.h >@@ -66,6 +66,7 @@ struct lpc_sysres { > #define SYSRES_MEM(base, length) LPC_SYSRES(LPC_SYSRES_MEM, base, length) > > int lpc_device_parse(const char *opt); >+void lpc_print_supported_devices(); > char *lpc_pirq_name(int pin); > void lpc_pirq_routed(void); > const char *lpc_bootrom(void);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 210111
: 171166