- 05 3月, 2020 2 次提交
-
-
由 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 6 次提交
-
-
由 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>
-
由 Daniel Henrique Barboza 提交于
qemuSetupCgroupVcpuBW() and lxcSetVcpuBWLive() shares the same code to set CPU CFS period and quota. This code can be moved to a new virCgroupSetupCpuPeriodQuota() helper to avoid code repetition. A similar code is also executed in virLXCCgroupSetupCpuTune(), but without the rollback on error. Use the new helper in this function as well since the 'period' rollback, if not a straight improvement for virLXCCgroupSetupCpuTune(), is benign. And we end up cutting more code repetition. 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>
-
由 Daniel Henrique Barboza 提交于
The code that calls virCgroupSetCpuShares() and virCgroupGetCpuShares() is repeated in 4 different places. Let's put it in a new virCgroupSetupCpuShares() to avoid code repetition. There's a reason of why we execute a Get in the same value we just executed Set, explained in detail by commit 97814d8a. Let's add a gist of the reasoning behind it as a comment in this new function as well. 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>
-
由 Daniel Henrique Barboza 提交于
The code from qemuSetupCgroupCpusetCpus() and virLXCCgroupSetupCpusetTune() can be centralized in a new helper called virCgroupSetupCpusetCpus(). 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>
-
由 Daniel Henrique Barboza 提交于
Previous patch moved all duplicated code that were setting and getting BlkioDevice parameters to vircgroup.c. We can turn them into static and spare a few symbols in libvirt_private.syms. 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>
-
由 Daniel Henrique Barboza 提交于
The current use of the functions that set and get BlkioDevice attributes is doing a set(), followed by a get() of the same parameter right after. This is done because there is no guarantee that the kernel will accept the desired value given by the set() call, thus we need to execute a get() right after to get the actual value. This patch adds helpers inside vircgroup.c to execute these operations. Next patch will use these helpers to reduce code repetition in LXC and QEMU files. 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>
-
- 21 2月, 2020 2 次提交
-
-
由 Laine Stump 提交于
This patch pushes the isolatedPort setting from the <interface> down all the way to the callers of virNetDevBridgeAddPort(), and sets BR_ISOLATED on the port (using virNetDevBridgePortSetIsolated()) after the port has been successfully added to the bridge. Signed-off-by: NLaine Stump <laine@redhat.com> Signed-off-by: NLaine Stump <laine@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Laine Stump 提交于
When this flag is set for an interface attached to a bridge, traffic to/from the specified interface can only enter/exit the bridge via another attached interface that *doesn't* have the BR_ISOLATED flag set. This can be used to permit guests to communicate with the rest of the network, but not with each other. Signed-off-by: NLaine Stump <laine@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 20 2月, 2020 8 次提交
-
-
由 Michal Privoznik 提交于
The virPidFileReadPath() function is supposed to return 0 on success or a negative value on failure. But the negative value has a special meaning - it's negated errno. Therefore, when converting string to int we shouldn't return -1 which translates to EPERM. Returning EINVAL looks closer to the truth. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
There's nothing to clean up. Make it obvious what is returned. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com>
-
由 Peter Krempa 提交于
Extract the code that directly deals with storage. This allows further simplification and clarification of virStorageFileGetMetadataRecurse. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com>
-
由 Peter Krempa 提交于
Replacing virHashLookup by virHashHasEntry allows us to use NULL as the payload of the hash table rather than putting a fake '1' pointer into the table. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com>
-
由 Peter Krempa 提交于
The path can be NULL e.g. for NBD disks. Use NULLSTR to prevent use of NULL in %s. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com>
-
由 Peter Krempa 提交于
Move the assignment to a place where we know that the backing store is present rather than having to check in the cleanup section. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com>
-
由 Peter Krempa 提交于
We call virStorageFileSupportsBackingChainTraversal which already checks that the 'storageFileRead' callback is non-NULL, which in turn means that virStorageFileRead will not return -2. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com>
-
由 Peter Krempa 提交于
Probing by file suffix was meant to be a last resort if probing by contents fails or is not supported. For most formats we never specified any suffix. There's a few formats implementing both magic bytes and suffix and finally DMG which had only suffix probing. Since suffix probing is nowhere reliable and only one format depends on in which has a comment that qemu doesn't do the probing either drop the whole infrastructure. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com>
-
- 14 2月, 2020 1 次提交
-
-
由 Peter Krempa 提交于
If the parsed 'raw' format JSON string has 'offset' or 'size' attributes parse them as the format slice. https://bugzilla.redhat.com/show_bug.cgi?id=1791788Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-