diff options
author | grehan <grehan@FreeBSD.org> | 2013-07-01 23:53:22 +0000 |
---|---|---|
committer | grehan <grehan@FreeBSD.org> | 2013-07-01 23:53:22 +0000 |
commit | dcadb4f390cbb39306473ec65ce3b067d52a79f1 (patch) | |
tree | d4309bb08e01062bb520ed36ae70e6e26d951813 /usr.sbin | |
parent | a1ed9ece5b70386033cdc8aceaf924e97434733a (diff) | |
download | FreeBSD-src-dcadb4f390cbb39306473ec65ce3b067d52a79f1.zip FreeBSD-src-dcadb4f390cbb39306473ec65ce3b067d52a79f1.tar.gz |
Fix up option parsing to allow a colon in the config section.
Clean up some other unnecessary code.
Submitted by: Dinakar Medavaram dinnu sun at gmail
Reviewed by: neel
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bhyve/pci_emul.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/usr.sbin/bhyve/pci_emul.c b/usr.sbin/bhyve/pci_emul.c index a30dde5..76e536c 100644 --- a/usr.sbin/bhyve/pci_emul.c +++ b/usr.sbin/bhyve/pci_emul.c @@ -140,20 +140,15 @@ pci_parse_slot(char *opt, int legacy) error = -1; str = cpy = strdup(opt); - config = NULL; - - if (strchr(str, ':') != NULL) { - slot = strsep(&str, ":"); - func = strsep(&str, ","); - } else { - slot = strsep(&str, ","); - func = NULL; - } - + slot = strsep(&str, ","); + func = NULL; + if (strchr(slot, ':') != NULL) { + func = cpy; + (void) strsep(&func, ":"); + } + emul = strsep(&str, ","); - if (str != NULL) { - config = strsep(&str, ","); - } + config = str; if (emul == NULL) { pci_parse_slot_usage(opt); |