Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F136414154
D8551.id22294.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
8 KB
Referenced Files
None
Subscribers
None
D8551.id22294.diff
View Options
Index: sys/boot/common/commands.c
===================================================================
--- sys/boot/common/commands.c
+++ sys/boot/common/commands.c
@@ -497,10 +497,8 @@
pager_open();
for (i = 0; devsw[i] != NULL; i++) {
if (devsw[i]->dv_print != NULL){
- sprintf(line, "%s devices:\n", devsw[i]->dv_name);
- if (pager_output(line))
- break;
- devsw[i]->dv_print(verbose);
+ if (devsw[i]->dv_print(verbose))
+ break;
} else {
sprintf(line, "%s: (unknown)\n", devsw[i]->dv_name);
if (pager_output(line))
Index: sys/boot/common/dev_net.c
===================================================================
--- sys/boot/common/dev_net.c
+++ sys/boot/common/dev_net.c
@@ -332,11 +332,18 @@
int i, d, cnt;
int ret = 0;
+ if (netif_drivers[0] == NULL)
+ return (ret);
+
+ printf("%s devices:", netdev.dv_name);
+ if ((ret = pager_output("\n")) != 0)
+ return (ret);
+
cnt = 0;
for (d = 0; netif_drivers[d]; d++) {
drv = netif_drivers[d];
for (i = 0; i < drv->netif_nifs; i++) {
- printf("\t%s%d:", "net", cnt++);
+ printf("\t%s%d:", netdev.dv_name, cnt++);
if (verbose) {
printf(" (%s%d)", drv->netif_bname,
drv->netif_ifs[i].dif_unit);
Index: sys/boot/common/md.c
===================================================================
--- sys/boot/common/md.c
+++ sys/boot/common/md.c
@@ -63,7 +63,7 @@
static int md_strategy(void *, int, daddr_t, size_t, size_t, char *, size_t *);
static int md_open(struct open_file *, ...);
static int md_close(struct open_file *);
-static void md_print(int);
+static int md_print(int);
struct devsw md_dev = {
"md",
@@ -143,9 +143,14 @@
return ((dev->d_unit != 0) ? ENXIO : 0);
}
-static void
+static int
md_print(int verbose)
{
- printf("MD (%u bytes)\n", MD_IMAGE_SIZE);
+ printf("%s devices:", md_dev.dv_name);
+ if (pager_output("\n") != 0)
+ return (1);
+
+ printf("MD (%u bytes)", MD_IMAGE_SIZE);
+ return (pager_output("\n"));
}
Index: sys/boot/efi/libefi/efinet.c
===================================================================
--- sys/boot/efi/libefi/efinet.c
+++ sys/boot/efi/libefi/efinet.c
@@ -353,6 +353,10 @@
EFI_HANDLE h;
int unit, ret = 0;
+ printf("%s devices:", efinet_dev.dv_name);
+ if ((ret = pager_output("\n")) != 0)
+ return (ret);
+
for (unit = 0, h = efi_find_handle(&efinet_dev, 0);
h != NULL; h = efi_find_handle(&efinet_dev, ++unit)) {
printf(" %s%d:", efinet_dev.dv_name, unit);
Index: sys/boot/efi/libefi/efipart.c
===================================================================
--- sys/boot/efi/libefi/efipart.c
+++ sys/boot/efi/libefi/efipart.c
@@ -172,6 +172,10 @@
u_int unit;
int ret = 0;
+ printf("%s devices:", efipart_dev.dv_name);
+ if ((ret = pager_output("\n")) != 0)
+ return (ret);
+
for (unit = 0, h = efi_find_handle(&efipart_dev, 0);
h != NULL; h = efi_find_handle(&efipart_dev, ++unit)) {
snprintf(line, sizeof(line), " %s%d:",
Index: sys/boot/i386/libfirewire/firewire.c
===================================================================
--- sys/boot/i386/libfirewire/firewire.c
+++ sys/boot/i386/libfirewire/firewire.c
@@ -155,6 +155,10 @@
int i, ret = 0;
struct fwohci_softc *sc;
+ printf("%s devices:", fwohci.dv_name);
+ if ((ret = pager_output("\n")) != 0)
+ return (ret);
+
for (i = 0; i < MAX_OHCI; i ++) {
sc = &fwinfo[i];
if (sc->state == FWOHCI_STATE_DEAD)
Index: sys/boot/i386/libi386/bioscd.c
===================================================================
--- sys/boot/i386/libi386/bioscd.c
+++ sys/boot/i386/libi386/bioscd.c
@@ -183,6 +183,13 @@
char line[80];
int i, ret = 0;
+ if (nbcinfo == 0)
+ return (0);
+
+ printf("%s devices:", bioscd.dv_name);
+ if ((ret = pager_output("\n")) != 0)
+ return (ret);
+
for (i = 0; i < nbcinfo; i++) {
snprintf(line, sizeof(line), " cd%d: Device 0x%x\n", i,
bcinfo[i].bc_sp.sp_devicespec);
Index: sys/boot/i386/libi386/biosdisk.c
===================================================================
--- sys/boot/i386/libi386/biosdisk.c
+++ sys/boot/i386/libi386/biosdisk.c
@@ -328,6 +328,13 @@
struct disk_devdesc dev;
int i, ret = 0;
+ if (nbdinfo == 0)
+ return (0);
+
+ printf("%s devices:", biosdisk.dv_name);
+ if ((ret = pager_output("\n")) != 0)
+ return (ret);
+
for (i = 0; i < nbdinfo; i++) {
snprintf(line, sizeof(line),
" disk%d: BIOS drive %c (%ju X %u):\n", i,
Index: sys/boot/i386/libi386/pxe.c
===================================================================
--- sys/boot/i386/libi386/pxe.c
+++ sys/boot/i386/libi386/pxe.c
@@ -389,6 +389,9 @@
if (pxe_call == NULL)
return (0);
+ printf("%s devices:", pxedisk.dv_name);
+ if (pager_output("\n") != 0)
+ return (1);
if (verbose) {
snprintf(line, sizeof(line), " pxe0: %s:%s\n",
inet_ntoa(rootip), rootpath);
Index: sys/boot/mips/beri/loader/beri_disk_cfi.c
===================================================================
--- sys/boot/mips/beri/loader/beri_disk_cfi.c
+++ sys/boot/mips/beri/loader/beri_disk_cfi.c
@@ -119,6 +119,10 @@
char line[80];
int ret;
+ printf("%s devices:", beri_cfi_disk.dv_name);
+ if ((ret = pager_output("\n")) != 0)
+ return (ret);
+
snprintf(line, sizeof(line), " cfi%d CFI flash device\n", 0);
ret = pager_output(line);
if (ret != 0)
Index: sys/boot/mips/beri/loader/beri_disk_sdcard.c
===================================================================
--- sys/boot/mips/beri/loader/beri_disk_sdcard.c
+++ sys/boot/mips/beri/loader/beri_disk_sdcard.c
@@ -125,6 +125,10 @@
char line[80];
int ret;
+ printf("%s devices:", beri_sdcard_disk.dv_name);
+ if ((ret = pager_output("\n")) != 0)
+ return (ret);
+
snprintf(line, sizeof(line), " sdcard%d Altera SD card drive\n", 0);
ret = pager_output(line);
if (ret != 0)
Index: sys/boot/pc98/libpc98/bioscd.c
===================================================================
--- sys/boot/pc98/libpc98/bioscd.c
+++ sys/boot/pc98/libpc98/bioscd.c
@@ -179,6 +179,13 @@
char line[80];
int i, ret = 0;
+ if (nbcinfo == 0)
+ return (0);
+
+ printf("%s devices:", bioscd.dv_name);
+ if ((ret = pager_output("\n")) != 0)
+ return (ret);
+
for (i = 0; i < nbcinfo; i++) {
sprintf(line, " cd%d: Device 0x%x\n", i,
bcinfo[i].bc_sp.sp_devicespec);
Index: sys/boot/pc98/libpc98/biosdisk.c
===================================================================
--- sys/boot/pc98/libpc98/biosdisk.c
+++ sys/boot/pc98/libpc98/biosdisk.c
@@ -258,6 +258,13 @@
struct open_disk *od;
struct pc98_partition *dptr;
+ if (nbdinfo == 0)
+ return (0);
+
+ printf("%s devices:", biosdisk.dv_name);
+ if ((ret = pager_output("\n")) != 0)
+ return (ret);
+
for (i = 0; i < nbdinfo; i++) {
snprintf(line, sizeof(line), " disk%d: BIOS drive %c:\n",
i, 'A' + i);
Index: sys/boot/uboot/lib/disk.c
===================================================================
--- sys/boot/uboot/lib/disk.c
+++ sys/boot/uboot/lib/disk.c
@@ -245,6 +245,13 @@
static char line[80];
int i, ret = 0;
+ if (stor_info_no == 0)
+ return (ret);
+
+ printf("%s devices:", uboot_storage.dv_name);
+ if ((ret = pager_output("\n")) != 0)
+ return (ret);
+
for (i = 0; i < stor_info_no; i++) {
dev.d_dev = &uboot_storage;
dev.d_unit = i;
Index: sys/boot/usb/storage/umass_loader.c
===================================================================
--- sys/boot/usb/storage/umass_loader.c
+++ sys/boot/usb/storage/umass_loader.c
@@ -175,6 +175,10 @@
{
struct disk_devdesc dev;
+ printf("%s devices:", umass_disk.dv_name);
+ if (pager_output("\n") != 0)
+ return (1);
+
memset(&dev, 0, sizeof(dev));
ret = pager_output(" umass0 UMASS device\n");
Index: sys/boot/userboot/userboot/host.c
===================================================================
--- sys/boot/userboot/userboot/host.c
+++ sys/boot/userboot/userboot/host.c
@@ -139,6 +139,10 @@
{
char line[80];
+ printf("%s devices:", host_dev.dv_name);
+ if (pager_output("\n") != 0)
+ return (1);
+
snprintf(line, sizeof(line), " host%d: Host filesystem\n", 0);
return (pager_output(line));
}
Index: sys/boot/userboot/userboot/userboot_disk.c
===================================================================
--- sys/boot/userboot/userboot/userboot_disk.c
+++ sys/boot/userboot/userboot/userboot_disk.c
@@ -123,6 +123,13 @@
char line[80];
int i, ret = 0;
+ if (userdisk_maxunit == 0)
+ return (0);
+
+ printf("%s devices:", userboot_disk.dv_name);
+ if ((ret = pager_output("\n")) != 0)
+ return (ret);
+
for (i = 0; i < userdisk_maxunit; i++) {
snprintf(line, sizeof(line),
" disk%d: Guest drive image\n", i);
Index: sys/boot/zfs/zfs.c
===================================================================
--- sys/boot/zfs/zfs.c
+++ sys/boot/zfs/zfs.c
@@ -521,6 +521,13 @@
char line[80];
int ret = 0;
+ if (STAILQ_EMPTY(&zfs_pools))
+ return (0);
+
+ printf("%s devices:", zfs_dev.dv_name);
+ if ((ret = pager_output("\n")) != 0)
+ return (ret);
+
if (verbose) {
return (spa_all_status());
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 18, 4:54 PM (18 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25526526
Default Alt Text
D8551.id22294.diff (8 KB)
Attached To
Mode
D8551: lsdev device name section headers should be printed by dv_print callback.
Attached
Detach File
Event Timeline
Log In to Comment