- 07 6月, 2016 23 次提交
-
-
由 Ján Tomko 提交于
Open code the call to udev_device_get_sysattr_value in the one place where it's needed.
-
由 Ján Tomko 提交于
Callers only check for an error or a specific integer value.
-
由 Ján Tomko 提交于
The callers only care for an error, and a missing attribute is simply NULL.
-
由 Ján Tomko 提交于
Most of the code paths free it right after converting it to an integer.
-
由 Ján Tomko 提交于
We only care about the failure, not a missing property.
-
由 Ján Tomko 提交于
There is no need to differentiate between PROPERTY_FOUND and PROPERTY_MISSING - we can just look if the string is non-NULL.
-
由 Ján Tomko 提交于
Error out on parsing errors and use a local const char pointer instead of chained ifs to check whether we found a match.
-
由 Ján Tomko 提交于
Since the switch to VIR_STRDUP this function returns 1 on success, but the caller treats any non-zero value as failure.
-
由 Ján Tomko 提交于
Use udevHasDeviceProperty instead of udevGetStringProperty. We do not need to copy the string since we do not need it. Also add braces around the if body, since the change made syntax check complain.
-
由 Ján Tomko 提交于
-
由 Ján Tomko 提交于
Two out of three callers free it right after converting it to a number. Also change the comment at the beginning of the function, because the comment inside the function told me to.
-
由 Ján Tomko 提交于
Open code the error message.
-
由 Ján Tomko 提交于
Remove the debug message, open code the error in the two udevGetUint callers and use a more specific error in SCSI and PCI processing.
-
由 Ján Tomko 提交于
The wrapper adds an error message or a debug log. Since we already log the properties we get from udev as strings, there is no much use for the debug logs. Open code the error message and delete the function.
-
由 Ján Tomko 提交于
Use virStrToLong_ui instead of udevStrToLong_ui, reformat the code and report a more specific error message.
-
由 Ján Tomko 提交于
Instead of separating it into STRPEFIX and str + strlen.
-
由 Ján Tomko 提交于
A variable without use is pointless. Remove it, since we have no use for it.
-
由 Ján Tomko 提交于
-
由 Ján Tomko 提交于
If we have not allocated driver yet, there is nothing to cleanup.
-
由 Ján Tomko 提交于
Remove the ret variable and return early if there is no driver.
-
由 Ján Tomko 提交于
This will simplify cleanup.
-
由 Ján Tomko 提交于
Move pci_system_init and pci_system_cleanup into separate functions, to make the conditional compilation easier to read.
-
由 Ján Tomko 提交于
Most of the code paths had to reset it to -1 and returning 0 was only possible if we made it to the end of the function. Initialize it to -1 and only set it to 0 if we reach the end, as we do in most of libvirt code.
-
- 25 5月, 2016 1 次提交
-
-
由 Andrea Bolognani 提交于
Commit c8b1a836 changed the function, making it impossible for callers to be able to tell whether a non-negative return value means "physical function address found and parsed correctly" or "couldn't find corresponding physical function". The important difference between the two being that, in the latter case, the returned pointer is NULL and should never, ever be dereferenced. In order to cope with these changes, the callers have to be updated.
-
- 10 5月, 2016 1 次提交
-
-
由 John Ferlan 提交于
Both instances use VIR_WARN() to print the error from a failed virDBusGetSystemBus() call. Rather than use the virGetLastError and need to check for valid return err pointer, just use the virGetLastErrorMessage. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 19 3月, 2016 2 次提交
-
-
由 Martin Kletzander 提交于
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=1317531Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Martin Kletzander 提交于
Best viewed with '-w' as this is just an adjustment for future patch to be readable without that. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 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.
-