- 10 4月, 2019 2 次提交
-
-
由 Peter Krempa 提交于
Keeping them with viralloc.h forcibly pulls in the other stuff from viralloc.h into other header files. This in turn creates a mess as more and more headers pull in the 'viral' header file. If we want to make 'viralloc.h' omnipresent we should pick a different approach. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Han Han 提交于
Define VMX_CONFIG_FORMAT_ARGV to replace the hardcoded 'vmware-vmx' string used by the domxml-X-native APIs. This follows the pattern used by other drivers. Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NHan Han <hhan@redhat.com>
-
- 09 4月, 2019 4 次提交
-
-
由 Peter Krempa 提交于
Now that the memory disposal is handled automatically we can simplify the cleanup paths. In this case it's not as simple as sometimes the value of the called function is returned. While at it fix the initialization value of the returned variable. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Pavel Hrdina 提交于
The later is the correct CPU model name. Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Julio Faracco 提交于
This commit fixes an unitialized variable to avoid garbage value when virNetDevBridgeGet method returns error. When, that method fails before initialize 'val' variable, it can cause problems related to that. Signed-off-by: NJulio Faracco <jcfaracco@gmail.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
由 Eric Blake 提交于
Commit b647d219 introduced a use-after-free situation when the caller is trying to delete a snapshot and its children: if the callback function deletes the parent, it is no longer safe to query the parent to learn which children also need to be deleted (where we previously saved deleting the parent for last). To fix the problem, while still maintaining support for topological visits of callback functions, we have to stash off any information needed for later traversal prior to using a callback function (virDomainMomentForEachChild already does this, it is only virDomainMomentActOnDescendant that was running into problems). Sadly, the testsuite did not cover the problem at the time. Worse, even though I later added commit 280a2b41 to catch problems like this, and even though that test is indeed sufficient to detect the problem when run under valgrind or suitable MALLOC_PERTURB_ settings, I'm guilty of not running the test in such an environment. Thus, v5.2.0 has a regression that could have been prevented had we used the testsuite to its full power. On the bright side, deleting snapshots requires ACL domain:snapshot, which is arguably as powerful as domain:write, so I don't think this use-after-free forms a security hole. At some point, it would be nice to convert virDomainMomentObj into a virObject, at which point, the solution is even simpler: add virObjectRef/Unref around the callback. But as that will require auditing even more places in the code, I went with the simplest patch for the regression fix. Fixes: b647d219Reported-by: NRoman Bogorodskiy <bogorodskiy@gmail.com> Signed-off-by: NEric Blake <eblake@redhat.com> Tested-by: NRoman Bogorodskiy <bogorodskiy@gmail.com>
-
- 08 4月, 2019 2 次提交
-
-
由 Jiri Denemark 提交于
A feature with no cpuid element is invalid and it should not be silently treated as a feature with all CPUID bits set to zero. Signed-off-by: NJiri Denemark <jdenemar@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Jiri Denemark 提交于
The microcode version checks are used to invalidate cached CPU data we get from QEMU. To minimize /proc/cpuinfo parsing the microcode version was only read when libvirtd started and cached for the daemon's lifetime. However, the CPU microcode can change anytime (updating the microcode package can automatically upload it to the CPU) and we need to stop caching it to avoid using stale CPU model data. Signed-off-by: NJiri Denemark <jdenemar@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 06 4月, 2019 1 次提交
-
-
由 Peter Krempa 提交于
This helper has solely to do with virObjects. Move it together with other virObject stuff. This also avoids the potential problem where VIR_AUTOUNREF uses virObjectAutoUnref which is defined in virobject.h. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 05 4月, 2019 4 次提交
-
-
由 Cole Robinson 提交于
Acked-by: NEric Blake <eblake@redhat.com> Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
由 Cole Robinson 提交于
Acked-by: NEric Blake <eblake@redhat.com> Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
由 Cole Robinson 提交于
Acked-by: NEric Blake <eblake@redhat.com> Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
由 Cole Robinson 提交于
Acked-by: NEric Blake <eblake@redhat.com> Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
- 04 4月, 2019 7 次提交
-
-
由 Andrea Bolognani 提交于
The rules are the same for all virt guests, regardless of the architecture. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
由 Andrea Bolognani 提交于
Our PCIe topology depends on the availability of PCIe Root Ports, so if none of the suitable devices (pcie-root-port, ioh3420) is compiled into QEMU we should fall back to virtio-mmio rather than trying to use PCI addresses only to fail immediately afterwards when we realize we can't use the necessary controllers. Note that this additional check is basically moot for ARM virt guests, because PCIe Root Ports were enabled in QEMU builds for the architecture well before guest OS support had been widely available; however, the opposite is true for RISC-V, and tweaking the code this way will allow us to share it between architectures. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
由 Nikolay Shirokovskiy 提交于
Since the STOP event handler can use the pausedReason as sent to qemuProcessStopCPUs, we no longer need to send duplicate suspended lifecycle events because we know what caused the stop along with extra details. This processing allows us to also remove the duplicated state change from qemuProcessStopCPUs. Reviewed-by: NJohn Ferlan <jferlan@redhat.com> Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
由 Nikolay Shirokovskiy 提交于
Map is based on existing cases in code where we send suspended event after changing domain state to paused. Reviewed-by: NJohn Ferlan <jferlan@redhat.com> Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
由 Nikolay Shirokovskiy 提交于
Similar to commit [1] which saves and passes the running reason to the RESUME event handler, during qemuProcessStopCPUs let's save and pass the pause reason in the domain private data so that the STOP event handler can use it. [1] 5dab984e : qemu: Pass running reason to RESUME event handler Reviewed-by: NJohn Ferlan <jferlan@redhat.com> Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
由 Michal Privoznik 提交于
If there are two concurrent threads, one of which is removing an nwfilter from the list and the other is trying to add it back they may serialize in the following order: 1) obj->removing is set and @obj is unlocked. 2) The tread that's trying to add the nwfilter onto the list locks the list and tries to find, if the nwfilter already exists. 3) Our lookup functions say it doesn't, so the thread proceeds to virHashAddEntry() which fails with 'Duplicate key' error. This is obviously not helpful error message at all. The problem lies in our lookup function (virNWFilterBindingObjListFindByPortDevLocked()) which return NULL even if the object is still on the list. They do this so that the object is not mistakenly looked up by some API. The fix consists of moving 'removing' check one level up and thus allowing virNWFilterBindingObjListAddLocked() to produce meaningful error message. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
由 Michal Privoznik 提交于
If there are two concurrent threads, one of which is removing a domain from the list and the other is trying to add it back they may serialize in the following order: 1) vm->removing is set and @vm is unlocked. 2) The tread that's trying to add the domain onto the list locks the list and tries to find, if the domain already exists. 3) Our lookup functions say it doesn't, so the thread proceeds to virHashAddEntry() which fails with 'Duplicate key' error. This is obviously not helpful error message at all. The problem lies in our lookup functions (virDomainObjListFindByUUIDLocked() and virDomainObjListFindByNameLocked()) which return NULL even if the object is still on the list. They do this so that the object is not mistakenly looked up by some driver. The fix consists of moving 'removing' check one level up and thus allowing virDomainObjListAddLocked() to produce meaningful error message. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
- 03 4月, 2019 20 次提交
-
-
由 Peter Krempa 提交于
We have more modern replacements. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Parsing of the cpu affinity list was using virParseNumber. Modernize it to get rid of the virParseNumber call. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
'cpumasklen' is only written to since ee7d23ba. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Unused since 3c269b51Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Michal Privoznik 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1693066 Up until memfd introduction (in 24b74d18) we did not need to know @pagesize because qemuGetDomainHupageMemPath() could deal with it being zero (value of zero means use the default hugetlbfs mount). But since for memfd we are not passing a path to hugetlbfs mount rather the page size value we need to know its value upfront. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Michal Privoznik 提交于
This helper returns the default hugetlbfs mount point from given array of mount points. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Ján Tomko 提交于
Since commit 66460e32 dropped support for YAJL 1, we no longer need these. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com> Acked-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Ján Tomko 提交于
Add ATTRIBUTE_UNUSED to the volStorageBackendRBDGetFlags stub. Fixes: 21deeaf0Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
由 Ján Tomko 提交于
Now that we do not need to cater to YAJL 1, move the check for the return value of yajl_gen_alloc earlier, so that we can assume it was successful in later code. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Ján Tomko 提交于
Now that we require YAJL2, drop the code dealing with YAJL 1. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Nikolay Shirokovskiy 提交于
qemuMigrationSrcPerform callers expect it to call virDomainObjEndAPI in any case so on error paths we miss the virDomainObjEndAPI call. To fix this let's make qemuMigrationSrcPerform callers responsible for the virDomainObjEndAPI call. ACKed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
由 Daniel P. Berrangé 提交于
The d_type field cannot be assumed to be filled. Some filesystems, such as older XFS, will simply report DT_UNKNOWN. Even if the d_type is filled in, the use of it in the SELinux functions is dubious. If labelling all files in a directory there's no reason to skip things which are not regular files. We merely need to skip "." and "..", which is done by virDirRead() already. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
d_type is a non-portable extension to the struct dirent and even if it exists, its value may be DT_UNKNOWN if the filesystem doesn't support it. This is common with older versions of XFS which have ftype=0 feature. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Peter Krempa 提交于
Use virJSONValueToBuffer so that we can append the command terminator string without copying of the string again. Also avoid a 'strlen' as we can query the buffer use size. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NLaine Stump <laine@laine.org>
-
由 Peter Krempa 提交于
The internal qemu machinery already logs the sent message via the PROBE point in qemuMonitorSend and the monitor receive function. Those are way better as they are easy grepable. Remove the additional ones from the monitor code which just duplicate the sent data. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NLaine Stump <laine@laine.org>
-
由 Peter Krempa 提交于
Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NLaine Stump <laine@laine.org>
-
由 Peter Krempa 提交于
We have tests that validate the XML formatter. Additionally almost every guide tells users to disable JSON logging. Drop logging of output string in virJSONValueToString. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NLaine Stump <laine@laine.org>
-
由 Peter Krempa 提交于
The last step of the conversion involves copying of the generated JSON into a separate string. We can use a virBuffer to do this as this will also allow to subsequently use the buffer when we actually need to do some other formatting of the string. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NLaine Stump <laine@laine.org>
-
由 Peter Krempa 提交于
Use size_t for all sizes. The '*' modifier unfortunately does require an int so a temporary variable is necessary in the tests. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NLaine Stump <laine@laine.org>
-