- 07 2月, 2016 1 次提交
-
-
由 Roman Bogorodskiy 提交于
Add a stub for nodeDeviceSysfsGetPCIRelatedDevCaps() for non-Linux platforms. It allows nodedev driver to work on non-Linux platoforms that, however, have HAL.
-
- 25 11月, 2015 1 次提交
-
-
由 Laine Stump 提交于
A PCI device may have the capability to setup virtual functions (VFs) but have them currently all disabled. Prior to this patch, if that was the case the the node device XML for the device wouldn't report any virtual_functions capability. With this patch, if a file called "sriov_totalvfs" is found in the device's sysfs directory, its contents will be interpreted as a decimal number, and that value will be reported as "maxCount" in a capability element of the device's XML, e.g.: <capability type='virtual_functions' maxCount='7'/> This will be reported regardless of whether or not any VFs are currently enabled for the device. NB: sriov_numvfs (the number of VFs currently active) is also available in sysfs, but that value is implied by the number of items in the list that is inside the capability element, so there is no reason to explicitly provide it as an attribute. sriov_totalvfs and sriov_numvfs are available in kernels at least as far back as the 2.6.32 that is in RHEL6.7, but in the case that they simply aren't there, libvirt will behave as it did prior to this patch - no maxCount will be displayed, and the virtual_functions capability will be absent from the device's XML when 0 VFs are enabled.
-
- 18 6月, 2015 1 次提交
-
-
由 Laine Stump 提交于
As with several other attributes of devices (link status, sriov VF list, IOMMU group list), the detdev feature bits aren't automatically updated in the nodedev driver's cache when they change. In order to get a properly up-to-date list when getting the XML of a device, we must reget them in update-caps prior to each dumpxml. This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1232880
-
- 29 5月, 2015 1 次提交
-
-
由 Laine Stump 提交于
In a couple of cases, the node device driver (and the test node device driver which likely copied it) was only logging "Node device not found" when it couldn't find the requested device. This patch changes those cases to log the name (and in the case when it's relevant, the wwnn and wwpn) as well.
-
- 22 5月, 2015 1 次提交
-
-
由 Maxim Nestratov 提交于
commit ffc40b63 changed uniond _virNodeDevCapData into a typedef named virNodeDevCapData with a struct that contains the union as well as a type enum. This change necessitated changing every reference to "caps->type" into "caps->data.type", but the author of that patch failed to test a build "WITH_HAL". This patch fixes the one place in the hal backend that needed changing.
-
- 18 5月, 2015 6 次提交
-
-
由 Laine Stump 提交于
Both the hal and udev drivers call virPCI*() functions to the the SRIOV VF/PF info about PCI devices, and the UDEV backend calls virPCI*() to get IOMMU group info. Since there is now a single function call in node_device_linux_sysfs.c to do all of this, replace all that code in the two backends with calls to nodeDeviceSysfsGetPCIRelatedDevCaps(). Note that this results in the HAL driver (probably) unnecessarily calling virPCIDevieAddressGetIOMMUGroupNum(), but in the case that the host doesn't support IOMMU groups, that function turns into a NOP (it returns -2, which causes the caller to skip the call to virPCIDeviceAddressGetIOMMUGroupAddresses()). So in the worst case it is a few extra cycles spent, and in the best case a mythical platform that supported IOMMU groups but used HAL rather than UDEV would gain proper reporting of IOMMU group info.
-
由 Laine Stump 提交于
Because reloading a PF driver with a different number of VFs doesn't result in any sort of event sent from udev to the libvirt node_device driver, libvirt's cache of that info can be out of date when a request arrives for the info about a device. To fix this, we refresh that data at the time of the dumpxml request, similar to what is already done for netdev link info and SCSI host capabilities. Since the same is true for iommu group information (for example, some other device in the same iommu group could have been detached from the host), we also create a function to update the iommu group info from sysfs, and a common function that does both. (a later patch will call this common function from the udev and hal backends). This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=981546
-
由 Laine Stump 提交于
The udev and hal drivers both already call the same functions as these new functions added to node_device_linux_sysfs.c, but 1) we need to call them from node_device_driver.c, and 2) it would be nice to eliminate the duplicated code from the hal and udev backends.
-
由 Laine Stump 提交于
This file contains only a single function, detect_scsi_host_caps(), which is declared in node_device_driver.h and called from both the hal and udev backends. Other things common to the hal and udev drivers can be placed in that file though. As a prelude to adding further functions, this patch renames the existing function to something closer in line with other internal libvirt function names (nodeDeviceSysfsGetSCSIHostCaps()), and puts the declarations into a separate .h file.
-
由 Laine Stump 提交于
Makes it nicer as update bits are added for different cap types.
-
由 Laine Stump 提交于
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.
-
- 16 4月, 2015 1 次提交
-
-
由 Ján Tomko 提交于
Including them in the XML makes them unparsable. https://bugzilla.redhat.com/show_bug.cgi?id=1184131
-
- 15 4月, 2015 1 次提交
-
-
由 Peter Krempa 提交于
All the called functions already report an error.
-
- 05 3月, 2015 1 次提交
-
-
由 James Chapman 提交于
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: NJán Tomko <jtomko@redhat.com>
-
- 05 2月, 2015 1 次提交
-
-
由 John Ferlan 提交于
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 virNodeDeviceNumOfCaps and virNodeDeviceListCaps using nodeDeviceNumOfCaps and nodeDeviceListCaps. 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') devs = conn.listAllDevices() for dev in devs: if 'fc_host' in dev.listCaps() or 'vports' in dev.listCaps(): print dev.name(),dev.numOfCaps(),dev.listCaps()
-
- 27 1月, 2015 2 次提交
-
-
由 Daniel P. Berrange 提交于
For stateless, client side drivers, it is never correct to probe for secondary drivers. It is only ever appropriate to use the secondary driver that is associated with the hypervisor in question. As a result the ESX & HyperV drivers have both been forced to do hacks where they register no-op drivers for the ones they don't implement. For stateful, server side drivers, we always just want to use the same built-in shared driver. The exception is virtualbox which is really a stateless driver and so wants to use its own server side secondary drivers. To deal with this virtualbox has to be built as 3 separate loadable modules to allow registration to work in the right order. This can all be simplified by introducing a new struct recording the precise set of secondary drivers each hypervisor driver wants struct _virConnectDriver { virHypervisorDriverPtr hypervisorDriver; virInterfaceDriverPtr interfaceDriver; virNetworkDriverPtr networkDriver; virNodeDeviceDriverPtr nodeDeviceDriver; virNWFilterDriverPtr nwfilterDriver; virSecretDriverPtr secretDriver; virStorageDriverPtr storageDriver; }; Instead of registering the hypervisor driver, we now just register a virConnectDriver instead. This allows us to remove all probing of secondary drivers. Once we have chosen the primary driver, we immediately know the correct secondary drivers to use. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The node device driver can rely on its global state instead of the connect private data.
-
- 16 12月, 2014 1 次提交
-
-
由 Daniel P. Berrange 提交于
In systemd >= 218, the udev_set_log_fn method has been marked deprecated and turned into a no-op. Nothing in the udev client library will print to stderr by default anymore, so we can just stop installing a logging hook for new enough udev.
-
- 15 11月, 2014 1 次提交
-
-
由 Martin Kletzander 提交于
Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 07 11月, 2014 1 次提交
-
-
由 Cédric Bosdonnat 提交于
If detect_scsi_host_caps reports errors but keeps libvirtd going on startup, the user is misled by the error messages. Transforming them into warning still shows the problems, but indicates this is not fatal.
-
- 29 10月, 2014 1 次提交
-
-
由 Eric Blake 提交于
C guarantees that static variables are zero-initialized. Some older compilers (and also gcc -fno-zero-initialized-in-bss) create larger binaries if you explicitly zero-initialize a static variable. * src/conf/nwfilter_conf.c: Fix initialization. * src/cpu/cpu_x86.c: Likewise. * src/interface/interface_backend_netcf.c: Likewise. * src/locking/lock_daemon.c: Likewise. * src/locking/lock_driver_lockd.c: Likewise. * src/locking/lock_driver_sanlock.c: Likewise. * src/network/bridge_driver.c: Likewise. * src/node_device/node_device_udev.c: Likewise. * src/nwfilter/nwfilter_learnipaddr.c: Likewise. * src/rpc/virnetserver.c: Likewise. * src/security/security_selinux.c (virSecuritySELinuxGenSecurityLabel): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 15 9月, 2014 1 次提交
-
-
由 Lubomir Rintel 提交于
The manufacurer and product from USB device itself are usually not particularly useful -- they tend to be missing, or ugly (all-uppercase, padded with spaces, etc.). Prefer what's in the usb id database and fall back to descriptors only if the device is too new to be in database. https://bugzilla.redhat.com/show_bug.cgi?id=1138887
-
- 04 9月, 2014 1 次提交
-
-
由 Eric Blake 提交于
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: NEric Blake <eblake@redhat.com>
-
- 29 7月, 2014 1 次提交
-
-
由 Eric Blake 提交于
Leak introduced in commit 16ebf10f (v1.2.6), detected by valgrind: ==9816== 216 (96 direct, 120 indirect) bytes in 6 blocks are definitely lost in loss record 665 of 821 ==9816== at 0x4A081D4: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==9816== by 0x50836FB: virAlloc (viralloc.c:144) ==9816== by 0x1DBDBE27: udevProcessPCI (node_device_udev.c:546) ==9816== by 0x1DBDD79D: udevGetDeviceDetails (node_device_udev.c:1293) * src/util/virpci.h (virPCIEDeviceInfoFree): New prototype. * src/util/virpci.c (virPCIEDeviceInfoFree): New function. * src/conf/node_device_conf.c (virNodeDevCapsDefFree): Clear pci_express under pci case. (virNodeDevCapPCIDevParseXML): Avoid leak. * src/node_device/node_device_udev.c (udevProcessPCI): Likewise. * src/libvirt_private.syms (virpci.h): Export it. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 22 7月, 2014 1 次提交
-
-
由 John Ferlan 提交于
Add an optional unique_id parameter to nodedev. Allows for easier lookup and display of the unique_id value in order to document for use with scsi_host code.
-
- 21 7月, 2014 1 次提交
-
-
由 Peter Krempa 提交于
Commit 5df81317 forgot to adjust a few callers of virStrToLong_ui to ignore the returned value in some ancient parts of the code.
-
- 03 7月, 2014 1 次提交
-
-
由 Ján Tomko 提交于
Replace: if (virBufferError(&buf)) { virBufferFreeAndReset(&buf); virReportOOMError(); ... } with: if (virBufferCheckError(&buf) < 0) ... This should not be a functional change (unless some callers misused the virBuffer APIs - a different error would be reported then)
-
- 01 7月, 2014 2 次提交
-
-
由 Ján Tomko 提交于
This stops the error message spam when running unprivileged libvirtd: 2014-06-30 12:38:47.990+0000: 631: error : virPCIDeviceConfigOpen:300 : Failed to open config space file '/sys/bus/pci/devices/0000:00:00.0/config': Permission denied Reported by Daniel Berrange: https://www.redhat.com/archives/libvir-list/2014-June/msg01082.html
-
由 Ján Tomko 提交于
Remember if libvirtd is running as root or not.
-
- 16 6月, 2014 1 次提交
-
-
由 Michal Privoznik 提交于
This new element is there to represent PCI-Express capabilities of a PCI devices, like link speed, number of lanes, etc. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 11 6月, 2014 1 次提交
-
-
由 Michal Privoznik 提交于
While exposing the info under <interface/> in previous patch works, it may work only in cases where interface is configured on the host. However, orchestrating application may want to know the link state and speed even in that case. That's why we ought to expose this in nodedev XML too: virsh # nodedev-dumpxml net_eth0_f0_de_f1_2b_1b_f3 <device> <name>net_eth0_f0_de_f1_2b_1b_f3</name> <path>/sys/devices/pci0000:00/0000:00:19.0/net/eth0</path> <parent>pci_0000_00_19_0</parent> <capability type='net'> <interface>eth0</interface> <address>f0:de:f1:2b:1b:f3</address> <link speed='1000' state='up'/> <capability type='80203'/> </capability> </device> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 06 6月, 2014 1 次提交
-
-
由 Michal Privoznik 提交于
A PCI device can be associated with a specific NUMA node. Later, when a guest is pinned to one NUMA node the PCI device can be assigned on different NUMA node. This makes DMA transfers travel across nodes and thus results in suboptimal performance. We should expose the NUMA node locality for PCI devices so management applications can make better decisions. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 13 5月, 2014 1 次提交
-
-
由 Julio Faracco 提交于
In "src/conf/" there are many enumeration (enum) declarations. Similar to the recent cleanup to "src/util" directory, it's better to use a typedef for variable types, function types and other usages. Other enumeration and folders will be changed to typedef's in the future. Most of the files changed in this commit are reltaed to Node and Network (node_device_conf.h and nwfilter_params.*) enums. Signed-off-by: NJulio Faracco <jcfaracco@gmail.com> Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 07 5月, 2014 1 次提交
-
-
由 Giuseppe Scrivano 提交于
Some CDROM devices are reported by udev to have an ID_TYPE="generic" thus it is necessary to check if ID_CDROM is present. As a side effect, treating ID_TYPE="generic" as a missing ID_TYPE will enable checks for ID_DRIVE_FLASH_SD and ID_DRIVE_FLOPPY and the udevKludgeStorageType heuristic. Signed-off-by: NGiuseppe Scrivano <gscrivan@redhat.com> Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 08 4月, 2014 1 次提交
-
-
由 Daniel P. Berrange 提交于
Since it is an abbreviation, SCSI should always be fully capitalized or full lower case, never Scsi. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 29 3月, 2014 1 次提交
-
-
由 Jincheng Miao 提交于
virNodeDeviceListCaps will always return empty for a pci nodedevice, actually it should return 'pci'. It is because the loop variable ncaps isn't increased. Introduced by commit be2636fd. https://bugzilla.redhat.com/show_bug.cgi?id=1081932Signed-off-by: NJincheng Miao <jmiao@redhat.com> Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
- 25 3月, 2014 1 次提交
-
-
由 Ján Tomko 提交于
-
- 21 3月, 2014 1 次提交
-
-
由 Martin Kletzander 提交于
Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 18 3月, 2014 2 次提交
-
-
由 Daniel P. Berrange 提交于
Any source file which calls the logging APIs now needs to have a VIR_LOG_INIT("source.name") declaration at the start of the file. This provides a static variable of the virLogSource type. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
As part of the goal to get away from doing string matching on filenames when deciding whether to emit a log message, turn the virLogSource enum into a struct which contains a log "name". There will eventually be one virLogSource instance statically declared per source file. To minimise churn in this commit though, a single global instance is used. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-