]> xenbits.xensource.com Git - libvirt.git/commitdiff
nodedev: Fix parsing of generated XMLs
authorMartin Kletzander <mkletzan@redhat.com>
Sun, 3 Apr 2016 17:55:54 +0000 (19:55 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Mon, 4 Apr 2016 12:24:02 +0000 (14:24 +0200)
Commit d77ffb6876 added not only reporting of the PCI header type, but
also parsing of that information.  However, because there was no parsing
done for the other sub-PCI capabilities, if there was any other
capability then a valid header type name (like phys_function or
virt_functions) the parsing would fail.  This prevented passing node
device XMLs that we generated into our own functions when dealing with,
e.g. with SRIOV cards.

Instead of reworking the whole parsing, just fix this one occurence and
remove a test for it for the time being.  Future patches will deal with
the rest.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/conf/node_device_conf.c
tests/nodedevxml2xmltest.c

index f74b34de5cd2a8410f3fae1b3bfdd5c1c9d89aab..a76f785eddc0fee866f6023d2ae3fdb4dd07a056 100644 (file)
@@ -1336,18 +1336,6 @@ virNodeDevCapPCIDevParseXML(xmlXPathContextPtr ctxt,
                                           _("invalid NUMA node ID supplied for '%s'")) < 0)
         goto out;
 
-    if ((tmp = virXPathString("string(./capability[1]/@type)", ctxt))) {
-        int hdrType = virPCIHeaderTypeFromString(tmp);
-
-        if (hdrType <= 0) {
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("Unknown PCI header type '%s'"), tmp);
-            goto out;
-        }
-
-        data->pci_dev.hdrType = hdrType;
-    }
-
     if ((pciExpress = virXPathNode("./pci-express[1]", ctxt))) {
         if (VIR_ALLOC(pci_express) < 0)
             goto out;
index 246cec71017850163d6c0d4c58fcc46bff311a6b..96041f50b9cd3025ea648ca280c6854649704c73 100644 (file)
@@ -91,8 +91,6 @@ mymain(void)
     DO_TEST("usb_device_1d6b_1_0000_00_1d_0");
     DO_TEST("pci_8086_4238_pcie_wireless");
     DO_TEST("pci_8086_0c0c_snd_hda_intel");
-    DO_TEST("pci_0000_00_02_0_header_type");
-    DO_TEST("pci_0000_00_1c_0_header_type");
     DO_TEST("scsi_target0_0_0");
 
     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;