Commit Graph

125 Commits

Author SHA1 Message Date
Erik Skultety
a5c1f3b7e0 nodedev: conf: Split PCI sub-capability parsing to separate methods
Since there's at least SRIOV and MDEV sub-capabilities to be parsed,
let's make the code more readable by splitting it to several logical
blocks.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
2017-05-18 12:20:15 +02:00
Erik Skultety
bfaaaf108d conf: nodedev: Split virNodeDeviceDefFormat into more functions
Make the code look cleaner by moving the capability specific bits into
separate functions.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
2017-04-24 12:37:37 +02:00
John Ferlan
84f178bdc7 conf: Add check for non scsi_host parent during vport delete
https://bugzilla.redhat.com/show_bug.cgi?id=1420740

If the parent is not a scsi_host, then we can just happily return since
we won't be removing a vport.

Fixes a bug with the following output:

$ virsh pool-destroy host4_hba_pool
error: Failed to destroy pool host4_hba_pool
error: internal error: Invalid adapter name 'pci_0000_10_00_1' for SCSI pool

$
2017-04-13 10:26:37 -04:00
Pavel Hrdina
ffc810b7c7 src: fix multiple resource leaks in loops
All of the variables are filled inside a loop and therefore
needs to be also freed in every cycle.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-04-11 13:23:00 +02:00
John Ferlan
e3c37aa810 conf: Alter error message for vHBA creation using parent wwnn/wwpn
Commit id 'bb74a7ffe' added a fairly non specific message when providing
only the <parent wwnn='xxx'/> or <parent wwpn='xxx'/> instead of providing
both wwnn and wwpn. This patch just modifies the message to be more specific
about which was missing.
2017-03-15 21:23:18 -04:00
John Ferlan
08c0ea16fc conf: Return the vHBA name from virNodeDeviceCreateVport
Rather than returning true/false and having the caller check if the
vHBA was actually created, let's do that check within the CreateVport
function. That way the caller can faithfully assume success based
on a name start the thread looking for the LUNs. Prior to this change
it's possible that the vHBA wasn't really created (e.g if the call to
virVHBAGetHostByWWN returned NULL), we'd claim success, but in reality
there'd be no vHBA for the pool. This also fixes a second yet seen
issue that if the nodedev was present, but the parent by name wasn't
provided (perhaps parent by wwnn/wwpn or by fabric_name), then a failure
would be returned. For this path it shouldn't be an error - we should
just be happy that something else is managing the device and we don't
have to create/delete it.

The end result is that the createVport code can now just start the
refresh thread once it gets a non NULL name back.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2017-03-15 21:17:47 -04:00
John Ferlan
106930aaa7 conf: Move/Rename createVport and deleteVport
Move the bulk of createVport and rename to virNodeDeviceCreateVport.

Remove the deleteVport entirely and replace with virNodeDeviceDeleteVport

Signed-off-by: John Ferlan <jferlan@redhat.com>
2017-03-15 21:17:47 -04:00
John Ferlan
cbcfd09769 node: Replace variable named 'system' with 'syscap'
Changes in commit id 'dec6d9df' caused a compilation failure on a RHEL6
CI build environment. So just replace 'system' with 'syscap' as a name.

cc1: warnings being treated as errors
../../src/conf/node_device_conf.c: In function 'virNodeDevCapSystemParseXML':
../../src/conf/node_device_conf.c:1415: error: declaration of 'system' shadows a global declaration [-Wshadow]
2017-03-04 10:42:33 -05:00
John Ferlan
dec6d9df5f nodedev: Reduce virNodeDevCapDataPtr usage
Replace with more data specific pointer types.
2017-03-03 18:36:09 -05:00
John Ferlan
29714483a6 conf: Adjust coding style for nodedev conf sources
Alter the format of the code to follow more recent style guidelines of
two empty lines between functions, function decls with "[static] type"
on one line followed by function name with arguments to functions each
on one line.
2017-03-03 18:36:09 -05:00
John Ferlan
bc20200e53 conf: Introduce virnodedeviceobj
Move all the NodeDeviceObj API's into their own module virnodedeviceobj
from the node_device_conf

Purely code motion at this point, plus adjustments to cleanly build.
2017-03-03 18:36:09 -05:00
John Ferlan
ca1f385457 conf: Fix leak in virNodeDeviceDefParseXML
The 'nodes' is overwritten after the first usage and possibly leaked
if any code in the first set of parsing goes to error.

Found by Coverity.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2017-02-27 17:04:33 -05:00
John Ferlan
5ad03b9db2 conf: Fix leak in virNodeDeviceObjListExport
Fix a leak introduced by 4337bc57b when VIR_STRDUP'g the parent.
2017-02-21 10:52:20 -05:00
John Ferlan
f3b1b98121 tests: Add createVHBAByNodeDevice-parent-fabric-wwn to fchosttest
Add a test that allows providing the parent fabric_wwn in the input XML
in order to create the vHBA.

This also fixes a mixed setting of the fabric_wwn field from the read
test driver XML strings.
2017-02-19 06:45:09 -05:00
John Ferlan
7ad479d0bd nodedev: Rework virNodeDeviceGetParentHost
Rework the code to perform the various searches by parent, parent_wwnn/
parent_wwpn, parent_fabric_wwn, or vport capable in order to return the
'parent_host' number that is vHBA capable.

The former virNodeDeviceGetParentHost is renamed to add the ByParent
on it fixes an issue where if no parent was supplied in the XML to
create the vHBA, then virNodeDeviceFindByName was called with a NULL
second parameter which had bad results.

The reworked code will make the various calls to fetch the NPIV host
by the passed parameter options or if none are provided find a vport
capable NPIV HBA to perform the create. If the call is from the delete
path, then this option won't be allowed.

Each of virNodeDeviceGetParentHostBy* functions is now static, so
remove them external definitions.

A secondary benefit of this is the test_driver now can make use of
the new API to add some new tests to test the various creation options.
2017-02-19 06:45:09 -05:00
John Ferlan
aa6aa624ad nodedev: Introduce virNodeDeviceGetParentName
Create a function which takes a node device "name" entry to lookup
and returns a string containing the parent name for the node device.
2017-02-19 06:45:09 -05:00
Roman Bogorodskiy
d3ffa0ece8 nodedev: fix build with clang
Build fails with:

conf/node_device_conf.c:825:62: error: comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-compare]
    if ((data->drm.type = virNodeDevDRMTypeFromString(type)) < 0) {
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
conf/node_device_conf.c:1801:59: error: comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-compare]
        if ((type = virNodeDevDevnodeTypeFromString(tmp)) < 0) {
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
2 errors generated.

Fix by using intermediate variable to store the result similarly
to how it's done for other FromString* calls.
2017-02-18 17:49:27 +04:00
Michal Privoznik
78c018693b nodedev: Introduce new drm cap
After 7f1bdec5fa our nodedev driver is capable of
determining DRM devices (DRM stands for Direct Render Manager not
Digital rights management). There is still one bit missing
though: virConnectListAllNodeDevices() is capable of listing
either all devices or just those with specified capability. Well,
DRM capability is missing there.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2017-02-17 16:09:15 +01:00
Marc-André Lureau
7f1bdec5fa nodedev: add drm capability
Add a new 'drm' capability for Direct Rendering Manager (DRM) devices,
providing device type information.

Teach the udev backend to populate those devices.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2017-02-17 15:47:58 +01:00
Marc-André Lureau
14a3e7ab5c nodedev: parse <path>
This should have been added with c4a4603de (or 0bdefd9b04).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-02-17 15:47:58 +01:00
Marc-André Lureau
0809508ed2 nodedev: add <devnode> paths
Add new <devnode> top-level <device> element, that list the associated
/dev files. Distinguish the main /dev name from symlinks with a 'type'
attribute of value 'dev' or 'symlink'.

Update a test to check XML schema, and actually add it to the test list
since it was missing.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-02-17 15:47:58 +01:00
Marc-André Lureau
7f64435307 nodedev: fix extra space in dump
This is a cosmetic change, shouldn't change XML parsing, and doesn't
break any test.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-02-17 15:47:58 +01:00
John Ferlan
4337bc57be nodedev: Return the parent for a virNodeDevicePtr struct
When the 'parent' was added to the virNodeDevicePtr structure
by commit id 'e8a4ea75a' the 'parent' field was not properly filled
in when a virGetNodeDevice call was made within driver/config code.
Only the device name was ever filled in. Fetching the parent required
a second trip via virNodeDeviceGetParent into the node device lookup
code was required in order to retrieve the specific parent field (and
still the parent field was never filled in although it was free'd).

Since we have the data when we initially call virGetNodeDevice from
within driver/node_config code - let's just fill in the parent field
as well for anyone that wants it without requiring another trip into
the node_device lookup just to get the parent.

This will allow API's such as virConnectListAllNodeDevices,
virNodeDeviceLookupByName, and virNodeDeviceLookupSCSIHostByWWN
to retrieve both name and parent in the returned virNodeDevicePtr.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2017-02-16 12:23:04 -05:00
John Ferlan
2b13361bc7 nodedev: Add the ability to create vHBA by parent wwnn/wwpn or fabric_wwn
https://bugzilla.redhat.com/show_bug.cgi?id=1349696

When creating a vHBA, the process is to feed XML to nodeDeviceCreateXML
that lists the <parent> scsi_hostX to use to create the vHBA. However,
between reboots, it's possible that the <parent> changes its scsi_hostX
to scsi_hostY and saved XML to perform the creation will either fail or
create a vHBA using the wrong parent.

So add the ability to provide "wwnn" and "wwpn" or "fabric_wwn" to
the <parent> instead of a name of the scsi_hostN that is the parent.
The allowed XML will thus be:

  <parent>scsi_host3</parent>  (current)

or

  <parent wwnn='$WWNN' wwpn='$WWPN'/>

or

  <parent fabric_wwn='$WWNN'/>

Using the wwnn/wwpn or fabric_wwn ensures the same 'scsi_hostN' is
selected between hardware reconfigs or host reboots. The fabric_wwn
Using the wwnn/wwpn pair will provide the most specific search option,
while fabric_wwn will at least ensure usage of the same SAN, but maybe
not the same scsi_hostN.

This patch will add the new fields to the nodedev.rng for input purposes
only since the input XML is essentially thrown away, no need to Format
the values since they'd already be printed as part of the scsi_host
data block.

New API virNodeDeviceGetParentHostByWWNs will take the parent "wwnn" and
"wwpn" in order to search the list of devices for matching capability
data fields wwnn and wwpn.

New API virNodeDeviceGetParentHostByFabricWWN will take the parent "fabric_wwn"
in order to search the list of devices for matching capability data field
fabric_wwn.
2017-01-06 17:14:12 -05:00
John Ferlan
8b629a3c01 nodedev: Add ability to find a vport capable vHBA
If a <parent> is not supplied in the XML used to create a non-persistent
vHBA, then instead of failing, let's try to find a "vports" capable node
device and use that.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2017-01-04 17:09:59 -05:00
John Ferlan
8f3054a0f8 nodedev: Create helpers to search for vport capable nodedevs
Extract out code from virNodeDeviceGetParentHost into helpers - it's
going to be reused in upcoming patches to search on more fields

Create virNodeDeviceFindVPORTCapDef in order to return a virNodeDevCapsDefPtr
of the VPORT_OPS and virNodeDeviceFindFCParentHost to use the function and
generate an error message if the device doesn't have the capability.

Also clean up the processing in virNodeDeviceGetParentHost to remove
need for goto's.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2017-01-04 17:09:59 -05:00
Xian Han Yu
f7658da6b3 conf: Fix initialization value of 'multi' in PCI address
The 'multi' element in PCI address struct used as 'virTristateSwitch',
and its default value is 'VIR_TRISTATE_SWITCH_ABSENT'. Current PCI
process use 'false' to initialization 'multi', which is ambiguously
for assignment or comparison. This patch use '{0}' to initialize
the whole PCI address struct, which fix the 'multi' initialization
and makes code more simplify and explicitly.

Signed-off-by: Xian Han Yu <xhyubj@linux.vnet.ibm.com>
2016-09-02 16:43:00 +02:00
Roman Bogorodskiy
6114807477 tests: fix segfault in objecteventtest
Test 12 from objecteventtest (createXML add event) segaults on FreeBSD
with bus error.

At some point it calls testNodeDeviceDestroy() from the test driver. And
it fails when it tries to unlock the device in the "out:" label of this
function.

Unlocking fails because the previous step was a call to
virNodeDeviceObjRemove from conf/node_device_conf.c. This function
removes the given device from the device list and cleans up the object,
including destroying of its mutex. However, it does not nullify the pointer
that was given to it.

As a result, we end up in testNodeDeviceDestroy() here:

 out:
    if (obj)
        virNodeDeviceObjUnlock(obj);

And instead of skipping this, we try to do Unlock and fail because of
malformed mutex.

Change virNodeDeviceObjRemove to use double pointer and set pointer to
NULL.
2016-08-29 13:51:56 +03:00
Andrea Bolognani
54f325e925 conf: nodedev: Set PCI_PHYSICAL_FUNCTION flag more carefully
Instead of setting the flag before parsing the PCI address, set
it afterwards. This ensure we can never end up in a situation
where the flag has been set but pci_dev.physical_function has
not been filled in.
2016-05-25 10:38:01 +02:00
John Ferlan
9d418b20ae conf: Fix error path in virNodeDevPCICapabilityParseXML
If the call to virXPathNodeSet to set naddresses fails, Coverity notes
that the subsequent VIR_ALLOC_N cannot have a negative value (well it
probably wouldn't be negative per se).

Signed-off-by: John Ferlan <jferlan@redhat.com>
2016-05-09 19:33:57 -04:00
Martin Kletzander
541f21afa6 conf: Parse more of our nodedev XML
We were lacking tests that are checking for the completeness of our
nodedev XMLs and also whether we output properly formatted ones.  This
patch adds parsing for the capability elements inside the <capability
type='pci'> element.  Also bunch of tests are added to show everything
works properly.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2016-05-02 15:46:23 +02:00
Martin Kletzander
88c8be67d4 Move capability formatting together
All sub-PCI capabilities should be next to each other for clarity.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2016-05-02 15:46:23 +02:00
Martin Kletzander
c36b1f7b6a Change virDevicePCIAddress to virPCIDeviceAddress
We had both and the only difference was that the latter also included
information about multifunction setting.  The problem with that was that
we couldn't use functions made for only one of the structs (e.g.
parsing).  To consolidate those two structs, use the one in virpci.h,
include that in domain_conf.h and add the multifunction member in it.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2016-05-02 15:46:23 +02:00
Martin Kletzander
17a94ba70f nodedev: Fix parsing of generated XMLs
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>
2016-04-04 14:24:02 +02:00
Bjoern Walk
a243316ac6 conf: node_device: fix up SCSI target
When reading in an XML definition for a SCSI target device, the name
property of struct scsi_target refers to the @target element.

Let's fix this obvious typo and also extend the XML schema to provide
validation.

Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
2016-03-21 12:06:49 -04:00
Martin Kletzander
d77ffb6876 nodedev: Expose PCI header type
If we expose this information, which is one byte in every PCI config
file, we let all mgmt apps know whether the device itself is an endpoint
or not so it's easier for them to decide whether such device can be
passed through into a VM (endpoint) or not (*-bridge).

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1317531

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2016-03-18 17:35:06 +01:00
Martin Kletzander
c1276177f8 nodedev: Shorten match condition
Just a cleanup I stumbled upon in one of my older branches I did when
browsing through some code and forgot to send it.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2016-03-16 10:49:12 +01:00
Laine Stump
0d210c47f9 conf: support reporting maxCount attribute for virtual_functions cap
Report the maximum possible number of VFs for an SRIOV PF, like this:

   <capability type='virtual_functions' maxCount='7'>
      ...
   </capability>

I've just discovered that the virtual_functions and physical_functions
capabilities are not supported in the virNodeDeviceParse functions,
only in virNodeDeviceFormat (I suppose because they are only reported,
not set from XML). This should probably be remedied, but is less
immediately useful than the current patch.
2015-11-24 12:29:31 -05:00
Laine Stump
ffc40b63b5 conf: make virNodeDevCapData an official type
For some reason a union (_virNodeDevCapData) that had only been
declared inside the toplevel struct virNodeDevCapsDef was being used
as an argument to functions all over the place. Since it was only a
union, the "type" attribute wasn't necessarily sent with it. While
this works, it just seems wrong.

This patch creates a toplevel typedef for virNodeDevCapData and
virNodeDevCapDataPtr, making it a struct that has the type attribute
as a member, along with an anonymous union of everything that used to
be in union _virNodeDevCapData. This way we only have to change the
following:

  s/union _virNodeDevCapData */virNodeDevCapDataPtr /

and

  s/caps->type/caps->data.type/

This will make me feel less guilty when adding functions that need a
pointer to one of these.
2015-05-18 10:22:20 -04:00
Pavel Hrdina
d091518b35 XML: escape strings where we should do it
There is a lot of places, were it's pretty easy for user to enter some
characters that we need to escape to create a valid XML description.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1197580

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2015-05-12 12:05:07 +02:00
Ján Tomko
22fd3ac38f Introduce virBitmapIsBitSet
A helper that never returns an error and treats bits out of bitmap range
as false.

Use it everywhere we use ignore_value on virBitmapGetBit, or loop over
the bitmap size.
2015-03-13 15:31:33 +01:00
John Ferlan
d9beeb68e4 conf: Resolve Coverity RESOURCE_LEAK
Commit id 'c9027d8f' added parsing of the CapNet for offload SRIOV NIC
discovery, but forgot to free the nodes
2015-03-11 13:02:07 -04:00
James Chapman
c9027d8f44 SRIOV NIC offload feature discovery
Adding functionality to libvirt that will allow it
query the ethtool interface for the availability
of certain NIC HW offload features

Here is an example of the feature XML definition:

<device>
<name>net_eth4_90_e2_ba_5e_a5_45</name>
  <path>/sys/devices/pci0000:00/0000:00:03.0/0000:08:00.1/net/eth4</path>
  <parent>pci_0000_08_00_1</parent>
  <capability type='net'>
    <interface>eth4</interface>
    <address>90:e2:ba:5e:a5:45</address>
    <link speed='10000' state='up'/>
    <feature name='rx'/>
    <feature name='tx'/>
    <feature name='sg'/>
    <feature name='tso'/>
    <feature name='gso'/>
    <feature name='gro'/>
    <feature name='rxvlan'/>
    <feature name='txvlan'/>
    <feature name='rxhash'/>
    <capability type='80203'/>
  </capability>
</device>

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2015-03-05 11:31:05 +01:00
Shivaprasad G Bhat
e8fcac8ecb nodedev: check/add for scsi_host caps for ListDevices
Commit id '652a2ec6' introduced two new node device capability flags
and the ability to use those flags as a way to search for a specific
subset of a 'scsi_host' device - namely a 'fc_host' and/or 'vports'.
The code modified the virNodeDeviceCapMatch whichs allows for searching
using the 'virsh nodedev-list [cap]' via virConnectListAllNodeDevices.

However, the original patches did not account for other searches for
the same capability key from virNodeListDevices using virNodeDeviceHasCap.
Since 'fc_host' and 'vports' are self defined bits of a 'scsi_host'
device mere string comparison against the basic/root type is not
sufficient.

This patch adds the check for the 'fc_host' and 'vports' bits within
a 'scsi_host' device and allows the following python code to find the
capabilities for the device:

import libvirt
conn = libvirt.openReadOnly('qemu:///system')
fc = conn.listDevices('fc_host', 0)
print(fc)
fc = conn.listDevices('vports', 0)
print(fc)

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
2015-02-05 07:50:24 -05:00
John Ferlan
e3b456de0f Replace virNodeDeviceFree with virObjectUnref
Since virNodeDeviceFree will call virObjectUnref anyway, let's just use that
directly so as to avoid the possibility that we inadvertently clear out
a pending error message when using the public API.
2014-12-02 11:03:40 -05:00
Martin Kletzander
7b9710f818 Remove unnecessary curly brackets in src/conf/
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-11-14 17:13:01 +01:00
Eric Blake
ff78ff7c93 maint: use consistent if-else braces in conf and friends
I'm about to add a syntax check that enforces our documented
HACKING style of always using matching {} on if-else statements.

This patch focuses on code shared between multiple drivers.

* src/conf/domain_conf.c (virDomainFSDefParseXML)
(virSysinfoParseXML, virDomainNetDefParseXML)
(virDomainWatchdogDefParseXML)
(virDomainRedirFilterUSBDevDefParseXML): Correct use of {}.
* src/conf/interface_conf.c (virInterfaceDefParseDhcp)
(virInterfaceDefParseIp, virInterfaceVlanDefFormat)
(virInterfaceDefParseStartMode, virInterfaceDefParseBondMode)
(virInterfaceDefParseBondMiiCarrier)
(virInterfaceDefParseBondArpValid): Likewise.
* src/conf/node_device_conf.c (virNodeDevCapStorageParseXML):
Likewise.
* src/conf/nwfilter_conf.c (virNWFilterRuleDetailsParse)
(virNWFilterRuleParse, virNWFilterDefParseXML): Likewise.
* src/conf/secret_conf.c (secretXMLParseNode): Likewise.
* src/cpu/cpu_x86.c (x86Baseline, x86FeatureLoad, x86ModelLoad):
Likewise.
* src/network/bridge_driver.c (networkKillDaemon)
(networkDnsmasqConfContents): Likewise.
* src/node_device/node_device_hal.c (dev_refresh): Likewise.
* src/nwfilter/nwfilter_gentech_driver.c (virNWFilterInstantiate):
Likewise.
* src/nwfilter/nwfilter_ebiptables_driver.c
(_iptablesCreateRuleInstance): Likewise.
* src/storage/storage_backend_disk.c
(virStorageBackendDiskBuildPool): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-09-04 08:53:21 -06:00
Martin Kletzander
93cf8f9861 cleanup spaces between parentheses and braces
And add a syntax-check for '){$'.  It's not perfect, but better than
nothing.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-08-20 14:50:21 +02:00
Prerna Saxena
8d4740c1b0 Node Devices: Fix nodedev-list for fc_host & vports.
In a system with Fiber Channel Host Adapters, a query to list all Fibre Channel
HBAs OR Vports currently returns empty list:
  $ virsh nodedev-list --cap fc_host

  $

Libvirt correctly discovers properties for all HBAs. However, the reporting
fails because of incorrect flag comparison while filtering these types.

This is fixed by removing references to 'VIR_CONNECT_LIST_NODE_DEVICES_CAP_*'
for comparison and replacing those with 'VIR_NODE_DEV_CAP_*'

Introduced by original commit id '652a2ec6'

Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com>
2014-08-06 07:45:45 -04:00
Chen Hanxiao
71ee25f562 nodedev: fix a uninitialized variable build failure
Fix a -Werror=maybe-uninitialized warning

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-07-28 22:01:59 -06:00