- 16 3月, 2020 2 次提交
-
-
由 Peter Krempa 提交于
Add possibility to specify one or more cookies for http based disks. This patch adds the config parser, storage and validation of the cookies. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
To allow turning off verification of SSL cerificates add a new element <ssl> to the disk source XML which will allow configuring the validation process using the 'verify' attribute. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 14 3月, 2020 2 次提交
-
-
由 Ján Tomko 提交于
Now that we use g_strerror exclusively, remove this unused function. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Ján Tomko 提交于
Remove lots of stack-allocated buffers. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 13 3月, 2020 1 次提交
-
-
由 Daniel P. Berrangé 提交于
The stub impl of virGetDeviceID just returns ENOSYS and does not initialize the min/maj output parameters. This lead to a false positive warning on mingw about possible use of uninitialized variables. Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 12 3月, 2020 1 次提交
-
-
由 Michal Privoznik 提交于
If a disk has persistent reservations enabled, qemu-pr-helper might open not only /dev/mapper/control but also individual targets of the multipath device. We are already querying for them in CGroups, but now we have to create them in the namespace too. This was brought up in [1]. 1: https://bugzilla.redhat.com/show_bug.cgi?id=1711045#c61Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Tested-by: NLin Ma <LMa@suse.com> Reviewed-by: NJim Fehlig <jfehlig@suse.com>
-
- 11 3月, 2020 3 次提交
-
-
由 Daniel P. Berrangé 提交于
We want a way to easily run a private GMainContext in a thread, with correct synchronization between startup and shutdown of the thread. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Michal Privoznik 提交于
The virbpf module wraps syscalls to BPF. However, if the kernel headers used at the compile time don't have support for BPF the module offers stubs which return a negative one to signal error to the caller. But there is a slight discrepancy between real functions and these stubs. While the former set errno and return -1 the latter report an error (without setting the errno) and return -1. This is not optimal because the caller might see stale errno and overwrite the error message with a less accurate one. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
In the virCgroupV2DevicesAvailable() function we try to determine whether CGroups version 2 are available. We do this by opening what we believe is the CGroup mount point and issuing a BPF call. When the call fails, a debug message is printed. However, the BPF call sets errno too. Include it in the debug message to help us with debugging. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
- 07 3月, 2020 2 次提交
-
-
由 Ján Tomko 提交于
Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Ján Tomko 提交于
Virtualization event types were added in 2.0.5: https://github.com/linux-audit/audit-userspace/commit/3755e9ff Even Ubuntu 14.04 (which we don't support) has 2.3.2. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
- 06 3月, 2020 2 次提交
-
-
由 Michal Privoznik 提交于
When spawning a thread via our virThread APIs we let pthread spawn this helper thread which sets couple of thread local variables (e.g. thread job name or thread worker name) and as of v6.1.0-40-gc85256b3 it also sets pthread name (which is then visible in `ps' output for instance). Only after these steps the intended function is called. However, just before calling it we free the buffer that holds the thread name which results in invalid memory reads: ==47027== Invalid read of size 1 ==47027== at 0x48389C2: strlen (vg_replace_strmem.c:459) ==47027== by 0x58BB3D6: __vfprintf_internal (vfprintf-internal.c:1645) ==47027== by 0x58CE6E0: __vasprintf_internal (vasprintf.c:57) ==47027== by 0x574BA28: g_vasprintf (in /usr/lib64/libglib-2.0.so.0.6000.7) ==47027== by 0x57240CC: g_strdup_vprintf (in /usr/lib64/libglib-2.0.so.0.6000.7) ==47027== by 0x48E0EFA: vir_g_strdup_vprintf (glibcompat.c:209) ==47027== by 0x493AA05: virLogVMessage (virlog.c:573) ==47027== by 0x493A8FE: virLogMessage (virlog.c:513) ==47027== by 0x4992FC7: virThreadJobClear (virthreadjob.c:121) ==47027== by 0x4992844: virThreadHelper (virthread.c:237) ==47027== by 0x5817496: start_thread (pthread_create.c:486) ==47027== by 0x59563CE: clone (clone.S:95) The problem is that neither virThreadJobSetWorker() nor virThreadJobSet() create a copy of passed name. They just set a thread local variable to point to the buffer which is then freed. Moving the free towards the end of the wrapper function solves the issue. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Ján Tomko 提交于
Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
-
- 05 3月, 2020 5 次提交
-
-
由 Peter Krempa 提交于
Our implementation masks GCC warnings of uninitialized use of the passed argument. After changing this I got a load of following warnings: src/conf/virnetworkportdef.c: In function 'virNetworkPortDefSaveStatus': /usr/include/glib-2.0/glib/gmem.h:136:8: error: 'path' may be used uninitialized in this function [-Werror=maybe-uninitialized] 136 | if (_p) \ | ^ src/conf/virnetworkportdef.c:447:11: note: 'path' was declared here 447 | char *path; | ^~~~ For the curious, g_clear_pointer is still safe for arguments with side-effect. Here's the pre-processed output of trying to do a VIR_FREE(*(test2++)): do { typedef char _GStaticAssertCompileTimeAssertion_1[(sizeof *(&(*(test2++))) == sizeof (gpointer)) ? 1 : -1] __attribute__((__unused__)); __typeof__((&(*(test2++)))) _pp = (&(*(test2++))); __typeof__(*(&(*(test2++)))) _ptr = *_pp; *_pp = ((void *)0); if (_ptr) (g_free) (_ptr); } while (0) ; Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Daniel P. Berrangé 提交于
On FreeBSD the non-portable pthread APIs need to be obtained via the pthread_np.h header. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Historically threads are given a name based on the C function, and this name is just used inside libvirt. With OS level thread naming this name is now visible to debuggers, but also has to fit in 15 characters on Linux, so function names are too long in some cases. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Setting the thread name makes it easier to debug libvirtd when many threads are running. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Peter Krempa 提交于
Make it obvious that the function always returns a valid pointer and fix all callers. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
- 26 2月, 2020 1 次提交
-
-
由 Peter Krempa 提交于
Allow format probing to work around lazy clients which did not specify their format in the overlay. Format probing will be allowed only, if we are able to probe the image, the probing result was successful and the probed image does not have any backing or data file. This relaxes the restrictions which were imposed in commit 3615e8b3 in cases when we know that the image probing will not result in security issues or data corruption. We perform the image format detection and in the case that we were able to probe the format and the format does not specify a backing store (or doesn't support backing store) we can use this format. With pre-blockdev configurations this will restore the previous behaviour for the images mentioned above as qemu would probe the format anyways. It also improves error reporting compared to the old state as we now report that the backing chain will be broken in case when there is a backing file. In blockdev configurations this ensures that libvirt will not cause data corruption by ending the chain prematurely without notifying the user, but still allows the old semantics when the users forgot to specify the format. Users thus don't have to re-invent when image format detection is safe to do. The price for this is that libvirt will need to keep the image format detector still current and working or replace it by invocation of qemu-img. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 25 2月, 2020 11 次提交
-
-
由 Daniel P. Berrangé 提交于
The virutil.h header defines a geteuid() macro for Windows platforms. This fixes a few missed cases from: commit b11e8ccc Author: Ján Tomko <jtomko@redhat.com> Date: Sun Feb 16 23:09:15 2020 +0100 Remove virutil.h from all header files Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Ján Tomko 提交于
After the split of enum functions into virenum.h, this function does not contain anything worth including in another header file. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Ján Tomko 提交于
Include virutil.h in all files that use it, instead of relying on it being pulled in somehow. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Ján Tomko 提交于
Include unistd.h in all files that use it, instead of relying on it being pulled in via virutil.h Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Ján Tomko 提交于
Include both virutil.h and unistd.h. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Ján Tomko 提交于
There is nothing in the vircgroup.h header file requiring virutil.h. Remove it and include unistd.h in the C files. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Ján Tomko 提交于
Historically, this file was a dump for most of our helper functions and needed almost everywhere. With the introduction of virfile.h and virstring.h, and more importantly, virenum.h and the introduction of GLib, that is no longer true. Remove its include from C files that don't even use it. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Ján Tomko 提交于
Now that it is no longer used. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NLaine Stump <laine@redhat.com>
-
由 Ján Tomko 提交于
Replace it by g_ascii_xdigit_value. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NLaine Stump <laine@redhat.com>
-
由 Ján Tomko 提交于
Prefer g_ascii_xdigit_value to virHexToBin. Check the return value of the function and remove the g_ascii_isxdigit calls, since they're done anyway internally. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NLaine Stump <laine@redhat.com>
-
由 Ryan Moeller 提交于
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com> Signed-off-by: NRyan Moeller <ryan@iXsystems.com>
-
- 24 2月, 2020 9 次提交
-
-
由 Ján Tomko 提交于
Just like virhostdev, this depends on domain_conf and it's shared by multiple hypervisor drivers. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Ján Tomko 提交于
This module depends on domain_conf and is used directly by various hypervisor drivers. Move it to src/hypervisor. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Ján Tomko 提交于
Currently they live in util/virhostdev. However the virhostdev module is wrongly placed in util, which is below conf/ in our hierarchy. Move the functions that are actually used in conf/ to conf/ and remove the include of virhostdev.h from domain_conf. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Peter Krempa 提交于
Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
None of the callers actually use it. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
When we create the new virStorageSource from the definitions stored in the parent we should also use the 'backingStoreRawFormat' field to populate the format. Callers which use virStorageSourceNewFromBacking are also fixed to stop setting the format manually. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
We store the backing file string in the structure so we should also store the format so that callers can be simplified. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Both callers pass false. Since we frown upon format probing, remove the unused possibility to do the probing. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Ján Tomko 提交于
To more closely match the previous usage in virEventPollDispatchHandles, where called the handle callback for any revents returned by poll. This should fix the virtlogd error on subsequent domain startup: error: can't connect to virtlogd: Cannot open log file: '/var/log/libvirt/qemu/f28live.log': Device or resource busy as well as virtlogd spinning caused by virLogHandlerDomainLogFileEvent never being called on hangup. Signed-off-by: NJán Tomko <jtomko@redhat.com> Fixes: f8ab47cb Fixes: 946a2527Tested-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 23 2月, 2020 1 次提交
-
-
由 Daniel Henrique Barboza 提交于
Another vircgroup helper to avoid code repetition between the LXC and QEMU driver. Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-