- 17 3月, 2020 6 次提交
-
-
由 Daniel P. Berrangé 提交于
Some of the node device APIs are a little odd because they accept a virNodeDevicePtr object but are still implemented by the virt drivers. The first thing the virt drivers need to do is get the XML config associated with the node device, and that means talking to the node device driver. This worked previously because with monolithic libvirtd, both the virt driver and node device driver were in the same daemon and thus a single virConnectPtr can talk to both drivers. With the split daemon world though, the virNodeDevicePtr passed into the APIs is associated with the QEMU driver virConnectPtr, which has no ability to invoke APIs against the node device driver. We must thus get a duplicate virNodeDevicePtr object which is associated with a virConnectPtr for the node device driver. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Peter Krempa 提交于
Don't rely on error check and assign hostname only when non-NULL. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Active layer block commit makes the 'base' image the new top image of the disk after it finishes. This means that all bitmap operations need to be handled prior to this happening as we'd lose writes otherwise. The ideal place is to handle it when pivoting to the new image as only guest-writes would be happening after this point. Use qemuBlockBitmapsHandleCommitFinish to calculate the merging transaction. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com>
-
由 Peter Krempa 提交于
On start of the commit job, we need to disable any active bitmap in the base. Use qemuBlockBitmapsHandleCommitStart to calculate which and call the appropriate QMP APIs. We use blockdev-reopen to make the 'base' writable to disable the bitmaps. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com>
-
由 Peter Krempa 提交于
Add an argument to qemuBlockJobDiskNewCommit to propagate the list of disabled bitmaps into the job data structure. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com>
-
由 Peter Krempa 提交于
Since capabilities are not present for inactive VMs we'd report that we don't support '--delete' or committing while checkpoints exist rather than the proper error. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com>
-
- 13 3月, 2020 5 次提交
-
-
由 Peter Krempa 提交于
oVirt used a quirk in the pre-blockdev semantics of drive-mirror which opened the backing chain of the mirror destination only once 'block-job-complete' was called. Our introduction of blockdev made qemu open the backing chain images right at the start of the job. This broke oVirt's usage of this API because they copy the data into the backing chain during the time the block copy job is running. Re-introduce late open of the backing chain if qemu allows us to use blockdev-snapshot on write-only nodes as it can be used to install the backing chain even for an existing image now. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com>
-
由 Peter Krempa 提交于
For a long time we've masked out VIR_DOMAIN_BLOCK_COPY_SHALLOW if there's no backing chain for the copied disk to simplify the code. One of the refactors of the block copy code caused that we no longer update the 'flags' variable just the local copies. This was okay until in ccd4228a we started storing the job flags in the block job data. Given that we modify how we call qemu we also should modify @flags so that the correct value is recorded in the block job data. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com>
-
由 Peter Krempa 提交于
Move the check whether the job is already synchronised to the beginning of the function so that we don't try to do some of the steps necessary for pivoting prior to actually wanting to pivot. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com>
-
由 Peter Krempa 提交于
'nfs' variable was set to -1 or -2 on agent failure. Cleanup then tried to free 'nfs' elements of the array which resulted into a crash. Make 'nfs' size_t and assign it only on successful agent call. https://bugzilla.redhat.com/show_bug.cgi?id=1812965 Broken by commit 599ae372Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
The only caller doesn't check the value and also there are no real errors to report anyways. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 09 3月, 2020 1 次提交
-
-
由 Michal Privoznik 提交于
When preparing images for block jobs we modify their seclabels so that QEMU can open them. However, as mentioned in the previous commit, secdrivers base some it their decisions whether the image they are working on is top of of the backing chain. Fortunately, in places where we call secdrivers we know this and the information can be passed to secdrivers. The problem is the following: after the first blockcommit from the base to one of the parents the XATTRs on the base image are not cleared and therefore the second attempt to do another blockcommit fails. This is caused by blockcommit code calling qemuSecuritySetImageLabel() over the base image, possibly multiple times (to ensure RW/RO access). A naive fix would be to call the restore function. But this is not possible, because that would deny QEMU the access to the base image. Fortunately, we can use the fact that seclabels are remembered only for the top of the backing chain and not for the rest of the backing chain. And thanks to the previous commit we can tell secdrivers which images are top of the backing chain. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1803551Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
-
- 05 3月, 2020 1 次提交
-
-
由 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>
-
- 26 2月, 2020 1 次提交
-
-
由 Ján Tomko 提交于
Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NPavel Mores <pmores@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 25 2月, 2020 1 次提交
-
-
由 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>
-
- 24 2月, 2020 1 次提交
-
-
由 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>
-
- 23 2月, 2020 8 次提交
-
-
由 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 提交于
lxcDomainSetMemoryParameters() and qemuDomainSetMemoryParameters() has duplicated chunks of code that can be put in a new helper. 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 提交于
This new helper avoids more code repetition inside lxcDomainSetBlkioParameters() and qemuDomainSetBlkioParameters(). 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 提交于
After the introduction of virDomainDriverMergeBlkioDevice() in a previous patch, it is now clear that lxcDomainSetBlkioParameters() and qemuDomainSetBlkioParameters() uses the same loop to set cgroup blkio parameter of a domain. Avoid the repetition by adding a new helper called virDomainCgroupSetupDomainBlkioParameters(). 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 提交于
lxcDomainParseBlkioDeviceStr() and qemuDomainParseBlkioDeviceStr() are the same function. Avoid code repetition by putting the code in a new helper. 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 提交于
lxcDomainMergeBlkioDevice() and qemuDomainMergeBlkioDevice() are the same functions. This duplicated code can't be put in the existing domain_cgroup.c since it's not cgroup related. This patch introduces a new src/hypervisor/domain_driver.c to host this more generic code that can be shared between virt drivers. This new file is then used to create a new helper called virDomainDeivceMergeBlkioDevice() to eliminate the code repetition mentioned above. Callers in LXC and QEMU files were updated. This change is a preliminary step for more code reduction of cgroup related code inside lxcDomainSetBlkioParameters() and qemuDomainSetBlkioParameters(). 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 提交于
There are code repetition of set() and get() blkio device parameters across lxc and qemu files. Use the new vircgroup helpers to trim the repetition a bit. 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>
-
- 19 2月, 2020 1 次提交
-
-
由 Peter Krempa 提交于
qemuMonitorGetIOThreads returns a NULL-terminated list even when 0 iothreads are present. The caller didn't perform cleanup if there were 0 iothreads leaking the array. https://bugzilla.redhat.com/show_bug.cgi?id=1804548 Fixes: d1eac927Reported-by: NJing Yan <jiyan@redhat.com> Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 18 2月, 2020 1 次提交
-
-
由 Pavel Mores 提交于
QoS 'floor' setting is documented to be only supported for interfaces of type 'network'. Fail with an error message on attempt to set 'floor' on an interface of any other type. Signed-off-by: NPavel Mores <pmores@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 10 2月, 2020 2 次提交
-
-
由 Ján Tomko 提交于
We call APIs that reset the error in the rollback code. Preserve the error from the original call that failed. This turns the boringly cryptic: error: Unable to set interface parameters error: An error occurred, but the cause is unknown to the unexpectedly anarchist: error: internal error: Child process (/usr/sbin/tc filter add dev vnet1 parent ffff: protocol all u32 match u32 0 0 police rate 4294968kbps burst 4294968kb mtu 64kb drop flowid :1) unexpected exit status 1: Illegal "rate" Illegal "police" Signed-off-by: NJán Tomko <jtomko@redhat.com> Fixes: f02e21cb https://bugzilla.redhat.com/show_bug.cgi?id=1800505Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Ján Tomko 提交于
Otherwise an attempt to set an invalid value: virsh domiftune rhel8.2 vnet0 --outbound 4294968 on an interface with no bandwidth set crashes. Signed-off-by: NJán Tomko <jtomko@redhat.com> Fixes: f02e21cb https://bugzilla.redhat.com/show_bug.cgi?id=1800505Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
- 07 2月, 2020 1 次提交
-
-
由 zhenwei pi 提交于
Pvpanic device supports bit 1 as crashloaded event, it means that guest actually panicked and run kexec to handle error by guest side. Handle crashloaded as a lifecyle event in libvirt. Test case: Guest side: before testing, we need make sure kdump is enabled, 1, build new pvpanic driver (with commit from upstream e0b9a42735f2672ca2764cfbea6e55a81098d5ba 191941692a3d1b6a9614502b279be062926b70f5) 2, insmod new kmod 3, enable crash_kexec_post_notifiers, # echo 1 > /sys/module/kernel/parameters/crash_kexec_post_notifiers 4, trigger kernel panic # echo 1 > /proc/sys/kernel/sysrq # echo c > /proc/sysrq-trigger Host side: 1, build new qemu with pvpanic patches (with commit from upstream 600d7b47e8f5085919fd1d1157f25950ea8dbc11 7dc58deea79a343ac3adc5cadb97215086054c86) 2, build libvirt with this patch 3, handle lifecycle event and trigger guest side panic # virsh event stretch --event lifecycle event 'lifecycle' for domain stretch: Crashed Crashloaded events received: 1 Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com> Signed-off-by: Nzhenwei pi <pizhenwei@bytedance.com>
-
- 04 2月, 2020 5 次提交
-
-
由 Daniel P. Berrangé 提交于
Most code now uses the virProcess / virCommand APIs, so the need for sys/wait.h is quite limited. Removing this include removes the dependency on GNULIB providing a dummy sys/wait.h for Windows. Reviewed-by: NPavel Hrdina <phrdina@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Peter Krempa 提交于
Use qemuBlockBitmapsHandleBlockcopy to calculate bitmaps to copy over for a block-copy job. We copy them when pivoting to the new image as at that point we are certain that we don't dirty any bitmap unnecessarily. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
The flags may control important aspects of the block job which may influence also the termination of the job. Store the 'flags' for all the block job types. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Use the glib allocation function that never returns NULL and remove the now dead-code checks from all callers. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Create a wrapper for qemuBlockGetNamedNodeData named qemuBlockGetNamedNodeData. The purpose of the wrapper is to integrate the monitor handling functionality and in the future possible qemuCaps-based flags. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 30 1月, 2020 1 次提交
-
-
由 Ján Tomko 提交于
Also add a space after the start in some of the cases. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
-
- 29 1月, 2020 5 次提交
-
-
由 Daniel P. Berrangé 提交于
There are a large number of different header files that are related to the sockets APIs. The virsocket.h header includes all of the relevant headers for Windows and UNIX in one convenient place. If virsocketaddr.h is already included, then there's no need for virsocket.h Reviewed-by: NPavel Hrdina <phrdina@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Nikolay Shirokovskiy 提交于
Currently when disk is removed from iotune group (by setting all tunables to zero) group name is leaved in config. Let's fix it. Given iotune defaults are taken from the destination group setting tunables to zero may require different set of zero settings in API call. Let's prohibit removing from group while specifying different group name then current for the sanity sake. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Nikolay Shirokovskiy 提交于
For example if disk is not in the group and we want to move it there then it makes sense to specify only the group name in API call. Currently the destination group iotune settings will be overwritten with the disk settings which I would say is not what one would expect. Thus let's get defaults from the group we are moving to. And if we are moving the brand new group then is makes sense to copy the current disk iotune settings to the group. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Nikolay Shirokovskiy 提交于
virDomainSetBlockIoTune not simply sets the iotune params given in API but use current settings for all the omitted params. Unfortunately it uses current settings for active config when setting inactive params. Let's fix it. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Nikolay Shirokovskiy 提交于
Currently it is possible to start a domain which have disks in same iotune group and at the same time having different iotune params. Both params set are passed to qemu in command line and the one that is passed later down command line is get actually set. Let's prohibit such configurations. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-