Skip to content

Commit

Permalink
Merge branch 'master' into stlouis
Browse files Browse the repository at this point in the history
commit 82079de
    16583 Want ability to use libtermcap to filter over libcurses(3xcurses)
commit 12b7c4c
    13967 diskinfo(8) should show serial numbers in more cases
commit 4c827c3
    16589 zfs: avoid kfpu use when panicking
  • Loading branch information
citrus-it committed Jun 4, 2024
2 parents aac137e + 4c827c3 commit e5ec805
Show file tree
Hide file tree
Showing 10 changed files with 563 additions and 439 deletions.
7 changes: 6 additions & 1 deletion usr/src/cmd/diskinfo/diskinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* Copyright 2021 RackTop Systems, Inc.
* Copyright 2021 Tintri by DDN, Inc. All rights reserved.
* Copyright 2023 Oxide Computer Company
* Copyright 2024 Sebastian Wiedenroth
*/

#include <sys/types.h>
Expand Down Expand Up @@ -279,7 +280,7 @@ enumerate_disks(di_opts_t *opts)
for (i = 0; media != NULL && media[i] != 0; i++) {
dm_descriptor_t *disk, *controller;
nvlist_t *mattrs, *dattrs;
char *vid, *pid, *opath, *ctype, *pctype, *c;
char *vid, *pid, *serial, *opath, *ctype, *pctype, *c;
boolean_t removable, ssd;
char device[MAXPATHLEN];
di_phys_t phys;
Expand Down Expand Up @@ -318,6 +319,7 @@ enumerate_disks(di_opts_t *opts)
nvlist_query_string(dattrs, DM_VENDOR_ID, &vid);
nvlist_query_string(dattrs, DM_PRODUCT_ID, &pid);
nvlist_query_string(dattrs, DM_OPATH, &opath);
nvlist_query_string(dattrs, DM_SERIAL, &serial);

if (nvlist_lookup_boolean(dattrs, DM_REMOVABLE) == 0)
removable = B_TRUE;
Expand Down Expand Up @@ -383,6 +385,9 @@ enumerate_disks(di_opts_t *opts)
slotname[1] = '\0';
}
}
if (phys.dp_serial == NULL) {
phys.dp_serial = serial;
}

/*
* The size is given in blocks, so multiply the number
Expand Down
7 changes: 6 additions & 1 deletion usr/src/lib/libdiskmgt/common/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
* Use is subject to license terms.
*/

/*
* Copyright 2024 Sebastian Wiedenroth
*/

#include <fcntl.h>
#include <libdevinfo.h>
#include <stdio.h>
Expand Down Expand Up @@ -262,6 +266,7 @@ cache_free_disk(disk_t *dp)
free(dp->product_id);
free(dp->vendor_id);
free(dp->controllers);
free(dp->serial);
/* the path objects are freed when we free the controller */
free(dp->paths);
ap = dp->aliases;
Expand Down Expand Up @@ -904,7 +909,7 @@ rewalk_tree()
*/
static void
update_desc(descriptor_t *descp, disk_t *newdisksp, controller_t *newctrlp,
bus_t *newbusp)
bus_t *newbusp)
{
/* if the descriptor is already dead, we're done */
if (descp->p.generic == NULL) {
Expand Down
2 changes: 2 additions & 0 deletions usr/src/lib/libdiskmgt/common/disks_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

/*
* Copyright 2017 Nexenta Systems, Inc.
* Copyright 2024 Sebastian Wiedenroth
*/

#ifndef _DISKS_PRIVATE_H
Expand Down Expand Up @@ -112,6 +113,7 @@ typedef struct disk {
int wide;
int cd_rom;
int solid_state;
char *serial;
} disk_t;

typedef struct descriptor {
Expand Down
Loading

0 comments on commit e5ec805

Please sign in to comment.