- 16 10月, 2019 4 次提交
-
-
由 Ján Tomko 提交于
Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Ján Tomko 提交于
Since commit 44e7f029 util: rewrite auto cleanup macros to use glib's equivalent VIR_AUTOPTR aliases to g_autoptr. Replace all of its use by the GLib macro version. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Ján Tomko 提交于
Since commit 44e7f029 util: rewrite auto cleanup macros to use glib's equivalent VIR_AUTOPTR aliases to g_autoptr. Replace all uses of VIR_DEFINE_AUTOPTR_FUNC with G_DEFINE_AUTOPTR_CLEANUP_FUNC in preparation for replacing the rest. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Ján Tomko 提交于
Since commit 44e7f029 util: rewrite auto cleanup macros to use glib's equivalent VIR_AUTOFREE is just an alias for g_autofree. Use the GLib macros directly instead of our custom aliases. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 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>
-
- 08 2月, 2019 1 次提交
-
-
由 John Ferlan 提交于
For consistency, let's use the semicolon for all definitions. Signed-off-by: NJohn Ferlan <jferlan@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
- 04 2月, 2019 1 次提交
-
-
由 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>
-
- 14 12月, 2018 1 次提交
-
-
由 Daniel P. Berrangé 提交于
In many files there are header comments that contain an Author: statement, supposedly reflecting who originally wrote the code. In a large collaborative project like libvirt, any non-trivial file will have been modified by a large number of different contributors. IOW, the Author: comments are quickly out of date, omitting people who have made significant contribitions. In some places Author: lines have been added despite the person merely being responsible for creating the file by moving existing code out of another file. IOW, the Author: lines give an incorrect record of authorship. With this all in mind, the comments are useless as a means to identify who to talk to about code in a particular file. Contributors will always be better off using 'git log' and 'git blame' if they need to find the author of a particular bit of code. This commit thus deletes all Author: comments from the source and adds a rule to prevent them reappearing. The Copyright headers are similarly misleading and inaccurate, however, we cannot delete these as they have legal meaning, despite being largely inaccurate. In addition only the copyright holder is permitted to change their respective copyright statement. Reviewed-by: NErik Skultety <eskultet@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 20 9月, 2018 2 次提交
-
-
由 Erik Skultety 提交于
All of the ones being removed are pulled in by internal.h. The only exception is sanlock which expects the application to include <stdint.h> before sanlock's headers, because sanlock prototypes use fixed width int, but they don't include stdint.h themselves, so we have to leave that one in place. Signed-off-by: NErik Skultety <eskultet@redhat.com> Acked-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Erik Skultety 提交于
It doesn't really make sense for us to have stdlib.h and string.h but not stdio.h in the internal.h header. Signed-off-by: NErik Skultety <eskultet@redhat.com> Acked-by: NMichal Privoznik <mprivozn@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 virSCSIDevicePtr and virUsedByInfoPtr are declared using VIR_AUTOPTR, the functions virSCSIDeviceFree and virSCSIDeviceUsedByInfoFree, respectively, will be run automatically on them when they go out of scope. This commit also adds an intermediate typedef for virUsedByInfo type for use with the cleanup macros. Signed-off-by: NSukrit Bhatnagar <skrtbhtngr@gmail.com> Reviewed-by: NErik Skultety <eskultet@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 2月, 2017 1 次提交
-
-
由 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.
-
- 15 12月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
We will need this function in near future so that we know what /dev device corresponds to the SCSI device. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 24 6月, 2016 3 次提交
-
-
由 Ján Tomko 提交于
Switch from opendir to virDirOpen everywhere we need to report an error.
-
由 Ján Tomko 提交于
The directories we iterate over are unlikely to contain any entries starting with a dot, other than '.' and '..' which is already skipped by virDirRead.
-
由 Ján Tomko 提交于
Introduce a helper that only calls closedir if DIR* is non-NULL and sets it to NULL afterwards.
-
- 23 6月, 2015 2 次提交
-
-
由 Eric Farman 提交于
The SCSI Architecture Model defines a logical unit address as 64-bits in length, so change the field accordingly so that the entire value could be stored. Signed-off-by: NEric Farman <farman@linux.vnet.ibm.com>
-
由 Eric Farman 提交于
The address elements are all unsigned integers, so we should use the appropriate print directive when printing it. Signed-off-by: NEric Farman <farman@linux.vnet.ibm.com>
-
- 23 6月, 2014 1 次提交
-
-
由 Ján Tomko 提交于
Only three other callers possibly call closedir on a NULL argument. Even though these probably won't be used on FreeBSD where this crashes, let's be nice and only call closedir on an actual directory stream.
-
- 29 4月, 2014 1 次提交
-
-
由 Eric Blake 提交于
In making the conversion to the new API, I fixed a couple bugs: virSCSIDeviceGetSgName would leak memory if a directory unexpectedly contained multiple entries; virNetDevTapGetRealDeviceName could report a spurious error from a stale errno inherited before starting the readdir search. The decision on whether to store the result of virDirRead into a variable is based on whether the end of the loop falls through to cleanup code automatically. In some cases, we have loops that are documented to return NULL on failure, and which raise an error on most failure paths but not in the case where the directory was unexpectedly empty; it may be worth a followup patch to explicitly report an error if readdir was successful but the directory was empty, so that a NULL return always has an error set. * src/util/vircgroup.c (virCgroupRemoveRecursively): Use new interface. (virCgroupKillRecursiveInternal, virCgroupSetOwner): Report readdir failures. * src/util/virfile.c (virFileLoopDeviceOpenSearch) (virFileNBDDeviceFindUnused, virFileDeleteTree): Use new interface. * src/util/virnetdevtap.c (virNetDevTapGetRealDeviceName): Properly check readdir errors. * src/util/virpci.c (virPCIDeviceIterDevices) (virPCIDeviceFileIterate, virPCIGetNetName): Report readdir failures. (virPCIDeviceAddressIOMMUGroupIterate): Use new interface. * src/util/virscsi.c (virSCSIDeviceGetSgName): Report readdir failures, and avoid memory leak. (virSCSIDeviceGetDevName): Report readdir failures. * src/util/virusb.c (virUSBDeviceSearch): Report readdir failures. * src/util/virutil.c (virGetFCHostNameByWWN) (virFindFCHostCapableVport): Report readdir failures. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 25 3月, 2014 1 次提交
-
-
由 Ján Tomko 提交于
-
- 18 3月, 2014 1 次提交
-
-
由 Daniel P. Berrange 提交于
Any source file which calls the logging APIs now needs to have a VIR_LOG_INIT("source.name") declaration at the start of the file. This provides a static variable of the virLogSource type. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 08 3月, 2014 1 次提交
-
-
由 John Ferlan 提交于
This resolves a Coverity RESOURCE_LEAK issue introduced by commit id 'de6fa535' where the virSCSIDeviceSetUsedBy() didn't VIR_FREE the 'copy' or possibly VIR_STRDUP()'d values. It also ensures that the VIR_APPEND_ELEMENT is successful...
-
- 04 3月, 2014 1 次提交
-
-
由 Chunyan Liu 提交于
Specify which driver and which domain in used_by area to avoid conflict among different drivers. Signed-off-by: NChunyan Liu <cyliu@suse.com>
-
- 26 2月, 2014 1 次提交
-
-
由 Nehal J Wani 提交于
While running virscsitest, it was found that valgrind pointed out the following memory leak: ==320== 5 bytes in 1 blocks are definitely lost in loss record 4 of 37 ==320== at 0x4A069EE: malloc (vg_replace_malloc.c:270) ==320== by 0x3E6CE81171: strdup (strdup.c:43) ==320== by 0x4CB28DF: virStrdup (virstring.c:554) ==320== by 0x4CAC987: virSCSIDeviceSetUsedBy (virscsi.c:289) ==320== by 0x402321: test2 (virscsitest.c:100) ==320== by 0x403231: virtTestRun (testutils.c:199) ==320== by 0x402121: mymain (virscsitest.c:180) ==320== by 0x4039AD: virtTestMain (testutils.c:782) ==320== by 0x3E6CE1ED1C: (below main) (libc-start.c:226) ==320== Introduced by commit fd243fc4. Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
- 30 1月, 2014 3 次提交
-
-
由 Osier Yang 提交于
Commit 10c9ceff intended to introduce new argument for the testing purpose, but it missed the similar changing of the device's sg_path. The problem was hidden since my laptop has the /dev/sg0 and /dev/sg1. A later patch will modify the tests accordingly. Signed-off-by: NOsier Yang <jyang@redhat.com> Reported-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Osier Yang 提交于
To support passing the path of the test data to the utils, one more argument is added to virSCSIDeviceGetSgName, virSCSIDeviceGetDevName, and virSCSIDeviceNew, and the related code is changed accordingly. Later tests for the scsi utils will be based on this patch. Signed-off-by: NOsier Yang <jyang@redhat.com>
-
由 Osier Yang 提交于
It doesn't make sense to fail if the SCSI host device is specified as "shareable" explicitly between domains (NB, it works if and only if the device is specified as "shareable" for *all* domains, otherwise it fails). To fix the problem, this patch introduces an array for virSCSIDevice struct, which records all the names of domain which are using the device (note that the recorded domains must specify the device as shareable). And the change on the data struct brings on many subsequent changes in the code. Prior to this patch, the "shareable" tag didn't work as expected, it actually work like "non-shareable". So this patch also added notes in formatdomain.html to declare the fact. * src/util/virscsi.h: - Remove virSCSIDeviceGetUsedBy - Change definition of virSCSIDeviceGetUsedBy and virSCSIDeviceListDel - Add virSCSIDeviceIsAvailable * src/util/virscsi.c: - struct virSCSIDevice: Change "used_by" to be an array; Add "n_used_by" as the array count - virSCSIDeviceGetUsedBy: Removed - virSCSIDeviceFree: frees the "used_by" array - virSCSIDeviceSetUsedBy: Copy the domain name to avoid potential memory corruption - virSCSIDeviceIsAvailable: New - virSCSIDeviceListDel: Change the logic, for device which is already in the list, just remove the corresponding entry in "used_by". And since it's only used in one place, we can safely removing the code to find out the dev in the list first. - Copyright updating * src/libvirt_private.sys: - virSCSIDeviceGetUsedBy: Remove - virSCSIDeviceIsAvailable: New * src/qemu/qemu_hostdev.c: - qemuUpdateActiveScsiHostdevs: Check if the device existing before adding it to the list; - qemuPrepareHostdevSCSIDevices: Error out if the not all domains use the device as "shareable"; Also don't try to add the device to the activeScsiHostdevs list if it already there; And make more sensible error w.r.t the current "shareable" value in driver->activeScsiHostdevs. - qemuDomainReAttachHostScsiDevices: Change the logic according to the changes on helpers. Signed-off-by: NOsier Yang <jyang@redhat.com>
-
- 23 1月, 2014 2 次提交
-
-
由 Osier Yang 提交于
Left in the git cache without commit before pushing. Pushed under build breaker and trivial rule.
-
由 Osier Yang 提交于
Unlike the host devices of other types, SCSI host device XML supports "shareable" tag. This patch introduces it for the virSCSIDevice struct for a later patch use (to detect if the SCSI device is shareable when preparing the SCSI host device in QEMU driver).
-
- 08 1月, 2014 1 次提交
-
-
由 Osier Yang 提交于
Like commit 94a26c7e from Eric Blake, the old fuzzy code should be replaced by the new array management macros now. And the type of scsi->count should be changed into "size_t", and thus virSCSIDeviceListCount should return size_t instead, similar for vir{PCI,USB}DeviceListCount.
-
- 30 9月, 2013 1 次提交
-
-
由 Boris Fiuczynski 提交于
Fixed the retrieval of the AdapterId from the AdapterName of the hostdev source so it does return an error instead of leaving the adapter_id uninitialized. Signed-off-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com> Reviewed-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
-
- 16 9月, 2013 1 次提交
-
-
由 Peter Krempa 提交于
Semantics of the libvirt helper are more clear. This change also allows to clean up some pieces of code.
-
- 11 7月, 2013 1 次提交
-
-
由 Daniel P. Berrange 提交于
Convert the type of loop iterators named 'i', 'j', k', 'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or 'unsigned int', also santizing 'ii', 'jj', 'kk' to use the normal 'i', 'j', 'k' naming Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 10 7月, 2013 1 次提交
-
-
由 Michal Privoznik 提交于
-
- 09 7月, 2013 1 次提交
-
-
由 Viktor Mihajlovski 提交于
The device bus value was used instead of the device target when building the sysfs device path. Trivial. Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
-
- 24 5月, 2013 1 次提交
-
-
由 Michal Privoznik 提交于
-