- 20 2月, 2017 9 次提交
-
-
由 Pavel Hrdina 提交于
The old data was generated from not released QEMU. Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Michal Privoznik 提交于
When enabling virgl, qemu opens /dev/dri/render*. So far, we are not allowing that in devices CGroup nor creating the file in domain's namespace and thus requiring users to set the paths in qemu.conf. This, however, is suboptimal as it allows access to ALL qemu processes even those which don't have virgl configured. Now that we have a way to specify render node that qemu will use we can be more cautious and enable just that. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
So far, qemuDomainGetHostdevPath has no knowledge of the reasong it is called and thus reports /dev/vfio/vfio for every VFIO backed device. This is suboptimal, as we want it to: a) report /dev/vfio/vfio on every addition or domain startup b) report /dev/vfio/vfio only on last VFIO device being unplugged If a domain is being stopped then namespace and CGroup die with it so no need to worry about that. I mean, even when a domain that's exiting has more than one VFIO devices assigned to it, this function does not clean /dev/vfio/vfio in CGroup nor in the namespace. But that doesn't matter. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
-
由 Michal Privoznik 提交于
So far, we are allowing /dev/vfio/vfio in the devices cgroup unconditionally (and creating it in the namespace too). Even if domain has no hostdev assignment configured. This is potential security hole. Therefore, when starting the domain (or hotplugging a hostdev) create & allow /dev/vfio/vfio too (if needed). Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
-
由 Michal Privoznik 提交于
Since these two functions are nearly identical (with qemuSetupHostdevCgroup actually calling virCgroupAllowDevicePath) we can have one function call the other and thus de-duplicate some code. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
-
由 Michal Privoznik 提交于
There's no need for this function. Currently it is passed as a callback to virSCSIVHostDeviceFileIterate(). However, SCSI host devices have just one file path. Therefore we can mimic approach used in qemuDomainGetHostdevPath() to get path and call virCgroupAllowDevicePath() directly. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
-
由 Michal Privoznik 提交于
There's no need for this function. Currently it is passed as a callback to virSCSIDeviceFileIterate(). However, SCSI devices have just one file path. Therefore we can mimic approach used in qemuDomainGetHostdevPath() to get path and call virCgroupAllowDevicePath() directly. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
-
由 Michal Privoznik 提交于
There's no need for this function. Currently it is passed as a callback to virUSBDeviceFileIterate(). However, USB devices have just one file path. Therefore we can mimic approach used in qemuDomainGetHostdevPath() to get path and call virCgroupAllowDevicePath() directly. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
-
- 19 2月, 2017 16 次提交
-
-
由 Pavel Hrdina 提交于
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 John Ferlan 提交于
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.
-
由 John Ferlan 提交于
Add a test that allows providing the parent wwnn/wwpn in the input XML in order to create the vHBA.
-
由 John Ferlan 提交于
Add a test that allows not providing a parent in the input XML, but still being able to create finding a VPORT capable NPIV HBA.
-
由 John Ferlan 提交于
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.
-
由 John Ferlan 提交于
While perhaps improbable, it could be possible that after finding our object that another thread running essentially in parallel could attempt to delete the same vHBA. So rather than dropping the lock right after finding the object, keep the lock around while we drop the object lock and work on deleting the object. Once the delete occurs we can safely drop the driver lock again. Cleanup some of the usage of cleanup instead out for the goto label.
-
由 John Ferlan 提交于
Add a test that will mimic creation and destruction of a vHBA by using node device XML. The design will allow for testing the multiple mechanisms. The first test uses just <parent> in the node device XML. This is somewhat similar to the existing objecteventtest, except that this test will not provide input wwnn/wwpn's (similar to how the process is described for the the libvirt wiki). This requires mocking the virRandomGenerateWWN since parsing the input XML (virNodeDevCapSCSIHostParseXML) requires either a provided wwnn/wwpn in the XML or the ability to randomly generate the wwnn/wwpn.
-
由 John Ferlan 提交于
Create a virscsihost.c and place the functions there. That removes the last #ifdef __linux__ from virutil.c. Take the opporunity to also change the function names and in one case the parameters slightly
-
由 John Ferlan 提交于
Use the new virNodeDeviceGetParentName instead. Modify the callers to build the node device scsi_host# name string in order to call the new function so that proper lookup occurs.
-
由 John Ferlan 提交于
Create a function which takes a node device "name" entry to lookup and returns a string containing the parent name for the node device.
-
由 John Ferlan 提交于
Rather than have them mixed in with the virutil apis, create a separate virvhba.c module and move the vHBA related calls into there. Soon there will be more added. Also modify the names of the functions and some arguments to be more indicative of what is really happening. Adjust the callers respectively. While I was changing fchosttest, rather than the non-descriptive names test1...test6, rename them to match what the test is doing.
-
由 John Ferlan 提交于
Commit id '666bee39' made fabric_name optional; however, if fabric name was present, then a leak would occur. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Modify the code to react more like a real HBA -> vHBA creation. Currently the code would just modify the input XML definition to set the name to a wwpn and then modify the scsi_host capability entry for the defintion to change the scsi_host# and unique_id before adding that into the node device. This patch does things a bit better. It finds and copies a known existing vHBA (scsi_host11) in the node_device database and modifies that definition to change the name to scsi_host12 and set the wwnn/ wwpn to what the input XML would expect before adding the def to the node device object list. Then rather than create a returned "dev" using the (poorly) mocked name - perform the lookup using the new device name.
-
由 John Ferlan 提交于
Rather than inline the dummy creation of a vHBA to add to the node devices - create a helper to do that work. Also just tidy up a couple of things while at it...
-
由 John Ferlan 提交于
Predefine a second NPIV capable HBA as well as a vHBA using the first NPIV capable HBA. This will allow for a mechanism to perform more realistic create vHBA testing.
-
由 John Ferlan 提交于
Alter "test-scsi-host-vport" to be "scsi_host1" to match the real environment. This is the vport capable HBA - IOW the NPIV device. Add more fields to scsi_host1 as well. Alter the XML being used by the objecttest to create a vHBA in order to match the scsi_host1 parent name and to use validateable wwnn/wwpn. This will allow for realistic testing.
-
- 18 2月, 2017 1 次提交
-
-
由 Roman Bogorodskiy 提交于
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.
-
- 17 2月, 2017 10 次提交
-
-
由 Michal Privoznik 提交于
After 7f1bdec5 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: NMichal Privoznik <mprivozn@redhat.com>
-
由 Marc-André Lureau 提交于
Add a new attribute 'rendernode' to <gl> spice element. Give it to QEMU if qemu supports it (queued for 2.9). Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 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 提交于
This should have been added with c4a4603d (or 0bdefd9b). Signed-off-by: NMarc-André Lureau <marcandre.lureau@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>
-
由 Marc-André Lureau 提交于
This is a cosmetic change, shouldn't change XML parsing, and doesn't break any test. Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
-
由 Jiri Denemark 提交于
We want to remove the file created by json <<<"$data" >$fname.json in case it was empty. Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
由 John Ferlan 提交于
When the 'parent' was added to the virNodeDevicePtr structure by commit id 'e8a4ea75' 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: NJohn Ferlan <jferlan@redhat.com>
-
由 Joao Martins 提交于
As discussed here [0][1] Coverity reported two issues: - On libxlDomainMigrationPrepareTunnel3 @@mig will be leaked on failures after sucessfull call libxlDomainMigrationPrepareAny hence we free it. Setting mig = NULL after @mig is assigned plus adding libxlMigrationCookieFree on error paths addresses the issue. In case virThreadCreate fails, unref of args frees the cookie on dispose function (libxlMigrationDstArgsDispose) - On libxlMigrationStartTunnel @tc would be leaked. Fixed by correctly saving the newly allocated @tc onto @tnl such that libxlMigrationStopTunnel would free it up. [0] https://www.redhat.com/archives/libvir-list/2017-February/msg00791.html [1] https://www.redhat.com/archives/libvir-list/2017-February/msg00833.htmlSigned-off-by: NJoao Martins <joao.m.martins@oracle.com>
-
由 Michal Privoznik 提交于
Before 9c17d665 (v1.3.2 - I know, right?) it was possible to have the following interface configuration: <interface type='ethernet'/> <script path=''/> </interface> This resulted in -netdev tap,script=,.. Fortunately, qemu helped us to get away with this as it just ignored the empty script path. However, after the commit mentioned above it's libvirtd who is executing the script. Unfortunately without special case-ing empty script path. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 16 2月, 2017 4 次提交
-
-
由 Jim Fehlig 提交于
-
由 Nitesh Konkar 提交于
Currently disk names do not follow the (regex) /^[fhv]d[a-z]+[0-9]*$/ completely and hence one can assign disk names like vd2 etc. This patch ensures that the disk names follow the regex mentioned. This patch also adds a testcase. Signed-off-by: NNitesh Konkar <nitkon12@linux.vnet.ibm.com>
-
由 Jim Fehlig 提交于
Commit 4ab0c959 fixed a memory leak in libxlDriverGetDom0MaxmemConf but introduced a potential double free of mem_tokens *** Error in `/usr/sbin/libvirtd': double free or corruption (out): 0x00007fffc808cfd0 *** Avoid double free by setting mem_tokens to NULL after calling virStringListFree.
-