- 10 4月, 2019 1 次提交
-
-
由 Peter Krempa 提交于
'viralloc.h' does not provide any type or macro which would be necessary in headers. Prevent leakage of the inclusion. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 04 2月, 2019 2 次提交
-
-
由 Cole Robinson 提交于
Missing semicolon at the end of macros can confuse some analyzers (like cppcheck <filename>). VIR_ONCE_GLOBAL_INIT is almost exclusively called without an ending semicolon, but let's standardize on using one like the other macros. Add a dummy struct definition at the end of the macro, so the compiler will require callers to add a semicolon. Reviewed-by: NJohn Ferlan <jferlan@redhat.com> Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
由 Cole Robinson 提交于
Missing semicolon at the end of macros can confuse some analyzers (like cppcheck <filename>), and we have a mix of semicolon and non-semicolon usage through the code. Let's standardize on using a semicolon for VIR_ENUM_IMPL calls. Move the verify() statement to the end of the macro and drop the semicolon, so the compiler will require callers to add a semicolon. While we are touching these call sites, standardize on putting the closing parenth on its own line, as discussed here: https://www.redhat.com/archives/libvir-list/2019-January/msg00750.htmlReviewed-by: NJohn Ferlan <jferlan@redhat.com> Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
- 30 10月, 2018 1 次提交
-
-
由 Boris Fiuczynski 提交于
Adjusting domain format documentation, adding device address support and adding command line generation for vfio-ap. Since only one mediated hostdev with model vfio-ap is supported a check disallows to define domains with more than one such hostdev device. Signed-off-by: NBoris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: NBjoern Walk <bwalk@linux.ibm.com> Reviewed-by: NChris Venteicher <cventeic@redhat.com>
-
- 28 7月, 2018 1 次提交
-
-
由 Julio Faracco 提交于
After some recent patches, clang is throwing some errors related to unused variables. This is not happening when we use GCC with -Werror enabled. Only clang reports this warning. make[3]: Entering directory '/home/julio/Desktop/virt/libvirt/src' CC util/libvirt_util_la-virscsivhost.lo CC util/libvirt_util_la-virusb.lo CC util/libvirt_util_la-virmdev.lo util/virmdev.c:373:36: error: unused variable 'ret' [-Werror,-Wunused-variable] VIR_AUTOPTR(virMediatedDevice) ret = virMediatedDeviceListSteal(list, dev); ^ 1 error generated. Makefile:11579: recipe for target 'util/libvirt_util_la-virmdev.lo' failed make[3]: *** [util/libvirt_util_la-virmdev.lo] Error 1 make[3]: *** Waiting for unfinished jobs.... util/virscsivhost.c:112:37: error: unused variable 'tmp' [-Werror,-Wunused-variable] VIR_AUTOPTR(virSCSIVHostDevice) tmp = virSCSIVHostDeviceListSteal(list, dev); ^ 1 error generated. Makefile:11411: recipe for target 'util/libvirt_util_la-virscsivhost.lo' failed make[3]: *** [util/libvirt_util_la-virscsivhost.lo] Error 1 util/virusb.c:511:31: error: unused variable 'ret' [-Werror,-Wunused-variable] VIR_AUTOPTR(virUSBDevice) ret = virUSBDeviceListSteal(list, dev); Signed-off-by: NJulio Faracco <jcfaracco@gmail.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 27 7月, 2018 3 次提交
-
-
由 Sukrit Bhatnagar 提交于
By making use of GNU C's cleanup attribute handled by the VIR_AUTOPTR macro for declaring aggregate pointer variables, majority of the calls to *Free functions can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: NSukrit Bhatnagar <skrtbhtngr@gmail.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
由 Sukrit Bhatnagar 提交于
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: NSukrit Bhatnagar <skrtbhtngr@gmail.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
由 Sukrit Bhatnagar 提交于
Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in src/util/viralloc.h, define a new wrapper around an existing cleanup function which will be called when a variable declared with VIR_AUTOPTR macro goes out of scope. Also, drop the redundant viralloc.h include, since that has moved from the source module into the header. When variables of type virMediatedDevicePtr and virMediatedDeviceTypePtr are declared using VIR_AUTOPTR, the functions virMediatedDeviceFree and virMediatedDeviceTypeFree, respectively, will be run automatically on them when they go out of scope. Signed-off-by: NSukrit Bhatnagar <skrtbhtngr@gmail.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
- 15 5月, 2018 1 次提交
-
-
Introduces the vfio-ccw model for mediated devices and prime vfio-ccw devices such that CCW address will be generated. Alters the qemuxml2xmltest for testing a basic mdev device using vfio-ccw. Signed-off-by: NShalini Chellathurai Saroja <shalini@linux.vnet.ibm.com> Reviewed-by: NBjoern Walk <bwalk@linux.ibm.com> Reviewed-by: NBoris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com> Reviewed-by: NStefan Zimmermann <stzi@linux.ibm.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 18 4月, 2018 1 次提交
-
-
由 Michal Privoznik 提交于
So far we are repeating the following lines over and over: if (!(virSomeObjectClass = virClassNew(virClassForObject(), "virSomeObject", sizeof(virSomeObject), virSomeObjectDispose))) return -1; While this works, it is impossible to do some checking. Firstly, the class name (the 2nd argument) doesn't match the name in the code in all cases (the 3rd argument). Secondly, the current style is needlessly verbose. This commit turns example into following: if (!(VIR_CLASS_NEW(virSomeObject, virClassForObject))) return -1; Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 19 3月, 2018 1 次提交
-
-
由 Erik Skultety 提交于
What one currently gets is: failed to read '/sys/bus/mdev/devices/<UUID>/mdev_type/device_api': No such file or directory This indicates that something is missing within the device's sysfs tree which likely might be not be the case here because the device simply doesn't exist yet. So, when creating our internal mdev obj, let's check whether the device exists first prior to trying to verify the user-provided model within domain XML. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
- 08 3月, 2018 1 次提交
-
-
由 Erik Skultety 提交于
When commit 3545cbef moved the sysfs attribute reading logic from _udev.c module to virmdev.c, it had to replace our udev read wrappers with the ones available from virfile.c. The problem is that the original logic worked correctly with udev read wrappers which don't return an error code for a missing attribute, virfile.c readers however - not so much. Therefore add another parameter to the macro, so we can again accept the fact that optional attributes may be missing. Signed-off-by: NErik Skultety <eskultet@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 29 1月, 2018 2 次提交
-
-
由 Erik Skultety 提交于
This should serve as a replacement for the existing udevFillMdevType which is responsible for fetching the device type's attributes from the sysfs interface. The problem with the existing solution is that it's tied to the udev backend. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
由 Erik Skultety 提交于
This is later going to replace the existing virNodeDevCapMdevType, since: 1) it's going to couple related stuff in a single module 2) util is supposed to contain helpers that are widely accessible across the whole repository. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
- 18 5月, 2017 1 次提交
-
-
由 Erik Skultety 提交于
Namely, this patch is about virMediatedDeviceGetIOMMUGroup{Dev,Num} functions. There's no compelling reason why these functions should take an object, on the contrary, having to create an object every time one needs to query the IOMMU group number, discarding the object afterwards, seems odd. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
- 09 5月, 2017 1 次提交
-
-
由 Erik Skultety 提交于
So, because mingw is somehow OK with dereferencing a pointer within a VIR_DEBUG macro, compared to outside of it to which it complained with a "potential NULL pointer dereference" error (still a false positive), we can make the code a tiny bit cleaner. Sighed-by: NErik Skultety <eskultet@redhat.com> Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
- 04 5月, 2017 3 次提交
-
-
由 Erik Skultety 提交于
This patch fixes the following MinGW error (although actually being a false positive): ../../src/util/virmdev.c: In function 'virMediatedDeviceListMarkDevices': ../../src/util/virmdev.c:453:21: error: potential null pointer dereference [-Werror=null-dereference] const char *mdev_path = mdev->path; ^~~~~~~~~ Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
由 Erik Skultety 提交于
The problem resides in virHostdevUpdateActiveMediatedDevices which gets called during qemuProcessReconnect. The issue here is that virMediatedDeviceListAdd takes a pointer to the item to be added to the list to which VIR_APPEND_ELEMENT is used, which also clears the pointer. However, in this case only the local copy of the pointer got cleared, leaving the original pointing to valid memory. To sum it up, during cleanup phase, the original pointer is freed and the daemon crashes basically any time it would access it. Backtrace: 0x00007ffff3ccdeba in __strcmp_sse2_unaligned 0x00007ffff72a444a in virMediatedDeviceListFindIndex 0x00007ffff7241446 in virHostdevReAttachMediatedDevices 0x00007fffc60215d9 in qemuHostdevReAttachMediatedDevices 0x00007fffc60216dc in qemuHostdevReAttachDomainDevices 0x00007fffc6046e6f in qemuProcessStop 0x00007fffc6091596 in processMonitorEOFEvent 0x00007fffc6091793 in qemuProcessEventHandler 0x00007ffff7294bf5 in virThreadPoolWorker 0x00007ffff7294184 in virThreadHelper 0x00007ffff3fdc3c4 in start_thread () from /lib64/libpthread.so.0 0x00007ffff3d269cf in clone () from /lib64/libc.so.6 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1446455Signed-off-by: NErik Skultety <eskultet@redhat.com> Reviewed-by: NLaine Stump <laine@laine.org>
-
由 Erik Skultety 提交于
Use a local variable to hold data, rather than accessing the pointer after calling virMediatedDeviceListAdd (therefore VIR_APPEND_ELEMENT). Although not causing an issue at the moment, this change is a necessary prerequisite for tweaking virMediatedDeviceListAdd in a separate patch, which will take a reference for the source pointer (instead of pointer value) and will clear it along the way. Signed-off-by: NErik Skultety <eskultet@redhat.com> Reviewed-by: NLaine Stump <laine@laine.org> Reviewed-by: NPavel Hrdina <phrdina@redhat.com>
-
- 28 3月, 2017 1 次提交
-
-
由 Roman Bogorodskiy 提交于
- Make virMediatedDeviceNew() stub args match its prototype - Fix typo: virRerportError -> virReportError - Move MDEV_SYSFS_DEVICES definition out of the #ifdef __linux__ block so we don't have to stub virMediatedDeviceGetSysfsPath()
-
- 27 3月, 2017 1 次提交
-
-
由 Erik Skultety 提交于
Beside creation, disposal, getter, and setter methods the module exports methods to work with lists of mediated devices. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-