From: Martin Mares Date: Tue, 21 Mar 2006 22:49:11 +0000 (+0000) Subject: Avoid changes of -m format. X-Git-Tag: v3.0.0~69 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=2a124dae552ef78ab53d749c69bc25051a560941;p=pciutils.git Avoid changes of -m format. git-archimport-id: mj@ucw.cz--public/pciutils--main--2.2--patch-96 --- diff --git a/ChangeLog b/ChangeLog index 1a0f10c..dc1a776 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-03-21 Martin Mares + * lspci.c (show_slot_name): Avoid the previous changes in default + display of domain name when in machine-readable mode. However, `-D' + forces domain display even there. + * lspci.man: Added a warning on -m being the only format, which is guaranteed to be stable between lspci versions. diff --git a/TODO b/TODO index d213afd..0768888 100644 --- a/TODO +++ b/TODO @@ -2,8 +2,8 @@ - finish PCI-X 2.0 capabilities - finish PCI Express support - reading of VPD -- change machine-readable output? - class 0805? +- document syntax of machine-readable output PCIIDS: - another mirror at Atrey? diff --git a/lspci.c b/lspci.c index 1fc6bfe..8be707c 100644 --- a/lspci.c +++ b/lspci.c @@ -23,7 +23,7 @@ static struct pci_filter filter; /* Device filter */ static int show_tree; /* Show bus tree */ static int machine_readable; /* Generate machine-readable output */ static int map_mode; /* Bus mapping mode enabled */ -static int show_domains; /* Show domain numbers */ +static int show_domains; /* Show domain numbers (0=disabled, 1=auto-detected, 2=requested) */ static char options[] = "nvbxs:d:ti:mgMD" GENERIC_OPTIONS ; @@ -243,7 +243,7 @@ show_slot_name(struct device *d) { struct pci_dev *p = d->dev; - if (show_domains) + if (!machine_readable ? show_domains : (p->domain || show_domains >= 2)) printf("%04x:", p->domain); printf("%02x:%02x.%d", p->bus, p->dev, p->func); } @@ -2322,7 +2322,7 @@ main(int argc, char **argv) map_mode++; break; case 'D': - show_domains = 1; + show_domains = 2; break; default: if (parse_generic_option(i, pacc, optarg))