summaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
...
* include: Introduce virDomainDirtyRateCalcFlagsHyman Huang(黄勇)2022-02-211-0/+13
| | | | | | | | | Introduce virDomainDirtyRateCalcFlags to get ready for adding mode parameter to qemuDomainStartDirtyRateCalc. Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
* include: define constants for resetting NVRAM stateDaniel P. Berrangé2022-02-082-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | When starting a guest with pflash based firmware, we will initialize NVRAM from a template if it does not already exist. In theory if the firmware code file is updated, the existing NVRAM variables should continue to work correctly. It is inevitable that this could break accidentally one day. Or a bug in the firmware might corrupt the NVRAM storage. Or user might make bad changes to the settings that prevent booting. Or the user might have re-configured the XML to point to a different firmware file incompatible with the current variables. In all these cases it would be useful to delete the existing NVRAM and initialize it from the pristine template. To support this introduce a VIR_DOMAIN_START_RESET_NVRAM constant for use with virDomainCreate / virDomainCreateXML, along with VIR_DOMAIN_SAVE_RESET_NVRAM for use with virDomainRestore and VIR_DOMAIN_SNAPSHOT_REVERT_RESET_NVRAM for use with virDomainSnapshotRevert. Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* include: Fix documentation for various VIR_*_LAST valuesAndrea Bolognani2022-01-272-6/+6
| | | | | Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* docs: Mention the types of params in event callbacksHan Han2022-01-243-9/+9
| | | | | Signed-off-by: Han Han <hhan@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com>
* docs: Fix typos in the code commentHan Han2022-01-245-5/+5
| | | | | | | | 1. s/LifeCycle/Lifecycle/ 2. s/virConnectDomainEventTrayChangeReason/virDomainEventTrayChangeReason/ Signed-off-by: Han Han <hhan@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com>
* libvirt: Introduce virDomainSetLaunchSecurityState public APIJim Fehlig2022-01-041-0/+36
| | | | | | | | | | | | | | | | This API allows setting a launch secret within a guests's memory. The launch secret is created by the guest owner after retrieving and verifying the launch measurement with virDomainGetLaunchSecurityInfo. The API uses virTypedParameter for input, allowing it to be expanded to support other confidential computing technologies. In the case of SEV, a basic guest launch workflow is described in the SEV API spec in section "1.3.1 Launch" https://www.amd.com/system/files/TechDocs/55766_SEV-KM_API_Specification.pdf Signed-off-by: Jim Fehlig <jfehlig@suse.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* include: define parameters for reporting SEV guest limitsDaniel P. Berrangé2021-12-141-0/+16
| | | | | | | | | There are limits on the number of SEV/SEV-ES guests that can be run on machines, which may be influenced by firmware settings. This is important to expose to users. Reviewed-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* include: add new launch security parametersDaniel P. Berrangé2021-12-141-0/+32
| | | | | | | | Three more parameters are required in order that clients can perform a launch attestation on the SEV guest. Reviewed-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* virDomainMigrate: Introduce VIR_MIGRATE_NON_SHARED_SYNCHRONOUS_WRITES flagPeter Krempa2021-12-071-0/+10
| | | | | | | | | | | | | | | | Non-shared storage migration of guests which are disk I/O intensive and have fast local storage may actually never converge if the guest happens to dirty the disk faster than it can be copied. This patch introduces a new flag 'VIR_MIGRATE_NON_SHARED_SYNCHRONOUS_WRITES' which will instruct hypervisors to synchronize local I/O writes with the writes to remote storage used for migration so that the guest can't overwhelm the migration. This comes at a cost of decreased local I/O performance for guests which behave well on average. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* include: virDomainMigrateFlags: Remove "block alignment" whitespacePeter Krempa2021-12-071-17/+17
| | | | | | | | | Using whitespace to align the '=' and values doesn't make sense for the virDomainMigrateFlags enum as the visual block is interrupted by comments. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* virDomainBlockCopy: Introduce VIR_DOMAIN_BLOCK_COPY_SYNCHRONOUS_WRITES flagPeter Krempa2021-12-071-0/+4
| | | | | | | | | | | | | | | In cases when the destination storage is slower than the normal VM storage and the VM does intensive I/O to the disk a block copy job may never converge. Switching it to synchronous mode will ensure that all writes done by the guest are propagated to the destination at the cost of slowing down I/O of the guest to the synchronous speed. This patch adds the new API flag and implements virsh support. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* include: virDomainBlockCopyFlags: Convert to prefix commentsPeter Krempa2021-12-071-7/+8
| | | | | | | Switch to the comment style allowing more text. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* domain: add interface information to 'virDomainGetGuestInfo'zhanglei2021-11-051-0/+1
| | | | | | Signed-off-by: zhanglei <zhanglei@smartx.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
* Add PCI VPD Capability SupportDmitrii Shcherbakov2021-10-211-0/+1
| | | | | | | | | * XML serialization and deserialization of PCI VPD; * PCI VPD capability flags added and used in relevant places; * XML to XML tests for the added capability. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Dmitrii Shcherbakov <dmitrii.shcherbakov@canonical.com>
* docs: describe flag VIR_STORAGE_POOL_CREATE_NORMAL to correct the HTML docRobin Lee2021-10-041-0/+1
| | | | | | | This patch makes the descriptions of virStoragePoolCreateFlags annotate to the correct flag in the generated HTML file. Signed-off-by: Robin Lee <cheeselee@fedoraproject.org>
* qemu: Wire up MEMORY_DEVICE_SIZE_CHANGE eventMichal Privoznik2021-10-011-0/+24
| | | | | | | | | | | | | | | | | As advertised in previous commit, this event is delivered to us when virtio-mem module changes the allocation inside the guest. It comes with one attribute - size - which holds the new size of the virtio-mem (well, allocated size), in bytes. Mind you, this is not necessarily the same number as 'requested size'. It almost certainly will be when sizing the memory up, but it might not be when sizing the memory down - the guest kernel might be unable to free some blocks. This current size is reported in the domain XML as an output element only. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
* api: add virNetworkCreateFlagsKristina Hanicova2021-09-161-0/+4
| | | | | Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
* api: add public virNetworkCreateXMLFlags() and remote protocolKristina Hanicova2021-09-161-0/+3
| | | | | | | This new API creates network with given flags. Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
* api: add virNodeDeviceIsPersistent()/IsActive()Jonathon Jongsma2021-09-141-0/+4
| | | | | | | | | | These two public APIs are implemented for almost all other objects that have a concept of persistent definition and activatability. Now that we have node devices (mdevs) that can be defined and inactive, it will be useful to query the persistent/active state of node devices as well. Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* api: add virNodeDevice(Get|Set)Autostart()Jonathon Jongsma2021-09-141-0/+6
| | | | | | | | This will allow persistent mediated devices to be configured to be restarted automatically when the host reboots. Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* api: add virNWFilterBindingCreateFlagsKristina Hanicova2021-09-061-0/+5
| | | | | | Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
* api: add VIR_NETWORK_PORT_CREATE_VALIDATE flagKristina Hanicova2021-09-061-0/+1
| | | | | | Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
* api: add virStoragePoolDefineFlagsKristina Hanicova2021-08-251-0/+4
| | | | | Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
* api: add virNetworkDefineFlagsKristina Hanicova2021-08-241-0/+4
| | | | | Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
* api: add public virNetworkDefineXMLFlags() and remote protocolKristina Hanicova2021-08-241-0/+3
| | | | | | | This new API allows to define network with given flags. Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
* api: add virSecretDefineFlagsKristina Hanicova2021-08-201-0/+5
| | | | | | Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
* api: add virInterfaceDefineFlagsKristina Hanicova2021-08-201-0/+4
| | | | | | Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
* api: add virNWFilterDefineFlagsKristina Hanicova2021-08-201-0/+4
| | | | | Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
* api: add public virNWFilterDefineXMLFlags() and remote protocolKristina Hanicova2021-08-201-0/+3
| | | | | | | | This new API function allows to define nwfilter with given flags. Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
* Add basic driver for the Cloud-HypervisorWilliam Douglas2021-06-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cloud-Hypervisor is a KVM virtualization using hypervisor. It functions similarly to qemu and the libvirt Cloud-Hypervisor driver uses a very similar structure to the libvirt driver. The biggest difference from the libvirt perspective is that the "monitor" socket is seperated into two sockets one that commands are issued to and one that events are notified from. The current implementation only uses the command socket (running over a REST API with json encoded data) with future changes to add support for the event socket (to better handle shutdowns from inside the VM). This patch adds support for the following initial VM actions using the Cloud-Hypervsior API: * vm.create * vm.delete * vm.boot * vm.shutdown * vm.reboot * vm.pause * vm.resume To use the Cloud-Hypervisor driver, the v15.0 release of Cloud-Hypervisor is required to be installed. Some additional notes: * The curl handle is persistent but not useful to detect ch process shutdown/crash (a future patch will address this shortcoming) * On a 64-bit host Cloud-Hypervisor needs to support PVH and so can emulate 32-bit mode but it isn't fully tested (a 64-bit kernel and 32-bit userspace is fine, a 32-bit kernel isn't validated) Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: William Douglas <william.douglas@intel.com>
* lib: Add win-dmp crashdump formatMichal Privoznik2021-05-201-0/+1
| | | | | | | | | | | | | | | | QEMU gained support for 'win-dmp' format in it's release of 3.0, but libvirt doesn't implement it yet. Fortunately, there not much needed: new value to virDomainCoreDumpFormat public enum, which unfortunately means that QEMU driver has to be updated in the same commit, because of VIR_ENUM_IMPL(). Luckily, we don't need any extra QEMU capability - the code already checks supported formats via 'query-dump-guest-memory-capability' just before issuing 'dump-guest-memory'. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
* include: Fix copy-paste error in comment to virDomainCoreDumpFormat enumMichal Privoznik2021-05-201-1/+1
| | | | | | | | | The comment to virDomainCoreDumpFormat enum says that new values can be introduced in the future "as new events are added". Well, it should have been "formats" instead of "events", obviously. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
* conf, docs, schema: Add support for 'restrictive' mode in numatuneLuyao Zhong2021-04-191-0/+1
| | | | | | | | | | This allows users to restrict memory nodes without setting any specific memory policy, then 'restrictive' mode is useful. Signed-off-by: Luyao Zhong <luyao.zhong@intel.com> Signed-off-by: Martin Kletzander <mkletzan@redhat.com> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
* api: Add 'flags' param to virNodeDeviceCreate/Undefine()Jonathon Jongsma2021-04-091-2/+4
| | | | | | | | Follow best practices and add a unsigned int flags parameter to these new APIs that have not been in a release yet. Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* api: add virNodeDeviceCreate()Jonathon Jongsma2021-04-071-0/+2
| | | | | | | | | This new API function provides a way to start a persistently-defined mediate device that was defined by virNodeDeviceDefineXML() (or one that was defined externally via mdevctl) Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
* api: add virNodeDeviceUndefine()Jonathon Jongsma2021-04-071-0/+2
| | | | | | | | This interface allows you to undefine a persistently defined (but inactive) mediated devices. It is implemented via 'mdevctl' Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
* api: add virNodeDeviceDefineXML()Jonathon Jongsma2021-04-071-0/+4
| | | | | | | | | With mediated devices, we can now define persistent node devices that can be started and stopped. In order to take advantage of this, we need an API to define new node devices. Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
* nodedev: add DEFINED/UNDEFINED lifecycle eventsJonathon Jongsma2021-04-071-0/+2
| | | | | | | | | | Since a mediated device can be persistently defined by the mdevctl backend, we need additional lifecycle events beyond CREATED/DELETED to indicate that e.g. the device has been stopped but the device definition still exists. Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
* nodedev: fix docs for virConnectListAllNodeDevices()Jonathon Jongsma2021-04-071-2/+1
| | | | | | | | | | It doesn't make sense to list all of the flag values in the function documentation. This is unnecessary duplication, we already refer to the enum type. Also, remove reference to exclusive groups of flags, since that does not apply to this API. Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
* nodedev: Add ability to filter by active stateJonathon Jongsma2021-04-071-3/+6
| | | | | | | | Add two flag values for virConnectListAllNodeDevices() so that we can list only node devices that are active or inactive. Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
* migration/dirtyrate: Extend dirtyrate statistics for domGetStatsHao Wang2021-03-181-0/+1
| | | | | | | | Extend dirtyrate statistics for domGetStats to display the information of a domain's memory dirty rate produced by domainStartDirtyRateCalc. Signed-off-by: Hao Wang <wanghao232@huawei.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
* migration/dirtyrate: Introduce virDomainDirtyRateStatus enumHao Wang2021-03-181-0/+18
| | | | | | | Introduce virDomainDirtyRateStatus enum. Signed-off-by: Hao Wang <wanghao232@huawei.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
* migration/dirtyrate: Introduce virDomainStartDirtyRateCalc APIHao Wang2021-03-181-0/+4
| | | | | | | | Introduce virDomainStartDirtyRateCalc API for start calculation of a domain's memory dirty rate with a specified time. Signed-off-by: Hao Wang <wanghao232@huawei.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
* src: define virDomainGetMessages APIDaniel P. Berrangé2021-02-121-0/+9
| | | | | | | | | | | | | | | | | | | This API allows fetching a list of informational messages recorded against the domain. This provides a way to give information about tainting of the guest due to undesirable actions/configs, as well as provide details of deprecated features. The output of this API is explicitly targetted at humans, not machines, so it is inappropriate to attempt to pattern match on the strings and take action off them, not least because the messages are marked for translation. Should there be a demand for machine targetted information, this would have to be addressed via a new API, and is not planned at this point in time. Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* hyperv: ambiguous VM names will throw an errorMatt Coleman2021-01-211-0/+1
| | | | | | | | | | | | Since Hyper-V allows multiple VMs to be created with the same name, some commands produce unpredictable results due to hypervDomainLookupByName's WMI query selecting the wrong domain. For example, this prevents `virsh dumpxml` from outputting XML for the wrong domain. Signed-off-by: Matt Coleman <matt@datto.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
* virsh: nodedev: filter by AP Matrix capabilityShalini Chellathurai Saroja2020-12-091-0/+1
| | | | | | | | | Add support to filter by 'ap_matrix' capability. Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com> Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
* virsh: nodedev: Filter by AP card and AP queue capabilitiesFarhan Ali2020-12-091-0/+2
| | | | | | | | | | Add support to filter by 'ap_card' and 'ap_queue' capabilities. Signed-off-by: Farhan Ali <alifm@linux.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com> Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
* domain: add disk informations to virDomainGetGuestInfoMarc-André Lureau2020-12-011-0/+1
| | | | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Tested-by: Han Han <hhan@redhat.com>
* virDomainAuthorizedSSHKeysSet: Use uint for @nkeysMichal Privoznik2020-11-231-1/+1
| | | | | | | | | | | | When introducing the API I've mistakenly used 'int' type for @nkeys argument which does nothing more than tells the API how many items there are in @keys array. Obviously, negative values are not expected and therefore 'unsigned int' should have been used. Reported-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* Introduce OpenSSH authorized key file mgmt APIsMichal Privoznik2020-11-181-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | When setting up a new guest or when a management software wants to allow access to an existing guest the virDomainSetUserPassword() API can be used, but that might be not good enough if user want to ssh into the guest. Not only sshd has to be configured to accept password authentication (which is usually not the case for root), user have to type in their password. Using SSH keys is more convenient. Therefore, two new APIs are introduced: virDomainAuthorizedSSHKeysGet() which lists authorized keys for given user, and virDomainAuthorizedSSHKeysSet() which modifies the authorized keys file for given user (append, set or remove keys from the file). It's worth nothing that while authorized_keys file entries have some structure (as defined by sshd(8)), expressing that structure goes beyond libvirt's focus and thus "keys" are nothing but an opaque string to libvirt. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>