- 21 5月, 2019 10 次提交
-
-
由 Peter Krempa 提交于
At the point when we want to modify the permissions for the 'mirror' we know whether it is supposed to have a backing chain or no. Given that mirror->backingStore is populated only when we'd need to touch it ayways we can use qemuDomainStorageSourceChainAccessAllow even in place of qemuDomainStorageSourceAccessAllow used for other cases to simplify the code. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
One code path open-coded qemuDomainStorageSourceChainAccessAllow badly and also did not integrate with the locking code. Replace the separate calls with qemuDomainStorageSourceChainAccessAllow which does everything internally. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Since 4e797f1a we parse backingStore of mirror which will later be used with blockdev. Add some validation for the user passed mirror at the current point to make sure it's not used improperly. Validate that it's not used without blockdev and also that it's not passed when not requesting a shallow copy. Also add a chain terminator for a deep copy since we know the resulting mirror will not have chain. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Since 3decae00 qemuDomainStorageSourceAccessAllow revokes the permissions it granted if it fails halfway, thus we can remove some calls to qemuDomainStorageSourceAccessRevoke which tried to undo this situation. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Since 3decae00 qemuDomainStorageSourceAccessRevoke keeps the libvirt error which was set prior to the call around even after the call, thus we don't need to do the same when reverting access in the block copy code. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Use VIR_AUTOFREE and VIR_AUTOUNREF. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Use VIR_AUTOFREE and VIR_AUTOUNREF. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Use VIR_AUTOFREE, VIR_AUTOUNREF, and VIR_STEAL_PTR. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
When aborting or pivoting a block job we record which operation we do for the mirror in the virDomainDiskDef structure. As everything is synchronized by a job it's not necessary to modify the state prior to calling the monitor and resetting the state on failure. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
All blockjobs get their status updated by events from qemu, so this code no longer makes sense. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 20 5月, 2019 3 次提交
-
-
由 Michal Privoznik 提交于
This reverts commit dfd70ca1. Pushed by a mistake, sorry. There's still some discussion going on upstream. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Han Han 提交于
Qemu added reporting of virtio balloon new statistics stat-htlb-pgalloc and stat-htlb-pgfail since qemu-3.0 commit b7b12644297. The value of stat-htlb-pgalloc represents the number of successful hugetlb page allocations while stat-htlb-pgfail represents the number of failed ones. Add this statistics reporting to libvirt. To enable this feature for vm, guest kenel >= 4.17 is required because the exporting hugetlb page allocation for virtio balloon is introduced since 6c64fe7f. Signed-off-by: NHan Han <hhan@redhat.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Maxiwell S. Garcia 提交于
Snapshot create operation saves the live XML and uses it to replace the domain definition in case of revert. But the VM config XML is not saved and the revert operation does not address this issue. This commit prevents the config XML from being overridden by snapshot definition. An active domain stores both current and new definitions. The current definition (vm->def) stores the live XML and the new definition (vm->newDef) stores the config XML. In an inactive domain, only the config XML is persistent, and it's saved in vm->def. The revert operation uses the virDomainObjAssignDef() to set the snapshot definition in vm->newDef, if domain is active, or in vm->def otherwise. But before that, it saves the old value to return to caller. This return is used here to restore the config XML after all snapshot startup process finish. Signed-off-by: NMaxiwell S. Garcia <maxiwell@linux.ibm.com>
-
- 14 5月, 2019 1 次提交
-
-
由 Michal Privoznik 提交于
This function gets snapshot XML (provided by used) as an argument. It parses it into a local variable @def and then sets some more members (e.g. it creates a copy of live domain XML). Then it proceeds to checking if snapshot XML is valid (e.g. it contains as many disks as currently in the domain). If this fails then the control jumps to endjob label and subsequently return from the function. This is where AUTOFREE function for @def is ran. Well, because the code says to run plain VIR_FREE() we leak some memory because @def is actually an object and therefore it should have been declared as AUTOUNREF. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
- 09 5月, 2019 4 次提交
-
-
由 Eric Blake 提交于
This brings about a couple of benefits: - use of VIR_AUTOUNREF() simplifies several callers - Fixes a todo about virDomainMomentObjList not being polymorphic enough Signed-off-by: NEric Blake <eblake@redhat.com> Acked-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Eric Blake 提交于
VIR_CLASS_NEW insists that descendents of virObject have 'parent' as the name of their inherited base class member at offset 0. While it would be possible to write a new class-creation macro that takes the actual field name 'current', and rewrite VIR_CLASS_NEW to call the new macro with the hard-coded name 'parent', it seems less confusing if all object code uses similar naming. Thus, this is a mechanical rename in preparation of making virDomainSnapshotDef a descendent of virObject. Signed-off-by: NEric Blake <eblake@redhat.com> Acked-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Eric Blake 提交于
VIR_CLASS_NEW insists that descendents of virObject have 'parent' as the name of their inherited base class member at offset 0. While it would be possible to write a new class-creation macro that takes the actual field name, and rewrite VIR_CLASS_NEW to call the new macro with the hard-coded name 'parent', so that we could make virDomainMomentDef use a custom name for its base class, it seems less confusing if all object code uses similar naming. Thus, this is a mechanical rename in preparation of making virDomainSnapshotDef a descendent of virObject, when we can no longer use 'parent' for a different purpose than the base class. Signed-off-by: NEric Blake <eblake@redhat.com> Acked-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Peter Krempa 提交于
Use qemuDomainStorageSourceAccess(Allow|Revoke) instead. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 05 5月, 2019 1 次提交
-
-
由 Michal Privoznik 提交于
After 65a372d6 the @cfg variable is no longer used. This means we can drop it and therefore drop 'cleanup' label with it. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
-
- 30 4月, 2019 1 次提交
-
-
由 Daniel P. Berrangé 提交于
This caused the live XML to report the 'bridge' type instead of the 'network' type, which is a behavioural regression. It also breaks 'virsh domif-setlink', 'virsh update-device' and 'virsh domiftune' This reverts commit 518026e1. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 26 4月, 2019 4 次提交
-
-
由 Michal Privoznik 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1697676 If an user tries to attach a device with colliding user alias then we attach it happily and thus leave domain unable to start. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
When attaching a device to live XML we don't care (well, shouldn't care) that there's already a device in inactive XML that has the same user alias. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
If we're attaching a device to both inactive and live XML then @ret is overwritten which may result in incorrect return value. For instance, if attaching to inactive XML succeeds, @ret is assigned value of zero and control proceeds to attaching the device to live XML. Here, if say virDomainDeviceValidateAliasForHotplug() fails the control jumps over to 'cleanup' label and zero is returned indicating success. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
Our coding style specifies that only negative values are considered as error. Check for return value of virDomainDiskInsert() properly, following the style. Not that the function can now return anything other than 0 or -1, but it just triggers my OCD. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 25 4月, 2019 1 次提交
-
-
由 Daniel Henrique Barboza 提交于
If the current QEMU guest can't wake up from suspend properly, and we are able to determine that, avoid suspending the guest at all. To be able to determine this support, QEMU needs to implement the 'query-current-machine' QMP call. This is reflected by the QEMU_CAPS_QUERY_CURRENT_MACHINE cap. If the cap is enabled, a new function qemuDomainProbeQMPCurrentMachine is called. This is wrapper for qemuMonitorGetCurrentMachineInfo, where the 'wakeup-suspend-support' flag is retrieved from 'query-current-machine'. If wakeupSuspendSupport is true, proceed with the regular flow of qemuDomainPMSuspendForDuration. The absence of QEMU_CAPS_QUERY_CURRENT_MACHINE indicates that we're dealing with a QEMU version older than 4.0 (which implements the required QMP API). In this case, proceed as usual with the suspend logic of qemuDomainPMSuspendForDuration, since we can't assume whether the guest has support or not. Fixes: https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1759509Reported-by: NBalamuruhan S <bala24@linux.vnet.ibm.com> Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 18 4月, 2019 1 次提交
-
-
由 Daniel P. Berrangé 提交于
Ports allocated on virtual networks with type=nat|route|open all get given an actual type of 'network'. Only ports in networks with type=bridge use an actual type of 'bridge'. This distinction makes little sense since the virtualization drivers will treat both actual types in exactly the same way, as they're all just bridge devices a VM needs to be connected to. This doesn't affect user visible XML since the "actual" device XML is internal only, but we need code to convert the data upgrades. Reviewed-by: NLaine Stump <laine@laine.org> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 17 4月, 2019 3 次提交
-
-
由 Michal Privoznik 提交于
Firstly, VIR_STRDUP() accepts NULL, so there is no need to check if the string we want to duplicate is not-NULL. Secondly, virDomainNetSetModelString() also accepts NULL. Thirdly, we have VIR_AUTOFREE(). Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Andrea Bolognani 提交于
It has made Clang very unhappy ever since 6bf7c676. Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
-
由 Cole Robinson 提交于
To ease converting the net->model value to an enum, add the wrapper functions: virDomainNetGetModelString virDomainNetSetModelString virDomainNetStreqModelString virDomainNetStrcaseeqModelString Acked-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
- 16 4月, 2019 1 次提交
-
-
由 Daniel P. Berrangé 提交于
The port allocation APIs are currently called unconditionally for all types of NIC, but (mostly) only do anything for NICs with type=network. The exception is the port allocate API which does some validation even for NICs with type!=network. Relying on this validation is flawed, however, since the network driver may not even be installed. IOW virt drivers must not delegate validation to the network driver for NICs with type != network. This change allows us to report errors when the virtual network driver is not registered. Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 15 4月, 2019 1 次提交
-
-
由 Jiri Denemark 提交于
My earlier commit be46f613 was incomplete. It removed caching of microcode version in the CPU driver, which means the capabilities XML will see the correct microcode version. But it is also cached in the QEMU capabilities cache where it is used to detect whether we need to reprobe QEMU. By missing the second place, the original commit be46f613 made the situation even worse since libvirt would report correct microcode version while still using the old host CPU model (visible in domain capabilities XML). Signed-off-by: NJiri Denemark <jdenemar@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 12 4月, 2019 1 次提交
-
-
由 Cole Robinson 提交于
Standardize on putting the _LAST enum value on the second line of VIR_ENUM_IMPL invocations. Later patches that add string labels to VIR_ENUM_IMPL will push most of these to the second line anyways, so this saves some noise. Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
- 10 4月, 2019 2 次提交
-
-
由 Michal Privoznik 提交于
If a management application wants to use firmware auto selection feature it can't currently know if the libvirtd it's talking to support is or not. Moreover, it doesn't know which values that are accepted for the @firmware attribute of <os/> when parsing will allow successful start of the domain later, i.e. if the mgmt application wants to use 'bios' whether there exists a FW descriptor in the system that describes bios. This commit then adds 'firmware' enum to <os/> element in <domainCapabilities/> XML like this: <enum name='firmware'> <value>bios</value> <value>efi</value> </enum> We can see both 'bios' and 'efi' listed which means that there are descriptors for both found in the system (matched with the machine type and architecture reported in the domain capabilities earlier and not shown here). Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Acked-by: NLaszlo Ersek <lersek@redhat.com>
-
由 Peter Krempa 提交于
virutil.(c|h) is a very gross collection of random code. Remove the enum handlers from there so we can limit the scope where virtutil.h is used. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 04 4月, 2019 1 次提交
-
-
由 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>
-
- 03 4月, 2019 5 次提交
-
-
由 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>
-
由 Peter Krempa 提交于
'blockdev-snapshot-sync' is present in QEMU since v0.14.0-rc0 and 'transaction' since v1.1.0 (52e7c241ac766406f05fa) Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
qemu added the 'drive-mirror' command in v1.3.0 (d9b902db3fb71fdc) Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
qemu added the 'block-commit' command in v1.3.0 (ed61fc10e8c8d2) Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
It always returns true. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-