- 07 6月, 2016 26 次提交
-
-
由 Ján Tomko 提交于
Use virTrimSpaces instead of a custom implementation.
-
由 Ján Tomko 提交于
Also use the more common "Unable to initialize mutex" string and virReportSystemError instead of virStrerror.
-
由 Ján Tomko 提交于
They are no longer used.
-
由 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.
-
- 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>
-
- 18 5月, 2015 3 次提交
-
-
由 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 提交于
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 提交于
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>
-
- 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>
-
- 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
-