- 19 10月, 2017 5 次提交
-
-
由 Erik Skultety 提交于
udevSetupSystemDev only needs the udev data lock to be locked because of calling udevGetDMIData which accesses some protected structure members, but it can do that on its own just fine, no need to hold the lock the whole time. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
由 Erik Skultety 提交于
The driver locks are unnecessary here, since currently the cleanup is only called from the main daemon thread, so we can't race here. Moreover @devs and @privateData are self-lockable objects, so no problem there either. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
由 Erik Skultety 提交于
Since there's going to be a worker thread which needs to have some data protected by a lock, the whole code would just simply get unnecessary complex, since two sets of locks would be necessary, driver lock (for udev monitor and event handle) and a mutex protecting thread-local data. Given the future thread will need to access the udev monitor socket as well, why not protect everything with a single lock, even better, by converting the driver's private data to a lockable object, we get the automatic object disposal feature for free. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
由 Erik Skultety 提交于
We need to perform a sanity check on the udev monitor before every use so that we know nothing has changed in the meantime. The reason for moving the code to a separate helper is to enhance readability and shift the focus on the important stuff within the udevEventHandleCallback handler. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
由 Erik Skultety 提交于
Even though hal doesn't make use of it, the privileged flag is related to the daemon/driver rather than the backend actually used. While at it, get rid of some tab indentation in the driver state struct. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
- 17 8月, 2017 3 次提交
-
-
由 Erik Skultety 提交于
Let this new method handle the device object we obtained from the monitor in order to enhance readability. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
由 Erik Skultety 提交于
So we have a sanity check for the udev monitor fd. Theoretically, it could happen that the udev monitor fd changes (due to our own wrongdoing, hence the 'sanity' here) and if that happens it means we are handling an event from a different entity than we think, thus we should remove the handle if someone somewhere somehow hits this hypothetical case. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
由 Erik Skultety 提交于
It might happen that virFileResolveLinkHelper fails on the lstat system call. virFileResolveLink expects the caller to report an error when it fails, however this wasn't the case for udevProcessMediatedDevice. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
- 28 7月, 2017 1 次提交
-
-
由 Erik Skultety 提交于
Commit @4cb719b2 moved the driver locks around since these have become unnecessary at spots where the code handles now self-lockable object list, but missed the possible double unlock if udevEnumerateDevices fails, because at that point the driver lock had been already dropped. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
- 25 7月, 2017 1 次提交
-
-
由 John Ferlan 提交于
Since virnodedeviceobj now has a self-lockable hash table, there's no need to lock the table from the driver for processing. Thus remove the locks from the driver for NodeDeviceObjList mgmt. This includes the test driver as well.
-
- 17 7月, 2017 5 次提交
-
-
由 John Ferlan 提交于
Now that we have a bit more control, let's convert our object into a lockable object and let that magic handle the create and lock/unlock. This also involves creating a virNodeDeviceEndAPI in order to handle the object cleanup for API's that use the Add or Find API's in order to get a locked/reffed object. The EndAPI will unlock and unref the object returning NULL to indicate to the caller to not use the obj. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Ensure that any function that walks the node device object list is prefixed by virNodeDeviceObjList. Also, modify the @filter param name for virNodeDeviceObjListExport to be @aclfilter. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
In preparation to make things private, make the ->devs be pointers to a virNodeDeviceObjList and then manage everything inside virnodedeviceobj Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
A virNodeDeviceObjPtr is an @obj A virNodeDeviceObjListPtr is a @devs A virNodeDevicePtr is a @device Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Rather than passing the object to be removed by reference, pass by value and then let the caller decide whether or not the object should be free'd and how to handle the logic afterwards. This includes free'ing the object and/or setting the local variable to NULL to prevent subsequent unexpected usage (via something like virNodeDeviceObjRemove in testNodeDeviceDestroy). For now this function will just handle the remove of the object from the list for which it was placed during virNodeDeviceObjAssignDef. This essentially reverts logic from commit id '61148074' that free'd the device entry on list, set *dev = NULL and returned. Thus fixing a bug in node_device_hal.c/dev_refresh() which would never call dev_create(udi) since @dev would have been set to NULL. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 03 6月, 2017 2 次提交
-
-
由 John Ferlan 提交于
In preparation for privatizing the virNodeDeviceObj - create an accessor for the @def field and then use it for various callers. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Alter the node_device_driver source and prototypes to follow more recent code style guidelines w/r/t spacing between functions, format of the function, and the prototype definitions. While the new names for nodeDeviceUpdateCaps, nodeDeviceUpdateDriverName, and nodeDeviceGetTime don't follow exactly w/r/t a "vir" prefix, they do follow other driver nomenclature style. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 31 5月, 2017 1 次提交
-
-
由 Erik Skultety 提交于
Caused by commit @d1eea6c1 due to the missing symbol on older platforms. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
- 29 5月, 2017 1 次提交
-
-
由 ning.bo 提交于
When a number of SRIOV VFs (up to 128 on Intel XL710) is created: for i in `seq 0 1`; do echo 63 > /sys/class/net/<interface>/device/sriov_numvfs done libvirtd will then report "udev_monitor_receive_device returned NULL" error because the netlink socket buffer is not big enough (using GDB on libudev confirmed this with ENOBUFFS) and thus some udev events were dropped. This results in some devices being missing in the nodedev-list output. This patch overrides the system's rmem_max limit but for that, we need to make sure we've got root privileges. https://bugzilla.redhat.com/show_bug.cgi?id=1450960Signed-off-by: Nning.bo <ning.bo9@zte.com.cn> Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
- 26 5月, 2017 2 次提交
-
-
由 Bjoern Walk 提交于
Similar to scsi_host and fc_host, there is a relation between a scsi_target and its transport specific fc_remote_port. Let's expose this relation and relevant information behind it. An example for a virsh nodedev-dumpxml: virsh # nodedev-dumpxml scsi_target0_0_0 <device> <name>scsi_target0_0_0</name> <path>/sys/devices/[...]/host0/rport-0:0-0/target0:0:0</path> <parent>scsi_host0</parent> <capability type='scsi_target'> <target>target0:0:0</target> <capability type='fc_remote_port'> <rport>rport-0:0-0</rport> <wwpn>0x9d73bc45f0e21a86</wwpn> </capability> </capability> </device> Reviewed-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com> Signed-off-by: NBjoern Walk <bwalk@linux.vnet.ibm.com>
-
由 Bjoern Walk 提交于
Make CCW devices available to the node_device driver. The devices are already seen by udev so let's implement necessary code for detecting them properly. Topologically, CCW devices are similar to PCI devices, e.g.: +- ccw_0_0_1a2b | +- scsi_host0 | +- scsi_target0_0_0 | +- scsi_0_0_0_0 Reviewed-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com> Signed-off-by: NBjoern Walk <bwalk@linux.vnet.ibm.com>
-
- 18 5月, 2017 4 次提交
-
-
由 Erik Skultety 提交于
GCC 4.6 complains about a local declaration shadowing a global symbol. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
由 Erik Skultety 提交于
Start discovering the mediated devices on the host system and format the attributes for the mediated device into the XML. Compared to the parent device which reports generic information about the abstract mediated devices types, a child device only reports the type name it has been instantiated from and the IOMMU group number, since that's device specific compared to the rest of the info that can be gathered about mediated devices at the moment. This patch introduces both the formatting and parsing routines, updates nodedev.rng schema, adding a testcase as well. The resulting mdev child device XML: <device> <name>mdev_4b20d080_1b54_4048_85b3_a6a62d165c01</name> <path>/sys/devices/.../4b20d080-1b54-4048-85b3-a6a62d165c01</path> <parent>pci_0000_06_00_0</parent> <driver> <name>vfio_mdev</name> </driver> <capability type='mdev'> <type id='vendor_supplied_type_id'/> <iommuGroup number='NUM'/> <capability/> <device/> https://bugzilla.redhat.com/show_bug.cgi?id=1452072Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
由 Erik Skultety 提交于
The parent device needs to report the generic stuff about the supported mediated devices types, like device API, available instances, type name, etc. Therefore this patch introduces a new nested capability element of type 'mdev_types' with the resulting XML of the following format: <device> ... <capability type='pci'> ... <capability type='mdev_types'> <type id='vendor_supplied_id'> <name>optional_vendor_supplied_codename</name> <deviceAPI>vfio-pci</deviceAPI> <availableInstances>NUM</availableInstances> </type> ... <type> ... </type> </capability> </capability> ... </device> https://bugzilla.redhat.com/show_bug.cgi?id=1452072Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
由 Erik Skultety 提交于
The reason for introducing two capabilities, one for the device itself (cap 'mdev') and one for the parent device listing the available types ('mdev_types'), is that we should be able to do 'virsh nodedev-list --cap' not only for existing mdev devices but also for devices that support creation of mdev devices, since one day libvirt might be actually able to create the mdev devices in an automated way (just like we do for NPIV/vHBA). https://bugzilla.redhat.com/show_bug.cgi?id=1452072Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
- 24 4月, 2017 2 次提交
-
-
由 Erik Skultety 提交于
Since we have that information provided by @def which is not a private object, there is really no need for the variable. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
由 Erik Skultety 提交于
So udevGetDeviceDetails was one those functions using an enum in a switch, but since it had a 'default' case, compiler didn't warn about an unhandled enum. Moreover, the error about an unsupported device type reported in the default case is unnecessary, since by the time we get there, udevGetDeviceType (which was called before) already made sure that any unrecognized device types had been handled properly. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
- 04 3月, 2017 3 次提交
-
-
由 John Ferlan 提交于
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]
-
由 John Ferlan 提交于
Replace with more data specific pointer types.
-
由 John Ferlan 提交于
Use "virNodeDeviceObj" as a prefix for any external API in virnodedeviceobj
-
- 20 2月, 2017 1 次提交
-
-
由 Marc Hartmayer 提交于
The comment was actually wrong as https://www.freedesktop.org/software/systemd/man/udev_new.html# mentions that on failure NULL is returned. Also the same return value is checked in src/interface/interface_backend_udev.c already. Signed-off-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
-
- 17 2月, 2017 2 次提交
-
-
由 Marc-André Lureau 提交于
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: NMarc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Marc-André Lureau 提交于
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: NMarc-André Lureau <marcandre.lureau@redhat.com>
-
- 12 10月, 2016 1 次提交
-
-
由 Martin Kletzander 提交于
This way we get reference counting and we can get rid of locking function. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 29 8月, 2016 1 次提交
-
-
由 Roman Bogorodskiy 提交于
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.
-
- 15 8月, 2016 1 次提交
-
-
由 Jovanka Gulicoska 提交于
This event is emitted when a nodedev XML definition is updated, like when cdrom media is changed in a cdrom block device. Also includes node device update event implementation for udev backend, virsh nodedev-event support, and event-test support
-
- 02 8月, 2016 1 次提交
-
-
由 Jovanka Gulicoska 提交于
-
- 07 6月, 2016 3 次提交