]> git.ipfire.org Git - thirdparty/pciutils.git/commitdiff
Avoid changes of -m format.
authorMartin Mares <mj@ucw.cz>
Tue, 21 Mar 2006 22:49:11 +0000 (22:49 +0000)
committerMartin Mares <mj@ucw.cz>
Fri, 5 May 2006 12:18:35 +0000 (14:18 +0200)
git-archimport-id: mj@ucw.cz--public/pciutils--main--2.2--patch-96

ChangeLog
TODO
lspci.c

index 1a0f10cfe722ff91ffdd0cb03bb20ae816aedf3a..dc1a776f55097f90078c13284518479fa1d18025 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2006-03-21  Martin Mares  <mj@ucw.cz>
 
+       * 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 d213afd7a549fdc359b5e44f48fae89d0262b5e0..0768888b2c3f4b41c806cb092f787abfedf65743 100644 (file)
--- 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 1fc6bfe05f92698db7be8b4ea936f243e6afb25d..8be707c1bd3429ab8128c5d821e81f61318a0313 100644 (file)
--- 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))