Skip to content

Commit

Permalink
BHYVE: OS-7238 bhyve zones should add hostbridge device
Browse files Browse the repository at this point in the history
Reviewed by: Mike Gerdts <mike.gerdts@joyent.com>
Reviewed by: Jorge Schrauwen <jorge@blackdot.be>
Reviewed by: Hans Rosenfeld <hans.rosenfeld@joyent.com>
Approved by: Hans Rosenfeld <hans.rosenfeld@joyent.com>
  • Loading branch information
pfmooney authored and citrus-it committed Oct 18, 2018
1 parent 68961db commit 6a7e0d6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions usr/src/cmd/bhyve/pci_hostbridge.c
Expand Up @@ -85,14 +85,15 @@ static int
pci_hostbridge_parse_pci_val(const char *in, uint16_t *val)
{
long num;
char *endp = NULL;

errno = 0;
num = strtol(in, NULL, 0);
if (errno != 0) {
num = strtol(in, &endp, 0);
if (errno != 0 || endp == NULL || *endp != '\0') {
fprintf(stderr, "pci_hostbridge: invalid num '%s'", in);
return (-1);
} else if (num < 1 || num > UINT16_MAX) {
fprintf(stderr, "pci_hostbridge: %04x out of range", num);
fprintf(stderr, "pci_hostbridge: 0x%04lx out of range", num);
return (-1);
}
*val = num;
Expand Down

0 comments on commit 6a7e0d6

Please sign in to comment.