- 07 6月, 2016 10 次提交
-
-
由 Ján Tomko 提交于
-
由 Ján Tomko 提交于
This speeds up node_device_udev driver startup 11x.
-
由 Ján Tomko 提交于
Simplify the logic
-
由 Ján Tomko 提交于
Move out the code depending on HAVE_DECL_ETHTOOL_GFEATURES.
-
由 Ján Tomko 提交于
Split out the features that we probe via various ethtool commands and ETHTOOL_GFLAGS.
-
由 Ján Tomko 提交于
Rename struct elem to virNetDevEthtoolFeatureCmd and move it out of the function to allow reusing it.
-
由 Ján Tomko 提交于
-
由 John Ferlan 提交于
Rather than intermixing the ATTRIBUTE_UNUSED - use HAVE_GNUTLS_CIPHER_ENCRYPT for the whole function instead.
-
由 Daniel P. Berrange 提交于
The sd_notify method is used to tell systemd when libvirtd has finished starting up. All it does is send a datagram containing the string parameter to systemd on a UNIX socket named in the NOTIFY_SOCKET environment variable. Rather than pulling in the systemd libraries for this, just code the notification directly in libvirt as this is a stable ABI from systemd's POV which explicitly allows independant implementations: See "Reimplementable Independently" column in the "$NOTIFY_SOCKET Daemon Notifications" row: https://www.freedesktop.org/wiki/Software/systemd/InterfacePortabilityAndStabilityChart/ Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1314881Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 John Ferlan 提交于
Move the module from qemu_command.c to a new module virqemu.c and rename the API to virQEMUBuildObjectCommandline. This API will then be shareable with qemu-img and the need to build a security object for luks support. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 06 6月, 2016 1 次提交
-
-
由 John Ferlan 提交于
Bring style more in line with more recent code. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 03 6月, 2016 3 次提交
-
-
由 Martin Kletzander 提交于
When building using -Og, gcc sees that some variables can be used uninitialized It can be debatable whether it is possible with our codeflow, but functions should be self-contained and initializations are always good. The return instead of goto is due to actualType being used in the cleanup. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Michal Privoznik 提交于
So imagine the following. You connect read only to a daemon and try to fetch stats for a shut off domain, e.g.: virsh -r domstats $dom but all of a sudden, virsh instead of printing the stats throws the following error at you: error: Disconnected from qemu:///system due to I/O error error: End of file while reading data: Input/output error The daemon crashed. This is its backtrace: #0 0x00007fa43e3751a8 in virPerfEventIsEnabled (perf=0x0, type=VIR_PERF_EVENT_MBMT) at util/virperf.c:241 #1 0x00007fa424a9f042 in qemuDomainGetStatsPerf (driver=0x7fa3f4022a30, dom=0x7fa3f40e24c0, record=0x7fa41c000e20, maxparams=0x7fa4360b38d0, privflags=1) at qemu/qemu_driver.c:19110 #2 0x00007fa424a9f2e7 in qemuDomainGetStats (conn=0x7fa41c001b20, dom=0x7fa3f40e24c0, stats=127, record=0x7fa4360b3970, flags=1) at qemu/qemu_driver.c:19213 #3 0x00007fa424a9f672 in qemuConnectGetAllDomainStats (conn=0x7fa41c001b20, doms=0x7fa41c0017f0, ndoms=1, stats=127, retStats=0x7fa4360b3a50, flags=0) at qemu/qemu_driver.c:19303 #4 0x00007fa43e4e15f6 in virDomainListGetStats (doms=0x7fa41c0017f0, stats=0, retStats=0x7fa4360b3a50, flags=0) at libvirt-domain.c:11615 Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7f28d1a38700 (LWP 16154)] 0x00007f28da4fa1a8 in virPerfEventIsEnabled (perf=0x0, type=VIR_PERF_EVENT_MBMT) at util/virperf.c:241 241 return event->enabled; Problem is, shut off domains don't have priv->perf allocated. Therefore if in frame #1 qemuDomainGetStatsPerf() tries to check if perf events are enabled, NULL is passed to virPerfEventIsEnabled() which due to some incredible implementation dereference it. Fix this by checking whether passed object is not NULL. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
This function is not used anywhere. Moreover, the code that would use lives in virperf.c and therefore has access to the FD anyway. Well, for instance virPerfReadEvent is doing just that. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 02 6月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
So far, this function has just three callers. Two of them call virNetDevSetupControl to create a socket that we can then optionally use for ioctl() to fetch data. However, querying sysfs is preferred. Therefore it doesn't make much sense to require users to set up the socket if they don't even know it will be used in favour of sysfs. We can set up the socket iff we need to. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 30 5月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
Yet another one of those where signed int (or long int) is not enough. And useless to as we're aiming at unsigned anyway. ../../src/util/virsocketaddr.c: In function 'virSocketAddrIsPrivate': ../../src/util/virsocketaddr.c:289:45: error: result of '192l << 24' requires 33 bits to represent, but 'long int' only has 32 bits [-Werror=shift-overflow=] return ((val & 0xFFFF0000) == ((192L << 24) + (168 << 16)) || ^~ ../../src/util/virsocketaddr.c:290:45: error: result of '172l << 24' requires 33 bits to represent, but 'long int' only has 32 bits [-Werror=shift-overflow=] (val & 0xFFF00000) == ((172L << 24) + (16 << 16)) || ^~ cc1: all warnings being treated as errors Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 28 5月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
Apparently, 1 << 31 is signed which in turn does not fit into a signed integer variable: ../../include/libvirt/libvirt-domain.h:1881:57: error: result of '1 << 31' requires 33 bits to represent, but 'int' only has 32 bits [-Werror=shift-overflow=] VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS = 1 << 31, /* enforce requested stats */ ^~ cc1: all warnings being treated as errors The solution is to make it an unsigned value. I've found only two such occurrences in our code base. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 25 5月, 2016 3 次提交
-
-
由 Andrea Bolognani 提交于
Commit c8b1a836 changed the function, making it impossible for callers to be able to tell whether a non-negative return value means "physical function address found and parsed correctly" or "couldn't find corresponding physical function". The important difference between the two being that, in the latter case, the returned pointer is NULL and should never, ever be dereferenced. In order to cope with these changes, the callers have to be updated.
-
由 Andrea Bolognani 提交于
-
由 Andrea Bolognani 提交于
Just an extra precaution in case the function returns early due to an OOM error.
-
- 22 5月, 2016 1 次提交
-
-
由 Mikhail Feoktistov 提交于
-
- 20 5月, 2016 7 次提交
-
-
由 John Ferlan 提交于
Move the logic from qemuDomainGenerateRandomKey into this new function, altering the comments, variable names, and error messages to keep things more generic. NB: Although perhaps more reasonable to add soemthing to virrandom.c. The virrandom.c was included in the setuid_rpc_client, so I chose placement in vircrypto.
-
由 John Ferlan 提交于
Introduce virCryptoHaveCipher and virCryptoEncryptData to handle performing encryption. virCryptoHaveCipher: Boolean function to determine whether the requested cipher algorithm is available. It's expected this API will be called prior to virCryptoEncryptdata. It will return true/false. virCryptoEncryptData: Based on the requested cipher type, call the specific encryption API to encrypt the data. Currently the only algorithm support is the AES 256 CBC encryption. Adjust tests for the API's
-
由 John Ferlan 提交于
Seems recent versions of Coverity have (mostly) resolved the issue using ternary operations in VIR_FREE (and now VIR_DISPOSE*) macros. So let's just remove it and if necessary handle one off issues as the arise.
-
由 John Ferlan 提交于
Rather than return 0/-1 and/or a pointer to some memory, adjust the helper to just return the allocated structure or NULL on failure. Adjust the callers in order to handle that Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Since the callers only ever expect 0 or -1, let's just return that directly Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
If we get to the error: label and clear out the *virtual_functions[] pointers and then return w/ error to the caller - the caller has it's own cleanup of the same array in the out: label which is keyed off the value of num_virt_fns, which wasn't reset to 0 in the called function leading to a possible problem. Just clear the value (found by Coverity) Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Jovanka Gulicoska 提交于
Convert to virGetLastErrorMessage() in the rest of the code
-
- 19 5月, 2016 1 次提交
-
-
由 Qiaowei Ren 提交于
Some Intel processor families (e.g. the Intel Xeon processor E5 v3 family) introduced some RDT (Resource Director Technology) features to monitor or control shared resource. Among these features, MBM (Memory Bandwidth Monitoring), which is build on the CMT (Cache Monitoring Technology) infrastructure, provides OS/VMM a way to monitor bandwidth from one level of cache to another. With current perf framework, this patch adds support to perf event for MBM. Signed-off-by: NQiaowei Ren <qiaowei.ren@intel.com>
-
- 18 5月, 2016 5 次提交
-
-
由 John Ferlan 提交于
No longer necessary to have it, so remove it.
-
由 Fritz Elfert 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1331552 Instead of disabling auto-login of all scsi targets (even those that do not "belong" to libvirt), use iscsiadm's "--op nonpersistent" during discovery of iSCSI targets (e.g. "iscsiadm --mode discovery --type sendtargets") in order to avoid the node database being altered which led to the need for the "large hammer" approach taken by commit id '3c12b654'. This commit removes the virISCSITargetAutologin adjustment (eg. the setting of node.startup to "manual"). The iscsiadm command has supported this mode of operation as of commit id 'ad873767' to open-iscsi.
-
由 John Ferlan 提交于
Utilize the exit status parameter for virCommandRunRegex in order to check the return error from the 'iscsiadm --mode session' command. Without this enabled, if there are no sessions running then virCommandRun would have displayed an error such as: 2016-05-13 15:17:15.165+0000: 10920: error : virCommandWait:2553 : internal error: Child process (iscsiadm --mode session) unexpected exit status 21: iscsiadm: No active sessions. It is possible that for certain paths (when probe is true) we only care whether it's running or not to make certain decisions. Spitting out the error for those paths is unnecessary. If we do have a situation where probe = false and there's an error, then display the error from iscsiadm if it's there.
-
由 John Ferlan 提交于
Rather than have virCommandRun just spit out the error, allow callers to decide to pass the exitstatus so the caller can make intelligent decisions based on the error.
-
由 Jiri Denemark 提交于
The INPLACE variants of the VIR_APPEND macros cannot fail and they are inherently quiet.
-
- 16 5月, 2016 3 次提交
-
-
由 John Ferlan 提交于
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Peter Krempa 提交于
Add a new helper that sanitizes error semantics of base64_encode_alloc.
-
由 Peter Krempa 提交于
For a few cases where we handle secret information it's good to clear the buffers containing sensitive data before freeing them. Introduce VIR_DISPOSE, VIR_DISPOSE_N and VIR_DISPOSE_STRING that allow simple clearing fo the buffers holding sensitive information on cleanup paths.
-
- 13 5月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
Move some parts of virStorageFileRemoveLastPathComponent into a separate function so they can be reused. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 12 5月, 2016 1 次提交
-
-
由 Erik Skultety 提交于
Both virGetLastError and virGetLastErrorMessage call virLastErrorObject method that returns a thread-local error object. However, if a direct call to malloc or pthread_setspecific (probably also due to malloc, since it sets ENOMEM) fail, virLastErrorObject returns NULL which, although incorrectly interpreted by virGetLastError as no error, still requires the caller to check for NULL pointer. This isn't the case with virGetLastErrorMessage that also treated it incorrectly as no error, but returned the literal "no error". This patch tweaks the checks in the virGetLastErrorMessage function, so that if virLastErrorObject failed, it returned "unknown error" which is equivalent to the current approach with virGetLastError and if it returned NULL, "unknown error" was set. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
- 11 5月, 2016 1 次提交
-
-
由 John Ferlan 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1318993 Commit id 'dd519a29' caused a regression cloning a volume into a logical pool by removing just the 'allocation' adjustment during storageVolCreateXMLFrom. Combined with the change to not require the new volume input XML to have a capacity listed (commit id 'e3f1d2a8') left the possibility that a zero allocation value (e.g., not provided) would create a thin/sparse logical volume. When a thin lv becomes fully populated, then LVM sets the partition 'inactive' and the subsequent fdatasync() fails. Add a new 'has_allocation' flag to be set at XML parse time to indicate that allocation was provided. This is done so that if it's not provided the create-from code uses the capacity value since we document that if omitted, the volume will be fully allocated at time of creation. For a logical backend, that creation time is 'createVol', while for a file backend, creation doesn't set the size, but the 'createRaw' called during buildVolFrom will decide whether the file is sparse or not based on the provided capacity and allocation value. For volume clones that provide different allocation and capacity values to allow for sparse files, there is no change.
-