2010-12-16 15:23:41 +00:00
|
|
|
/*
|
|
|
|
* qemu_domain.h: QEMU domain private state
|
|
|
|
*
|
2019-03-27 07:12:37 +00:00
|
|
|
* Copyright (C) 2006-2019 Red Hat, Inc.
|
2010-12-16 15:23:41 +00:00
|
|
|
* Copyright (C) 2006 Daniel P. Berrange
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-09-20 22:30:55 +00:00
|
|
|
* License along with this library. If not, see
|
2012-07-21 10:06:23 +00:00
|
|
|
* <http://www.gnu.org/licenses/>.
|
2010-12-16 15:23:41 +00:00
|
|
|
*/
|
|
|
|
|
2019-06-18 16:12:37 +00:00
|
|
|
#pragma once
|
|
|
|
|
2020-03-16 12:10:24 +00:00
|
|
|
#include <glib-object.h>
|
2019-06-18 16:12:37 +00:00
|
|
|
#include "virthread.h"
|
|
|
|
#include "vircgroup.h"
|
|
|
|
#include "virperf.h"
|
|
|
|
#include "domain_addr.h"
|
|
|
|
#include "domain_conf.h"
|
|
|
|
#include "snapshot_conf.h"
|
|
|
|
#include "qemu_monitor.h"
|
|
|
|
#include "qemu_agent.h"
|
|
|
|
#include "qemu_blockjob.h"
|
2020-06-24 10:45:23 +00:00
|
|
|
#include "qemu_domainjob.h"
|
2019-06-18 16:12:37 +00:00
|
|
|
#include "qemu_conf.h"
|
|
|
|
#include "qemu_capabilities.h"
|
|
|
|
#include "qemu_migration_params.h"
|
2019-08-08 14:55:06 +00:00
|
|
|
#include "qemu_slirp.h"
|
2019-06-18 16:12:37 +00:00
|
|
|
#include "virmdev.h"
|
|
|
|
#include "virchrdev.h"
|
|
|
|
#include "virobject.h"
|
|
|
|
#include "logging/log_manager.h"
|
|
|
|
#include "virdomainmomentobjlist.h"
|
|
|
|
#include "virenum.h"
|
2020-02-12 12:26:11 +00:00
|
|
|
#include "vireventthread.h"
|
2019-06-18 16:12:37 +00:00
|
|
|
|
|
|
|
#define QEMU_DOMAIN_FORMAT_LIVE_FLAGS \
|
2017-06-30 14:55:20 +00:00
|
|
|
(VIR_DOMAIN_XML_SECURE)
|
2012-10-08 09:58:05 +00:00
|
|
|
|
2019-06-18 16:12:37 +00:00
|
|
|
#if ULONG_MAX == 4294967295
|
2017-03-07 17:09:58 +00:00
|
|
|
/* QEMU has a 64-bit limit, but we are limited by our historical choice of
|
2012-03-20 15:56:29 +00:00
|
|
|
* representing bandwidth in a long instead of a 64-bit int. */
|
2019-06-18 16:12:37 +00:00
|
|
|
# define QEMU_DOMAIN_MIG_BANDWIDTH_MAX ULONG_MAX
|
|
|
|
#else
|
|
|
|
# define QEMU_DOMAIN_MIG_BANDWIDTH_MAX (INT64_MAX / (1024 * 1024))
|
|
|
|
#endif
|
2011-08-26 18:10:22 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
typedef void (*qemuDomainCleanupCallback)(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm);
|
2012-03-16 06:52:26 +00:00
|
|
|
|
2019-06-18 16:12:37 +00:00
|
|
|
#define QEMU_DOMAIN_MASTER_KEY_LEN 32 /* 32 bytes for 256 bit random key */
|
2016-04-04 15:17:43 +00:00
|
|
|
|
2020-06-24 10:45:23 +00:00
|
|
|
void
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainObjSaveStatus(virQEMUDriver *driver,
|
|
|
|
virDomainObj *obj);
|
2020-06-24 10:45:23 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainSaveStatus(virDomainObj *obj);
|
|
|
|
void qemuDomainSaveConfig(virDomainObj *obj);
|
2019-06-27 13:40:39 +00:00
|
|
|
|
2016-04-04 15:17:43 +00:00
|
|
|
|
|
|
|
/* helper data types for async device unplug */
|
|
|
|
typedef enum {
|
|
|
|
QEMU_DOMAIN_UNPLUGGING_DEVICE_STATUS_NONE = 0,
|
|
|
|
QEMU_DOMAIN_UNPLUGGING_DEVICE_STATUS_OK,
|
|
|
|
QEMU_DOMAIN_UNPLUGGING_DEVICE_STATUS_GUEST_REJECTED,
|
|
|
|
} qemuDomainUnpluggingDeviceStatus;
|
|
|
|
|
|
|
|
typedef struct _qemuDomainUnpluggingDevice qemuDomainUnpluggingDevice;
|
|
|
|
struct _qemuDomainUnpluggingDevice {
|
|
|
|
const char *alias;
|
|
|
|
qemuDomainUnpluggingDeviceStatus status;
|
qemu_hotplug: Fix a rare race condition when detaching a device twice
https://bugzilla.redhat.com/show_bug.cgi?id=1623389
If a device is detached twice from the same domain the following
race condition may happen:
1) The first DetachDevice() call will issue "device_del" on qemu
monitor, but since the DEVICE_DELETED event did not arrive in
time, the API ends claiming "Device detach request sent
successfully".
2) The second DetachDevice() therefore still find the device in
the domain and thus proceeds to detaching it again. It calls
EnterMonitor() and qemuMonitorSend() trying to issue "device_del"
command again. This gets both domain lock and monitor lock
released.
3) At this point, qemu sends us the DEVICE_DELETED event which is
going to be handled by the event loop which ends up calling
qemuDomainSignalDeviceRemoval() to determine who is going to
remove the device from domain definition. Whether it is the
caller that marked the device for removal or whether it is going
to be the event processing thread.
4) Because the device was marked for removal,
qemuDomainSignalDeviceRemoval() returns true, which means the
event is to be processed by the thread that has marked the device
for removal (and is currently still trying to issue "device_del"
command)
5) The thread finally issues the "device_del" command, which
fails (obviously) and therefore it calls
qemuDomainResetDeviceRemoval() to reset the device marking and
quits immediately after, NOT removing any device from the domain
definition.
At this point, the device is still present in the domain
definition but doesn't exist in qemu anymore. Worse, there is no
way to remove it from the domain definition.
Solution is to note down that we've seen the event and if the
second "device_del" fails, not take it as a failure but carry on
with the usual execution.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
ACKed-by: Peter Krempa <pkrempa@redhat.com>
2019-03-14 10:02:52 +00:00
|
|
|
bool eventSeen; /* True if DEVICE_DELETED event arrived. */
|
2016-04-04 15:17:43 +00:00
|
|
|
};
|
|
|
|
|
2016-11-15 10:30:18 +00:00
|
|
|
|
2019-06-25 11:21:39 +00:00
|
|
|
#define QEMU_PROC_MOUNTS "/proc/mounts"
|
|
|
|
#define QEMU_DEVPREFIX "/dev/"
|
|
|
|
#define QEMU_DEV_VFIO "/dev/vfio/vfio"
|
|
|
|
#define QEMU_DEV_SEV "/dev/sev"
|
|
|
|
#define QEMU_DEVICE_MAPPER_CONTROL_PATH "/dev/mapper/control"
|
|
|
|
|
|
|
|
|
2019-06-18 16:12:37 +00:00
|
|
|
#define QEMU_DOMAIN_AES_IV_LEN 16 /* 16 bytes for 128 bit random */
|
|
|
|
/* initialization vector */
|
2021-09-22 07:34:31 +00:00
|
|
|
|
|
|
|
typedef struct _qemuDomainSecretInfo qemuDomainSecretInfo;
|
|
|
|
struct _qemuDomainSecretInfo {
|
2017-03-03 12:22:16 +00:00
|
|
|
char *username;
|
|
|
|
char *alias; /* generated alias for secret */
|
|
|
|
char *iv; /* base64 encoded initialization vector */
|
|
|
|
char *ciphertext; /* encoded/encrypted secret */
|
|
|
|
};
|
|
|
|
|
2010-12-16 15:23:41 +00:00
|
|
|
typedef struct _qemuDomainObjPrivate qemuDomainObjPrivate;
|
|
|
|
struct _qemuDomainObjPrivate {
|
2021-03-11 07:16:13 +00:00
|
|
|
virQEMUDriver *driver;
|
2017-07-21 13:46:56 +00:00
|
|
|
|
2018-03-29 14:48:34 +00:00
|
|
|
qemuDomainJobObj job;
|
2010-12-16 15:23:41 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
virBitmap *namespaces;
|
2016-11-15 10:30:18 +00:00
|
|
|
|
2020-02-12 12:26:11 +00:00
|
|
|
virEventThread *eventThread;
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuMonitor *mon;
|
|
|
|
virDomainChrSourceDef *monConfig;
|
2011-05-31 16:34:20 +00:00
|
|
|
bool monError;
|
|
|
|
unsigned long long monStart;
|
Add API to change qemu agent response timeout
Some layered products such as oVirt have requested a way to avoid being
blocked by guest agent commands when querying a loaded vm. For example,
many guest agent commands are polled periodically to monitor changes,
and rather than blocking the calling process, they'd prefer to simply
time out when an agent query is taking too long.
This patch adds a way for the user to specify a custom agent timeout
that is applied to all agent commands.
One special case to note here is the 'guest-sync' command. 'guest-sync'
is issued internally prior to calling any other command. (For example,
when libvirt wants to call 'guest-get-fsinfo', we first call
'guest-sync' and then call 'guest-get-fsinfo').
Previously, the 'guest-sync' command used a 5-second timeout
(VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT), whereas the actual command that
followed always blocked indefinitely
(VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK). As part of this patch, if a
custom timeout is specified that is shorter than
5 seconds, this new timeout is also used for 'guest-sync'. If there is
no custom timeout or if the custom timeout is longer than 5 seconds, we
will continue to use the 5-second timeout.
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2019-11-13 22:06:09 +00:00
|
|
|
int agentTimeout;
|
2011-10-05 17:31:54 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuAgent *agent;
|
2011-10-05 17:31:54 +00:00
|
|
|
bool agentError;
|
|
|
|
|
2011-12-09 14:33:13 +00:00
|
|
|
bool beingDestroyed;
|
2011-06-17 13:43:54 +00:00
|
|
|
char *pidfile;
|
2010-12-16 15:23:41 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
virDomainPCIAddressSet *pciaddrs;
|
|
|
|
virDomainUSBAddressSet *usbaddrs;
|
2011-05-04 11:55:38 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
virQEMUCaps *qemuCaps;
|
2010-10-26 14:04:46 +00:00
|
|
|
char *lockState;
|
2011-06-15 16:49:58 +00:00
|
|
|
|
|
|
|
bool fakeReboot;
|
2019-12-19 08:02:06 +00:00
|
|
|
bool pausedShutdown;
|
2021-08-19 12:54:18 +00:00
|
|
|
/* allowReboot:
|
|
|
|
*
|
|
|
|
* Unused with new QEMU versions which have QEMU_CAPS_SET_ACTION.
|
|
|
|
*
|
|
|
|
* Otherwise if it's set to VIR_TRISTATE_BOOL_YES, QEMU was started with
|
|
|
|
* -no-shutdown, and if set to VIR_TRISTATE_BOOL_NO qemu was started with
|
|
|
|
* -no-reboot instead.
|
|
|
|
*/
|
2017-10-11 13:57:16 +00:00
|
|
|
virTristateBool allowReboot;
|
2011-08-12 13:29:37 +00:00
|
|
|
|
2011-08-26 18:10:22 +00:00
|
|
|
unsigned long migMaxBandwidth;
|
2011-10-04 07:11:35 +00:00
|
|
|
char *origname;
|
2013-01-29 12:38:50 +00:00
|
|
|
int nbdPort; /* Port used for migration with NBD */
|
2013-10-11 03:27:13 +00:00
|
|
|
unsigned short migrationPort;
|
2014-02-06 13:30:59 +00:00
|
|
|
int preMigrationState;
|
2011-10-06 10:24:47 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
virChrdevs *devs;
|
2012-03-16 06:52:26 +00:00
|
|
|
|
|
|
|
qemuDomainCleanupCallback *cleanupCallbacks;
|
|
|
|
size_t ncleanupCallbacks;
|
|
|
|
size_t ncleanupCallbacks_max;
|
2013-03-21 14:40:29 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
virCgroup *cgroup;
|
2013-07-11 15:11:02 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
virPerf *perf;
|
2016-03-28 13:30:29 +00:00
|
|
|
|
2016-04-04 15:17:43 +00:00
|
|
|
qemuDomainUnpluggingDevice unplug;
|
|
|
|
|
2013-07-19 13:08:29 +00:00
|
|
|
char **qemuDevices; /* NULL-terminated list of devices aliases known to QEMU */
|
2014-02-04 15:42:13 +00:00
|
|
|
|
|
|
|
bool hookRun; /* true if there was a hook run over this domain */
|
2015-03-27 09:11:00 +00:00
|
|
|
|
|
|
|
/* Bitmaps below hold data from the auto NUMA feature */
|
2021-03-11 07:16:13 +00:00
|
|
|
virBitmap *autoNodeset;
|
|
|
|
virBitmap *autoCpuset;
|
2015-05-29 06:38:44 +00:00
|
|
|
|
|
|
|
bool signalIOError; /* true if the domain condition should be signalled on
|
|
|
|
I/O error */
|
2016-01-05 21:19:28 +00:00
|
|
|
bool signalStop; /* true if the domain condition should be signalled on
|
|
|
|
QMP STOP event */
|
2016-02-01 15:50:54 +00:00
|
|
|
char *machineName;
|
2016-02-26 08:15:55 +00:00
|
|
|
char *libDir; /* base path for per-domain files */
|
|
|
|
char *channelTargetDir; /* base path for per-domain channel targets */
|
2016-03-29 22:22:46 +00:00
|
|
|
|
|
|
|
/* random masterKey and length for encryption (not to be saved in our */
|
|
|
|
/* private XML) - need to restore at process reconnect */
|
|
|
|
uint8_t *masterKey;
|
|
|
|
size_t masterKeyLen;
|
2016-10-31 15:49:49 +00:00
|
|
|
|
|
|
|
/* note whether memory device alias does not correspond to slot number */
|
|
|
|
bool memAliasOrderMismatch;
|
2010-12-16 15:23:41 +00:00
|
|
|
|
2017-03-03 12:22:16 +00:00
|
|
|
/* for migrations using TLS with a secret (not to be saved in our */
|
|
|
|
/* private XML). */
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainSecretInfo *migSecinfo;
|
2016-09-14 05:28:18 +00:00
|
|
|
|
2017-05-16 11:26:54 +00:00
|
|
|
/* CPU def used to start the domain when it differs from the one actually
|
|
|
|
* provided by QEMU. */
|
2021-03-11 07:16:13 +00:00
|
|
|
virCPUDef *origCPU;
|
2017-06-15 06:34:55 +00:00
|
|
|
|
|
|
|
/* If true virtlogd is used as stdio handler for character devices. */
|
|
|
|
bool chardevStdioLogd;
|
2017-09-26 14:37:47 +00:00
|
|
|
|
|
|
|
/* Tracks blockjob state for vm. Valid only while reconnecting to qemu. */
|
|
|
|
virTristateBool reconnectBlockjobs;
|
2017-10-17 19:39:41 +00:00
|
|
|
|
|
|
|
/* Migration capabilities. Rechecked on reconnect, not to be saved in
|
|
|
|
* private XML. */
|
2021-03-11 07:16:13 +00:00
|
|
|
virBitmap *migrationCaps;
|
2018-04-19 08:00:36 +00:00
|
|
|
|
|
|
|
/* true if qemu-pr-helper process is running for the domain */
|
|
|
|
bool prDaemonRunning;
|
2017-07-07 12:29:32 +00:00
|
|
|
|
|
|
|
/* counter for generating node names for qemu disks */
|
|
|
|
unsigned long long nodenameindex;
|
2018-09-10 17:41:53 +00:00
|
|
|
|
|
|
|
/* qemuProcessStartCPUs stores the reason for starting vCPUs here for the
|
|
|
|
* RESUME event handler to use it */
|
|
|
|
virDomainRunningReason runningReason;
|
2018-11-13 11:50:41 +00:00
|
|
|
|
2018-10-09 13:41:51 +00:00
|
|
|
/* qemuProcessStopCPUs stores the reason for pausing vCPUs here for the
|
|
|
|
* STOP event handler to use it */
|
|
|
|
virDomainPausedReason pausedReason;
|
|
|
|
|
2018-11-13 11:50:41 +00:00
|
|
|
/* true if libvirt remembers the original owner for files */
|
|
|
|
bool rememberOwner;
|
2018-11-05 10:48:16 +00:00
|
|
|
|
|
|
|
/* true if global -mem-prealloc appears on cmd line */
|
|
|
|
bool memPrealloc;
|
2018-11-29 11:50:09 +00:00
|
|
|
|
|
|
|
/* running block jobs */
|
2020-10-22 17:04:18 +00:00
|
|
|
GHashTable *blockjobs;
|
2019-08-08 14:55:00 +00:00
|
|
|
|
2019-08-08 14:55:07 +00:00
|
|
|
bool disableSlirp;
|
2019-11-15 15:23:44 +00:00
|
|
|
|
|
|
|
/* Until we add full support for backing chains for pflash drives, these
|
|
|
|
* pointers hold the temporary virStorageSources for creating the -blockdev
|
|
|
|
* commandline for pflash drives. */
|
2021-03-11 07:16:13 +00:00
|
|
|
virStorageSource *pflash0;
|
|
|
|
virStorageSource *pflash1;
|
2019-09-18 09:27:05 +00:00
|
|
|
|
|
|
|
/* running backup job */
|
2021-03-11 07:16:13 +00:00
|
|
|
virDomainBackupDef *backup;
|
2020-02-25 09:55:08 +00:00
|
|
|
|
|
|
|
bool dbusDaemonRunning;
|
2020-02-25 09:55:11 +00:00
|
|
|
|
|
|
|
/* list of Ids to migrate */
|
2021-02-05 09:48:51 +00:00
|
|
|
GSList *dbusVMStateIds;
|
2020-02-25 09:55:11 +00:00
|
|
|
/* true if -object dbus-vmstate was added */
|
|
|
|
bool dbusVMState;
|
2016-04-06 12:56:52 +00:00
|
|
|
};
|
|
|
|
|
2019-06-18 16:12:37 +00:00
|
|
|
#define QEMU_DOMAIN_PRIVATE(vm) \
|
2021-03-11 07:16:13 +00:00
|
|
|
((qemuDomainObjPrivate *) (vm)->privateData)
|
2016-04-06 12:56:52 +00:00
|
|
|
|
2019-06-18 16:12:37 +00:00
|
|
|
#define QEMU_DOMAIN_DISK_PRIVATE(disk) \
|
2021-03-11 07:16:13 +00:00
|
|
|
((qemuDomainDiskPrivate *) (disk)->privateData)
|
2015-05-13 09:20:36 +00:00
|
|
|
|
|
|
|
typedef struct _qemuDomainDiskPrivate qemuDomainDiskPrivate;
|
|
|
|
struct _qemuDomainDiskPrivate {
|
|
|
|
virObject parent;
|
|
|
|
|
|
|
|
/* ideally we want a smarter way to interlock block jobs on single qemu disk
|
|
|
|
* in the future, but for now we just disallow any concurrent job on a
|
|
|
|
* single disk */
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuBlockJobData *blockjob;
|
2015-05-11 18:10:06 +00:00
|
|
|
|
|
|
|
bool migrating; /* the disk is being migrated */
|
2021-03-11 07:16:13 +00:00
|
|
|
virStorageSource *migrSource; /* disk source object used for NBD migration */
|
2016-04-06 12:56:52 +00:00
|
|
|
|
2016-05-19 13:29:02 +00:00
|
|
|
/* information about the device */
|
|
|
|
bool tray; /* device has tray */
|
|
|
|
bool removable; /* device media can be removed/changed */
|
2018-06-15 07:12:01 +00:00
|
|
|
|
|
|
|
char *qomName; /* QOM path of the disk (also refers to the block backend) */
|
2018-08-21 12:45:57 +00:00
|
|
|
char *nodeCopyOnRead; /* nodename of the disk-wide copy-on-read blockdev layer */
|
2021-04-30 06:58:45 +00:00
|
|
|
|
2021-05-18 15:47:48 +00:00
|
|
|
bool transientOverlayCreated; /* the overlay image of a transient disk was
|
|
|
|
created and the definition was updated */
|
2015-05-13 09:20:36 +00:00
|
|
|
};
|
|
|
|
|
2019-06-18 16:12:37 +00:00
|
|
|
#define QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src) \
|
2021-03-11 07:16:13 +00:00
|
|
|
((qemuDomainStorageSourcePrivate *) (src)->privateData)
|
2017-10-05 13:22:09 +00:00
|
|
|
|
|
|
|
typedef struct _qemuDomainStorageSourcePrivate qemuDomainStorageSourcePrivate;
|
|
|
|
struct _qemuDomainStorageSourcePrivate {
|
|
|
|
virObject parent;
|
|
|
|
|
|
|
|
/* data required for authentication to the storage source */
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainSecretInfo *secinfo;
|
2017-10-05 13:22:09 +00:00
|
|
|
|
|
|
|
/* data required for decryption of encrypted storage source */
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainSecretInfo *encinfo;
|
2020-03-09 07:19:02 +00:00
|
|
|
|
|
|
|
/* secure passthrough of the http cookie */
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainSecretInfo *httpcookie;
|
2020-06-29 13:10:42 +00:00
|
|
|
|
|
|
|
/* key for decrypting TLS certificate */
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainSecretInfo *tlsKeySecret;
|
2017-10-05 13:22:09 +00:00
|
|
|
};
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
virObject *qemuDomainStorageSourcePrivateNew(void);
|
|
|
|
qemuDomainStorageSourcePrivate *
|
|
|
|
qemuDomainStorageSourcePrivateFetch(virStorageSource *src);
|
2017-10-05 13:22:09 +00:00
|
|
|
|
2016-06-29 13:40:09 +00:00
|
|
|
typedef struct _qemuDomainVcpuPrivate qemuDomainVcpuPrivate;
|
|
|
|
struct _qemuDomainVcpuPrivate {
|
|
|
|
virObject parent;
|
|
|
|
|
2016-07-01 12:56:14 +00:00
|
|
|
pid_t tid; /* vcpu thread id */
|
2016-07-31 12:05:04 +00:00
|
|
|
int enable_id; /* order in which the vcpus were enabled in qemu */
|
2016-11-21 13:57:54 +00:00
|
|
|
int qemu_id; /* ID reported by qemu as 'CPU' in query-cpus */
|
2016-07-31 12:05:04 +00:00
|
|
|
char *alias;
|
2018-02-06 15:00:45 +00:00
|
|
|
virTristateBool halted;
|
2016-07-31 12:05:04 +00:00
|
|
|
|
2019-08-29 12:47:10 +00:00
|
|
|
/* copy of the data that qemu returned */
|
2021-03-11 07:16:13 +00:00
|
|
|
virJSONValue *props;
|
2019-08-29 12:47:10 +00:00
|
|
|
|
2016-07-31 12:05:04 +00:00
|
|
|
/* information for hotpluggable cpus */
|
|
|
|
char *type;
|
|
|
|
int socket_id;
|
|
|
|
int core_id;
|
|
|
|
int thread_id;
|
2017-06-27 14:04:38 +00:00
|
|
|
int node_id;
|
2016-07-31 12:05:04 +00:00
|
|
|
int vcpus;
|
2016-06-29 13:40:09 +00:00
|
|
|
};
|
|
|
|
|
2019-06-18 16:12:37 +00:00
|
|
|
#define QEMU_DOMAIN_VCPU_PRIVATE(vcpu) \
|
2021-03-11 07:16:13 +00:00
|
|
|
((qemuDomainVcpuPrivate *) (vcpu)->privateData)
|
2016-06-29 13:40:09 +00:00
|
|
|
|
|
|
|
|
2016-05-20 05:21:04 +00:00
|
|
|
struct qemuDomainDiskInfo {
|
|
|
|
bool removable;
|
2016-05-19 12:57:41 +00:00
|
|
|
bool tray;
|
2016-05-20 05:21:04 +00:00
|
|
|
bool tray_open;
|
2016-05-19 12:57:41 +00:00
|
|
|
bool empty;
|
2016-05-20 05:21:04 +00:00
|
|
|
int io_status;
|
2017-02-23 18:36:52 +00:00
|
|
|
char *nodename;
|
2016-05-20 05:21:04 +00:00
|
|
|
};
|
|
|
|
|
2019-06-18 16:12:37 +00:00
|
|
|
#define QEMU_DOMAIN_CHR_SOURCE_PRIVATE(dev) \
|
2021-03-11 07:16:13 +00:00
|
|
|
((qemuDomainChrSourcePrivate *) (dev)->privateData)
|
2016-06-17 10:36:11 +00:00
|
|
|
|
2016-10-21 12:31:37 +00:00
|
|
|
typedef struct _qemuDomainChrSourcePrivate qemuDomainChrSourcePrivate;
|
|
|
|
struct _qemuDomainChrSourcePrivate {
|
2016-06-17 10:36:11 +00:00
|
|
|
virObject parent;
|
|
|
|
|
|
|
|
/* for char devices using secret
|
|
|
|
* NB: *not* to be written to qemu domain object XML */
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainSecretInfo *secinfo;
|
2016-06-17 10:36:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-05-18 11:14:42 +00:00
|
|
|
typedef struct _qemuDomainVsockPrivate qemuDomainVsockPrivate;
|
|
|
|
struct _qemuDomainVsockPrivate {
|
|
|
|
virObject parent;
|
|
|
|
|
2018-05-22 13:57:47 +00:00
|
|
|
int vhostfd;
|
2018-05-18 11:14:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2019-09-23 10:44:36 +00:00
|
|
|
#define QEMU_DOMAIN_VIDEO_PRIVATE(dev) \
|
2021-03-11 07:16:13 +00:00
|
|
|
((qemuDomainVideoPrivate *) (dev)->privateData)
|
2019-09-23 10:44:36 +00:00
|
|
|
|
|
|
|
typedef struct _qemuDomainVideoPrivate qemuDomainVideoPrivate;
|
|
|
|
struct _qemuDomainVideoPrivate {
|
|
|
|
virObject parent;
|
|
|
|
|
2019-09-23 10:44:37 +00:00
|
|
|
int vhost_user_fd;
|
2019-09-23 10:44:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2019-06-18 16:12:37 +00:00
|
|
|
#define QEMU_DOMAIN_GRAPHICS_PRIVATE(dev) \
|
2021-03-11 07:16:13 +00:00
|
|
|
((qemuDomainGraphicsPrivate *) (dev)->privateData)
|
2019-01-10 14:50:11 +00:00
|
|
|
|
|
|
|
typedef struct _qemuDomainGraphicsPrivate qemuDomainGraphicsPrivate;
|
|
|
|
struct _qemuDomainGraphicsPrivate {
|
|
|
|
virObject parent;
|
|
|
|
|
|
|
|
char *tlsAlias;
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainSecretInfo *secinfo;
|
2019-01-10 14:50:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2019-08-08 14:55:02 +00:00
|
|
|
#define QEMU_DOMAIN_NETWORK_PRIVATE(dev) \
|
2021-03-11 07:16:13 +00:00
|
|
|
((qemuDomainNetworkPrivate *) (dev)->privateData)
|
2019-08-08 14:55:02 +00:00
|
|
|
|
|
|
|
typedef struct _qemuDomainNetworkPrivate qemuDomainNetworkPrivate;
|
|
|
|
struct _qemuDomainNetworkPrivate {
|
|
|
|
virObject parent;
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuSlirp *slirp;
|
2019-08-08 14:55:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2013-06-07 10:23:32 +00:00
|
|
|
typedef enum {
|
|
|
|
QEMU_PROCESS_EVENT_WATCHDOG = 0,
|
2013-06-07 10:23:34 +00:00
|
|
|
QEMU_PROCESS_EVENT_GUESTPANIC,
|
2014-05-26 15:02:05 +00:00
|
|
|
QEMU_PROCESS_EVENT_DEVICE_DELETED,
|
2014-09-17 17:07:50 +00:00
|
|
|
QEMU_PROCESS_EVENT_NIC_RX_FILTER_CHANGED,
|
2014-11-13 13:09:39 +00:00
|
|
|
QEMU_PROCESS_EVENT_SERIAL_CHANGED,
|
2015-03-13 16:00:03 +00:00
|
|
|
QEMU_PROCESS_EVENT_BLOCK_JOB,
|
2018-12-05 09:40:45 +00:00
|
|
|
QEMU_PROCESS_EVENT_JOB_STATUS_CHANGE,
|
2016-02-11 14:32:48 +00:00
|
|
|
QEMU_PROCESS_EVENT_MONITOR_EOF,
|
2018-06-27 10:17:59 +00:00
|
|
|
QEMU_PROCESS_EVENT_PR_DISCONNECT,
|
2018-12-24 10:15:12 +00:00
|
|
|
QEMU_PROCESS_EVENT_RDMA_GID_STATUS_CHANGED,
|
qemu: support Panic Crashloaded event handling
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: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
2020-02-04 07:41:00 +00:00
|
|
|
QEMU_PROCESS_EVENT_GUEST_CRASHLOADED,
|
2021-01-21 13:16:44 +00:00
|
|
|
QEMU_PROCESS_EVENT_MEMORY_DEVICE_SIZE_CHANGE,
|
2013-06-07 10:23:32 +00:00
|
|
|
|
|
|
|
QEMU_PROCESS_EVENT_LAST
|
|
|
|
} qemuProcessEventType;
|
|
|
|
|
|
|
|
struct qemuProcessEvent {
|
2021-03-11 07:16:13 +00:00
|
|
|
virDomainObj *vm;
|
2013-06-07 10:23:32 +00:00
|
|
|
qemuProcessEventType eventType;
|
2011-02-14 16:09:39 +00:00
|
|
|
int action;
|
2015-03-13 16:00:03 +00:00
|
|
|
int status;
|
2014-05-26 15:02:05 +00:00
|
|
|
void *data;
|
2011-02-14 16:09:39 +00:00
|
|
|
};
|
|
|
|
|
2018-02-02 12:13:46 +00:00
|
|
|
void qemuProcessEventFree(struct qemuProcessEvent *event);
|
|
|
|
|
2020-03-16 12:10:24 +00:00
|
|
|
#define QEMU_TYPE_DOMAIN_LOG_CONTEXT qemu_domain_log_context_get_type()
|
|
|
|
G_DECLARE_FINAL_TYPE(qemuDomainLogContext, qemu_domain_log_context, QEMU, DOMAIN_LOG_CONTEXT, GObject);
|
2015-11-12 12:43:29 +00:00
|
|
|
|
2017-06-02 20:50:18 +00:00
|
|
|
typedef struct _qemuDomainSaveCookie qemuDomainSaveCookie;
|
|
|
|
struct _qemuDomainSaveCookie {
|
|
|
|
virObject parent;
|
2017-06-02 20:52:03 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
virCPUDef *cpu;
|
2019-08-08 14:55:07 +00:00
|
|
|
bool slirpHelper;
|
2017-06-02 20:50:18 +00:00
|
|
|
};
|
|
|
|
|
2020-01-13 10:06:39 +00:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuDomainSaveCookie, virObjectUnref);
|
2019-06-17 13:07:00 +00:00
|
|
|
|
2021-06-21 12:43:01 +00:00
|
|
|
typedef struct _qemuDomainXmlNsEnvTuple qemuDomainXmlNsEnvTuple;
|
|
|
|
struct _qemuDomainXmlNsEnvTuple {
|
|
|
|
char *name;
|
|
|
|
char *value;
|
|
|
|
};
|
|
|
|
|
2019-06-17 13:07:00 +00:00
|
|
|
typedef struct _qemuDomainXmlNsDef qemuDomainXmlNsDef;
|
|
|
|
struct _qemuDomainXmlNsDef {
|
|
|
|
char **args;
|
|
|
|
|
|
|
|
unsigned int num_env;
|
2021-06-21 12:43:01 +00:00
|
|
|
qemuDomainXmlNsEnvTuple *env;
|
2019-06-17 15:17:56 +00:00
|
|
|
|
|
|
|
char **capsadd;
|
|
|
|
|
|
|
|
char **capsdel;
|
2021-03-15 14:06:29 +00:00
|
|
|
|
2021-04-15 08:12:12 +00:00
|
|
|
/* We deliberately keep this as a string so that it's parsed only when
|
2021-03-15 14:06:29 +00:00
|
|
|
* starting the VM to avoid any form of errors in the parser or when
|
|
|
|
* changing qemu versions. The knob is mainly for development/CI purposes */
|
|
|
|
char *deprecationBehavior;
|
2019-06-17 13:07:00 +00:00
|
|
|
};
|
|
|
|
|
2021-02-08 15:08:27 +00:00
|
|
|
|
|
|
|
typedef struct _qemuDomainJobPrivateMigrateTempBitmap qemuDomainJobPrivateMigrateTempBitmap;
|
|
|
|
struct _qemuDomainJobPrivateMigrateTempBitmap {
|
|
|
|
char *nodename;
|
|
|
|
char *bitmapname;
|
|
|
|
};
|
|
|
|
|
|
|
|
void
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainJobPrivateMigrateTempBitmapFree(qemuDomainJobPrivateMigrateTempBitmap *bmp);
|
2021-02-08 15:08:27 +00:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuDomainJobPrivateMigrateTempBitmap, qemuDomainJobPrivateMigrateTempBitmapFree);
|
|
|
|
|
|
|
|
|
2020-07-16 11:48:34 +00:00
|
|
|
typedef struct _qemuDomainJobPrivate qemuDomainJobPrivate;
|
|
|
|
struct _qemuDomainJobPrivate {
|
|
|
|
bool spiceMigration; /* we asked for spice migration and we
|
|
|
|
* should wait for it to finish */
|
|
|
|
bool spiceMigrated; /* spice migration completed */
|
|
|
|
bool dumpCompleted; /* dump completed */
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuMigrationParams *migParams;
|
2021-02-08 15:08:27 +00:00
|
|
|
GSList *migTempBitmaps; /* temporary block dirty bitmaps - qemuDomainJobPrivateMigrateTempBitmap */
|
2020-07-16 11:48:34 +00:00
|
|
|
};
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainObjStartWorker(virDomainObj *dom);
|
|
|
|
void qemuDomainObjStopWorker(virDomainObj *dom);
|
2020-02-12 12:26:11 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
virDomainObj *qemuDomainObjFromDomain(virDomainPtr domain);
|
2019-06-17 13:07:00 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainSaveCookie *qemuDomainSaveCookieNew(virDomainObj *vm);
|
2017-06-02 20:50:18 +00:00
|
|
|
|
2011-07-08 21:58:28 +00:00
|
|
|
void qemuDomainEventFlush(int timer, void *opaque);
|
2011-02-14 16:09:39 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuMonitor *qemuDomainGetMonitor(virDomainObj *vm)
|
2015-03-31 15:24:50 +00:00
|
|
|
ATTRIBUTE_NONNULL(1);
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainObjEnterMonitor(virQEMUDriver *driver,
|
|
|
|
virDomainObj *obj)
|
qemu: fix crash when mixing sync and async monitor jobs
Currently, we attempt to run sync job and async job at the same time. It
means that the monitor commands for two jobs can be run in any order.
In the function qemuDomainObjEnterMonitorInternal():
if (priv->job.active == QEMU_JOB_NONE && priv->job.asyncJob) {
if (qemuDomainObjBeginNestedJob(driver, obj) < 0)
We check whether the caller is an async job by priv->job.active and
priv->job.asynJob. But when an async job is running, and a sync job is
also running at the time of the check, then priv->job.active is not
QEMU_JOB_NONE. So we cannot check whether the caller is an async job
in the function qemuDomainObjEnterMonitorInternal(), and must instead
put the burden on the caller to tell us when an async command wants
to do a nested job.
Once the burden is on the caller, then only async monitor enters need
to worry about whether the VM is still running; for sync monitor enter,
the internal return is always 0, so lots of ignore_value can be dropped.
* src/qemu/THREADS.txt: Reflect new rules.
* src/qemu/qemu_domain.h (qemuDomainObjEnterMonitorAsync): New
prototype.
* src/qemu/qemu_process.h (qemuProcessStartCPUs)
(qemuProcessStopCPUs): Add parameter.
* src/qemu/qemu_migration.h (qemuMigrationToFile): Likewise.
(qemuMigrationWaitForCompletion): Make static.
* src/qemu/qemu_domain.c (qemuDomainObjEnterMonitorInternal): Add
parameter.
(qemuDomainObjEnterMonitorAsync): New function.
(qemuDomainObjEnterMonitor, qemuDomainObjEnterMonitorWithDriver):
Update callers.
* src/qemu/qemu_driver.c (qemuDomainSaveInternal)
(qemudDomainCoreDump, doCoreDump, processWatchdogEvent)
(qemudDomainSuspend, qemudDomainResume, qemuDomainSaveImageStartVM)
(qemuDomainSnapshotCreateActive, qemuDomainRevertToSnapshot):
Likewise.
* src/qemu/qemu_process.c (qemuProcessStopCPUs)
(qemuProcessFakeReboot, qemuProcessRecoverMigration)
(qemuProcessRecoverJob, qemuProcessStart): Likewise.
* src/qemu/qemu_migration.c (qemuMigrationToFile)
(qemuMigrationWaitForCompletion, qemuMigrationUpdateJobStatus)
(qemuMigrationJobStart, qemuDomainMigrateGraphicsRelocate)
(doNativeMigrate, doTunnelMigrate, qemuMigrationPerformJob)
(qemuMigrationPerformPhase, qemuMigrationFinish)
(qemuMigrationConfirm): Likewise.
* src/qemu/qemu_hotplug.c: Drop unneeded ignore_value.
2011-07-28 23:18:24 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
2021-11-24 12:41:09 +00:00
|
|
|
void qemuDomainObjExitMonitor(virQEMUDriver *driver,
|
|
|
|
virDomainObj *obj)
|
2021-11-24 12:44:56 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainObjEnterMonitorAsync(virQEMUDriver *driver,
|
|
|
|
virDomainObj *obj,
|
2014-06-15 16:32:56 +00:00
|
|
|
qemuDomainAsyncJob asyncJob)
|
2019-10-14 12:25:14 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT;
|
2011-10-05 17:31:54 +00:00
|
|
|
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuAgent *qemuDomainObjEnterAgent(virDomainObj *obj)
|
2013-02-06 18:17:20 +00:00
|
|
|
ATTRIBUTE_NONNULL(1);
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainObjExitAgent(virDomainObj *obj, qemuAgent *agent)
|
2016-11-14 14:24:23 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
2011-10-05 17:31:54 +00:00
|
|
|
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainObjEnterRemote(virDomainObj *obj)
|
2013-02-06 18:17:20 +00:00
|
|
|
ATTRIBUTE_NONNULL(1);
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainObjExitRemote(virDomainObj *obj,
|
2018-06-28 09:38:52 +00:00
|
|
|
bool checkActive)
|
2019-10-14 12:25:14 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT;
|
2010-12-16 16:12:02 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
virDomainDef *qemuDomainDefCopy(virQEMUDriver *driver,
|
|
|
|
virQEMUCaps *qemuCaps,
|
|
|
|
virDomainDef *src,
|
2013-06-11 13:03:17 +00:00
|
|
|
unsigned int flags);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainDefFormatBuf(virQEMUDriver *driver,
|
|
|
|
virQEMUCaps *qemuCaps,
|
|
|
|
virDomainDef *vm,
|
2012-05-04 19:00:13 +00:00
|
|
|
unsigned int flags,
|
|
|
|
virBuffer *buf);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
char *qemuDomainDefFormatXML(virQEMUDriver *driver,
|
|
|
|
virQEMUCaps *qemuCaps,
|
|
|
|
virDomainDef *vm,
|
2012-10-08 09:58:05 +00:00
|
|
|
unsigned int flags);
|
2011-05-27 10:30:26 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
char *qemuDomainFormatXML(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm,
|
2012-10-08 09:58:05 +00:00
|
|
|
unsigned int flags);
|
2011-01-31 10:47:03 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
char *qemuDomainDefFormatLive(virQEMUDriver *driver,
|
|
|
|
virQEMUCaps *qemuCaps,
|
|
|
|
virDomainDef *def,
|
|
|
|
virCPUDef *origCPU,
|
2012-05-04 19:23:17 +00:00
|
|
|
bool inactive,
|
|
|
|
bool compatible);
|
2012-03-09 15:42:46 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainObjTaint(virQEMUDriver *driver,
|
|
|
|
virDomainObj *obj,
|
2014-06-01 00:22:30 +00:00
|
|
|
virDomainTaintFlags taint,
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainLogContext *logCtxt);
|
2011-05-04 10:59:20 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainObjTaintMsg(virQEMUDriver *driver,
|
|
|
|
virDomainObj *obj,
|
2021-01-22 11:44:32 +00:00
|
|
|
virDomainTaintFlags taint,
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainLogContext *logCtxt,
|
2021-01-22 11:44:32 +00:00
|
|
|
const char *msg,
|
|
|
|
...) G_GNUC_PRINTF(5, 6);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
char **qemuDomainObjGetTainting(virQEMUDriver *driver,
|
|
|
|
virDomainObj *obj);
|
2021-01-22 15:06:35 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainObjCheckTaint(virQEMUDriver *driver,
|
|
|
|
virDomainObj *obj,
|
|
|
|
qemuDomainLogContext *logCtxt,
|
2020-10-04 17:51:27 +00:00
|
|
|
bool incomingMigration);
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainObjCheckDiskTaint(virQEMUDriver *driver,
|
|
|
|
virDomainObj *obj,
|
|
|
|
virDomainDiskDef *disk,
|
|
|
|
qemuDomainLogContext *logCtxt);
|
|
|
|
void qemuDomainObjCheckHostdevTaint(virQEMUDriver *driver,
|
|
|
|
virDomainObj *obj,
|
|
|
|
virDomainHostdevDef *disk,
|
|
|
|
qemuDomainLogContext *logCtxt);
|
|
|
|
void qemuDomainObjCheckNetTaint(virQEMUDriver *driver,
|
|
|
|
virDomainObj *obj,
|
|
|
|
virDomainNetDef *net,
|
|
|
|
qemuDomainLogContext *logCtxt);
|
2011-05-04 10:59:20 +00:00
|
|
|
|
2015-11-12 12:43:29 +00:00
|
|
|
typedef enum {
|
|
|
|
QEMU_DOMAIN_LOG_CONTEXT_MODE_START,
|
|
|
|
QEMU_DOMAIN_LOG_CONTEXT_MODE_ATTACH,
|
|
|
|
QEMU_DOMAIN_LOG_CONTEXT_MODE_STOP,
|
|
|
|
} qemuDomainLogContextMode;
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainLogContext *qemuDomainLogContextNew(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm,
|
2015-11-12 12:43:29 +00:00
|
|
|
qemuDomainLogContextMode mode);
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainLogContextWrite(qemuDomainLogContext *ctxt,
|
2019-10-15 11:35:07 +00:00
|
|
|
const char *fmt, ...) G_GNUC_PRINTF(2, 3);
|
2021-03-11 07:16:13 +00:00
|
|
|
ssize_t qemuDomainLogContextRead(qemuDomainLogContext *ctxt,
|
2015-11-12 12:43:29 +00:00
|
|
|
char **msg);
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainLogContextGetWriteFD(qemuDomainLogContext *ctxt);
|
|
|
|
void qemuDomainLogContextMarkPosition(qemuDomainLogContext *ctxt);
|
2011-05-05 11:38:04 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
virLogManager *qemuDomainLogContextGetManager(qemuDomainLogContext *ctxt);
|
2016-02-23 13:05:09 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainLogAppendMessage(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm,
|
2016-06-07 14:19:03 +00:00
|
|
|
const char *fmt,
|
2019-10-15 11:35:07 +00:00
|
|
|
...) G_GNUC_PRINTF(3, 4);
|
2016-06-07 14:19:03 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
const char *qemuFindQemuImgBinary(virQEMUDriver *driver);
|
2011-09-21 19:08:51 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainSnapshotWriteMetadata(virDomainObj *vm,
|
|
|
|
virDomainMomentObj *snapshot,
|
|
|
|
virDomainXMLOption *xmlopt,
|
2019-03-05 02:25:33 +00:00
|
|
|
const char *snapshotDir);
|
2011-09-21 19:08:51 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainSnapshotForEachQcow2(virQEMUDriver *driver,
|
|
|
|
virDomainDef *def,
|
|
|
|
virDomainMomentObj *snap,
|
2011-09-21 19:08:51 +00:00
|
|
|
const char *op,
|
|
|
|
bool try_all);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainSnapshotDiscard(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm,
|
|
|
|
virDomainMomentObj *snap,
|
2011-09-21 19:08:51 +00:00
|
|
|
bool update_current,
|
|
|
|
bool metadata_only);
|
|
|
|
|
2019-03-27 07:12:37 +00:00
|
|
|
typedef struct _virQEMUMomentRemove virQEMUMomentRemove;
|
|
|
|
struct _virQEMUMomentRemove {
|
2021-03-11 07:16:13 +00:00
|
|
|
virQEMUDriver *driver;
|
|
|
|
virDomainObj *vm;
|
2011-09-21 19:08:51 +00:00
|
|
|
int err;
|
|
|
|
bool metadata_only;
|
2021-03-11 07:16:13 +00:00
|
|
|
virDomainMomentObj *current;
|
2019-03-27 07:12:37 +00:00
|
|
|
bool found;
|
2021-03-11 07:16:13 +00:00
|
|
|
int (*momentDiscard)(virQEMUDriver *, virDomainObj *,
|
|
|
|
virDomainMomentObj *, bool, bool);
|
2011-09-21 19:08:51 +00:00
|
|
|
};
|
|
|
|
|
2019-03-27 07:12:37 +00:00
|
|
|
int qemuDomainMomentDiscardAll(void *payload,
|
2020-10-21 11:31:16 +00:00
|
|
|
const char *name,
|
2019-03-27 07:12:37 +00:00
|
|
|
void *data);
|
2011-09-21 19:08:51 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainSnapshotDiscardAllMetadata(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm);
|
2011-09-21 19:08:51 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainRemoveInactive(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm);
|
2011-09-21 19:08:51 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainSetFakeReboot(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm,
|
2011-09-28 10:10:13 +00:00
|
|
|
bool value);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainCheckDiskStartupPolicy(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm,
|
2017-10-03 10:51:47 +00:00
|
|
|
size_t diskIndex,
|
|
|
|
bool cold_boot);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainCheckDiskPresence(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm,
|
2016-08-01 15:51:28 +00:00
|
|
|
unsigned int flags);
|
2013-07-29 12:51:15 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainStorageSourceValidateDepth(virStorageSource *src,
|
2019-09-04 14:58:08 +00:00
|
|
|
int add,
|
|
|
|
const char *diskdst);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainDetermineDiskChain(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm,
|
|
|
|
virDomainDiskDef *disk,
|
|
|
|
virStorageSource *disksrc,
|
2014-09-11 16:59:32 +00:00
|
|
|
bool report_broken);
|
2012-03-16 06:52:26 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
bool qemuDomainDiskChangeSupported(virDomainDiskDef *disk,
|
|
|
|
virDomainDiskDef *orig_disk);
|
2015-09-15 13:25:18 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainGetImageIds(virQEMUDriverConfig *cfg,
|
|
|
|
virDomainObj *vm,
|
|
|
|
virStorageSource *src,
|
|
|
|
virStorageSource *parentSrc,
|
2019-12-03 14:17:23 +00:00
|
|
|
uid_t *uid,
|
|
|
|
gid_t *gid);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainStorageFileInit(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm,
|
|
|
|
virStorageSource *src,
|
|
|
|
virStorageSource *parent);
|
2014-12-12 16:53:33 +00:00
|
|
|
char *qemuDomainStorageAlias(const char *device, int depth);
|
2014-06-30 13:48:45 +00:00
|
|
|
|
2020-01-17 13:28:14 +00:00
|
|
|
const char *
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainDiskGetTopNodename(virDomainDiskDef *disk)
|
2020-01-17 13:28:14 +00:00
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainDiskGetBackendAlias(virDomainDiskDef *disk,
|
|
|
|
virQEMUCaps *qemuCaps,
|
2018-06-26 04:58:47 +00:00
|
|
|
char **backendAlias)
|
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
|
2019-10-14 12:25:14 +00:00
|
|
|
ATTRIBUTE_NONNULL(3) G_GNUC_WARN_UNUSED_RESULT;
|
2018-06-26 04:58:47 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainStorageSourceChainAccessAllow(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm,
|
|
|
|
virStorageSource *src);
|
|
|
|
int qemuDomainStorageSourceChainAccessRevoke(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm,
|
|
|
|
virStorageSource *src);
|
|
|
|
|
|
|
|
void qemuDomainStorageSourceAccessRevoke(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm,
|
|
|
|
virStorageSource *elem);
|
|
|
|
int qemuDomainStorageSourceAccessAllow(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm,
|
|
|
|
virStorageSource *elem,
|
2019-04-18 07:41:38 +00:00
|
|
|
bool readonly,
|
2020-02-27 10:20:51 +00:00
|
|
|
bool newSource,
|
|
|
|
bool chainTop);
|
2016-02-29 14:39:57 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainPrepareStorageSourceBlockdev(virDomainDiskDef *disk,
|
|
|
|
virStorageSource *src,
|
|
|
|
qemuDomainObjPrivate *priv,
|
|
|
|
virQEMUDriverConfig *cfg);
|
2018-10-09 09:06:39 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainCleanupAdd(virDomainObj *vm,
|
2012-03-16 06:52:26 +00:00
|
|
|
qemuDomainCleanupCallback cb);
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainCleanupRemove(virDomainObj *vm,
|
2012-03-16 06:52:26 +00:00
|
|
|
qemuDomainCleanupCallback cb);
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainCleanupRun(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm);
|
2012-03-16 06:52:26 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainObjPrivateDataClear(qemuDomainObjPrivate *priv);
|
2017-08-23 12:19:36 +00:00
|
|
|
|
2013-03-05 15:17:24 +00:00
|
|
|
extern virDomainXMLPrivateDataCallbacks virQEMUDriverPrivateDataCallbacks;
|
2019-08-20 21:39:24 +00:00
|
|
|
extern virXMLNamespace virQEMUDriverDomainXMLNamespace;
|
2013-02-19 16:33:52 +00:00
|
|
|
extern virDomainDefParserConfig virQEMUDriverDomainDefParserConfig;
|
2017-05-19 14:46:27 +00:00
|
|
|
extern virDomainABIStability virQEMUDriverDomainABIStability;
|
2017-06-02 20:50:18 +00:00
|
|
|
extern virSaveCookieCallbacks virQEMUDriverDomainSaveCookie;
|
2013-03-05 15:17:24 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainUpdateDeviceList(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm, int asyncJob);
|
2013-07-19 13:08:29 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainUpdateMemoryDeviceInfo(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm,
|
2015-01-19 12:21:09 +00:00
|
|
|
int asyncJob);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
bool qemuDomainDefCheckABIStability(virQEMUDriver *driver,
|
|
|
|
virQEMUCaps *qemuCaps,
|
|
|
|
virDomainDef *src,
|
|
|
|
virDomainDef *dst);
|
2014-02-27 10:45:13 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
bool qemuDomainCheckABIStability(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm,
|
|
|
|
virDomainDef *dst);
|
2017-06-14 11:43:37 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
bool qemuDomainAgentAvailable(virDomainObj *vm,
|
2014-02-27 10:45:13 +00:00
|
|
|
bool reportError);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
bool qemuDomainDiskBlockJobIsActive(virDomainDiskDef *disk);
|
|
|
|
bool qemuDomainHasBlockjob(virDomainObj *vm, bool copy_only)
|
2015-05-13 07:47:21 +00:00
|
|
|
ATTRIBUTE_NONNULL(1);
|
2015-03-13 16:22:04 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainAlignMemorySizes(virDomainDef *def);
|
|
|
|
int qemuDomainMemoryDeviceAlignSize(virDomainDef *def,
|
|
|
|
virDomainMemoryDef *mem);
|
2015-02-18 13:31:47 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
virDomainChrDef *qemuFindAgentConfig(virDomainDef *def);
|
2015-04-24 14:43:38 +00:00
|
|
|
|
2018-11-28 16:34:07 +00:00
|
|
|
/* You should normally avoid these functions and use the variant that
|
|
|
|
* doesn't have "Machine" in the name instead. */
|
2018-08-22 09:15:20 +00:00
|
|
|
bool qemuDomainMachineIsARMVirt(const char *machine,
|
|
|
|
const virArch arch);
|
2017-04-18 10:43:58 +00:00
|
|
|
bool qemuDomainMachineIsPSeries(const char *machine,
|
|
|
|
const virArch arch);
|
2018-11-28 15:48:41 +00:00
|
|
|
bool qemuDomainMachineHasBuiltinIDE(const char *machine,
|
|
|
|
const virArch arch);
|
2018-11-28 15:15:31 +00:00
|
|
|
|
|
|
|
bool qemuDomainIsQ35(const virDomainDef *def);
|
|
|
|
bool qemuDomainIsI440FX(const virDomainDef *def);
|
|
|
|
bool qemuDomainIsS390CCW(const virDomainDef *def);
|
|
|
|
bool qemuDomainIsARMVirt(const virDomainDef *def);
|
|
|
|
bool qemuDomainIsRISCVVirt(const virDomainDef *def);
|
|
|
|
bool qemuDomainIsPSeries(const virDomainDef *def);
|
|
|
|
bool qemuDomainHasPCIRoot(const virDomainDef *def);
|
|
|
|
bool qemuDomainHasPCIeRoot(const virDomainDef *def);
|
|
|
|
bool qemuDomainHasBuiltinIDE(const virDomainDef *def);
|
2020-11-18 16:11:05 +00:00
|
|
|
bool qemuDomainHasBuiltinESP(const virDomainDef *def);
|
2018-11-28 15:15:31 +00:00
|
|
|
bool qemuDomainNeedsFDC(const virDomainDef *def);
|
2021-03-11 07:16:13 +00:00
|
|
|
bool qemuDomainSupportsPCI(virDomainDef *def,
|
|
|
|
virQEMUCaps *qemuCaps);
|
2015-04-28 09:21:52 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainUpdateCurrentMemorySize(virDomainObj *vm);
|
2015-05-27 13:51:52 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
unsigned long long qemuDomainGetMemLockLimitBytes(virDomainDef *def,
|
2019-09-26 11:15:47 +00:00
|
|
|
bool forceVFIO);
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainAdjustMaxMemLock(virDomainObj *vm,
|
2019-09-26 11:15:47 +00:00
|
|
|
bool forceVFIO);
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainAdjustMaxMemLockHostdev(virDomainObj *vm,
|
|
|
|
virDomainHostdevDef *hostdev);
|
2015-11-06 14:51:33 +00:00
|
|
|
|
2015-10-08 04:06:15 +00:00
|
|
|
int qemuDomainDefValidateMemoryHotplug(const virDomainDef *def,
|
|
|
|
const virDomainMemoryDef *mem);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
bool qemuDomainSupportsNewVcpuHotplug(virDomainObj *vm);
|
|
|
|
bool qemuDomainHasVcpuPids(virDomainObj *vm);
|
|
|
|
pid_t qemuDomainGetVcpuPid(virDomainObj *vm, unsigned int vcpuid);
|
|
|
|
int qemuDomainValidateVcpuInfo(virDomainObj *vm);
|
|
|
|
int qemuDomainRefreshVcpuInfo(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm,
|
2016-08-05 12:48:27 +00:00
|
|
|
int asyncJob,
|
|
|
|
bool state);
|
2021-03-11 07:16:13 +00:00
|
|
|
bool qemuDomainGetVcpuHalted(virDomainObj *vm, unsigned int vcpu);
|
|
|
|
int qemuDomainRefreshVcpuHalted(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm,
|
2016-10-13 11:42:45 +00:00
|
|
|
int asyncJob);
|
2015-11-11 13:20:04 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
bool qemuDomainSupportsNicdev(virDomainDef *def,
|
|
|
|
virDomainNetDef *net);
|
2016-02-15 16:44:21 +00:00
|
|
|
|
2017-01-23 13:32:13 +00:00
|
|
|
bool qemuDomainNetSupportsMTU(virDomainNetType type);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainSetPrivatePaths(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm);
|
2016-04-03 19:59:46 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
virDomainDiskDef *qemuDomainDiskByName(virDomainDef *def, const char *name);
|
2016-02-26 15:29:58 +00:00
|
|
|
|
2016-03-29 22:22:46 +00:00
|
|
|
char *qemuDomainGetMasterKeyFilePath(const char *libDir);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainMasterKeyReadFile(qemuDomainObjPrivate *priv);
|
2016-03-29 22:22:46 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainWriteMasterKeyFile(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm);
|
2016-05-02 17:11:24 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainMasterKeyCreate(virDomainObj *vm);
|
2016-03-29 22:22:46 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainMasterKeyRemove(qemuDomainObjPrivate *priv);
|
2016-03-29 22:22:46 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainSecretInfoFree(qemuDomainSecretInfo *secinfo)
|
2017-03-03 12:22:16 +00:00
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
|
2020-03-16 08:47:17 +00:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuDomainSecretInfo, qemuDomainSecretInfoFree);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainSecretInfoDestroy(qemuDomainSecretInfo *secinfo);
|
2018-05-28 13:17:01 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainSecretDiskDestroy(virDomainDiskDef *disk)
|
2016-04-06 19:00:59 +00:00
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
bool qemuDomainStorageSourceHasAuth(virStorageSource *src)
|
2016-06-24 19:47:09 +00:00
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainSecretInfo *
|
|
|
|
qemuDomainSecretInfoTLSNew(qemuDomainObjPrivate *priv,
|
2017-03-03 12:22:16 +00:00
|
|
|
const char *srcAlias,
|
|
|
|
const char *secretUUID);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainSecretHostdevDestroy(virDomainHostdevDef *disk)
|
2016-04-06 14:41:33 +00:00
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainSecretChardevDestroy(virDomainChrSourceDef *dev)
|
2016-10-21 23:02:35 +00:00
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainSecretChardevPrepare(virQEMUDriverConfig *cfg,
|
|
|
|
qemuDomainObjPrivate *priv,
|
2016-10-21 23:02:35 +00:00
|
|
|
const char *chrAlias,
|
2021-03-11 07:16:13 +00:00
|
|
|
virDomainChrSourceDef *dev)
|
2016-10-21 23:02:35 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
|
2018-02-09 16:14:41 +00:00
|
|
|
ATTRIBUTE_NONNULL(4);
|
2016-10-21 23:02:35 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainSecretDestroy(virDomainObj *vm)
|
2016-04-06 19:00:59 +00:00
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainSecretPrepare(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm)
|
2018-02-09 16:14:41 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
2016-04-06 19:00:59 +00:00
|
|
|
|
2018-04-19 11:44:04 +00:00
|
|
|
int qemuDomainDeviceDefValidateDisk(const virDomainDiskDef *disk,
|
2021-03-11 07:16:13 +00:00
|
|
|
virQEMUCaps *qemuCaps);
|
2018-04-19 11:44:04 +00:00
|
|
|
|
2021-10-24 09:51:26 +00:00
|
|
|
int qemuDomainDeviceDiskDefPostParse(virDomainDiskDef *disk,
|
|
|
|
unsigned int parseFlags);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainPrepareChannel(virDomainChrDef *chr,
|
2016-03-30 14:34:17 +00:00
|
|
|
const char *domainChannelTargetDir)
|
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainPrepareChardevSourceTLS(virDomainChrSourceDef *source,
|
|
|
|
virQEMUDriverConfig *cfg)
|
2016-10-24 12:05:54 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainPrepareChardevSource(virDomainDef *def,
|
|
|
|
virQEMUDriverConfig *cfg)
|
2016-10-24 12:05:54 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainPrepareShmemChardev(virDomainShmemDef *shmem)
|
2016-09-13 11:40:50 +00:00
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
bool qemuDomainVcpuHotplugIsInOrder(virDomainDef *def)
|
2016-08-04 11:57:46 +00:00
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainVcpuPersistOrder(virDomainDef *def)
|
2016-08-04 12:23:25 +00:00
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainCheckMonitor(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm,
|
2016-09-12 08:24:21 +00:00
|
|
|
qemuDomainAsyncJob asyncJob);
|
|
|
|
|
2021-06-11 11:24:14 +00:00
|
|
|
bool qemuDomainSupportsVideoVga(const virDomainVideoDef *video,
|
2021-03-11 07:16:13 +00:00
|
|
|
virQEMUCaps *qemuCaps);
|
2016-09-30 12:41:37 +00:00
|
|
|
|
2019-09-16 15:14:48 +00:00
|
|
|
bool qemuDomainNeedsVFIO(const virDomainDef *def);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int qemuDomainGetHostdevPath(virDomainHostdevDef *dev,
|
2019-09-17 09:47:59 +00:00
|
|
|
char **path,
|
|
|
|
int *perms);
|
2017-02-09 10:01:29 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
virDomainDiskDef *qemuDomainDiskLookupByNodename(virDomainDef *def,
|
|
|
|
virDomainBackupDef *backupdef,
|
2017-02-22 16:51:05 +00:00
|
|
|
const char *nodename,
|
2021-03-11 07:16:13 +00:00
|
|
|
virStorageSource **src);
|
2017-02-22 16:51:05 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
char *qemuDomainDiskBackingStoreGetName(virDomainDiskDef *disk,
|
2017-02-23 17:13:02 +00:00
|
|
|
unsigned int idx);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
virStorageSource *qemuDomainGetStorageSourceByDevstr(const char *devstr,
|
|
|
|
virDomainDef *def,
|
|
|
|
virDomainBackupDef *backupdef);
|
2017-02-23 18:14:47 +00:00
|
|
|
|
2017-05-31 10:34:10 +00:00
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainUpdateCPU(virDomainObj *vm,
|
|
|
|
virCPUDef *cpu,
|
|
|
|
virCPUDef **origCPU);
|
2017-05-31 10:34:10 +00:00
|
|
|
|
2017-10-06 12:49:07 +00:00
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainFixupCPUs(virDomainObj *vm,
|
|
|
|
virCPUDef **origCPU);
|
2017-10-06 12:49:07 +00:00
|
|
|
|
2017-07-21 13:51:03 +00:00
|
|
|
char *
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainGetMachineName(virDomainObj *vm);
|
2017-07-21 13:51:03 +00:00
|
|
|
|
2017-10-13 10:06:54 +00:00
|
|
|
void
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainObjPrivateXMLFormatAllowReboot(virBuffer *buf,
|
2017-10-13 10:06:54 +00:00
|
|
|
virTristateBool allowReboot);
|
|
|
|
|
|
|
|
int
|
|
|
|
qemuDomainObjPrivateXMLParseAllowReboot(xmlXPathContextPtr ctxt,
|
|
|
|
virTristateBool *allowReboot);
|
|
|
|
|
2019-10-08 13:14:22 +00:00
|
|
|
void
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainPrepareDiskSourceData(virDomainDiskDef *disk,
|
|
|
|
virStorageSource *src);
|
2017-10-17 19:39:41 +00:00
|
|
|
|
2018-05-29 15:28:11 +00:00
|
|
|
|
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainValidateStorageSource(virStorageSource *src,
|
|
|
|
virQEMUCaps *qemuCaps,
|
2020-05-05 15:00:41 +00:00
|
|
|
bool maskBlockdev);
|
2018-05-29 15:28:11 +00:00
|
|
|
|
|
|
|
|
2017-11-23 16:01:37 +00:00
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainPrepareDiskSource(virDomainDiskDef *disk,
|
|
|
|
qemuDomainObjPrivate *priv,
|
|
|
|
virQEMUDriverConfig *cfg);
|
2017-11-23 16:01:37 +00:00
|
|
|
|
2018-04-04 06:43:06 +00:00
|
|
|
int
|
|
|
|
qemuDomainDiskCachemodeFlags(int cachemode,
|
|
|
|
bool *writeback,
|
|
|
|
bool *direct,
|
|
|
|
bool *noflush);
|
|
|
|
|
2020-09-10 10:32:04 +00:00
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainPrepareHostdev(virDomainHostdevDef *hostdev,
|
|
|
|
qemuDomainObjPrivate *priv);
|
2020-09-10 10:32:04 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
char * qemuDomainGetManagedPRSocketPath(qemuDomainObjPrivate *priv);
|
2018-04-18 14:55:14 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
bool qemuDomainDefHasManagedPR(virDomainObj *vm);
|
2019-03-21 12:54:20 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
unsigned int qemuDomainStorageIdNew(qemuDomainObjPrivate *priv);
|
|
|
|
void qemuDomainStorageIdReset(qemuDomainObjPrivate *priv);
|
2017-07-07 12:29:32 +00:00
|
|
|
|
2018-09-11 13:13:08 +00:00
|
|
|
virDomainEventResumedDetailType
|
|
|
|
qemuDomainRunningReasonToResumeEvent(virDomainRunningReason reason);
|
|
|
|
|
2018-11-09 09:21:50 +00:00
|
|
|
bool
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainDiskIsMissingLocalOptional(virDomainDiskDef *disk);
|
2018-11-09 09:21:50 +00:00
|
|
|
|
2019-10-22 13:26:14 +00:00
|
|
|
void
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainNVRAMPathFormat(virQEMUDriverConfig *cfg,
|
|
|
|
virDomainDef *def,
|
2019-10-15 08:31:22 +00:00
|
|
|
char **path);
|
|
|
|
|
2019-10-22 13:26:14 +00:00
|
|
|
void
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainNVRAMPathGenerate(virQEMUDriverConfig *cfg,
|
|
|
|
virDomainDef *def);
|
2019-02-25 15:24:27 +00:00
|
|
|
|
2018-10-09 13:45:50 +00:00
|
|
|
virDomainEventSuspendedDetailType
|
|
|
|
qemuDomainPausedReasonToSuspendedEvent(virDomainPausedReason reason);
|
2019-09-12 22:25:21 +00:00
|
|
|
|
|
|
|
int
|
|
|
|
qemuDomainValidateActualNetDef(const virDomainNetDef *net,
|
2021-03-11 07:16:13 +00:00
|
|
|
virQEMUCaps *qemuCaps);
|
2019-09-26 11:54:15 +00:00
|
|
|
|
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainSupportsCheckpointsBlockjobs(virDomainObj *vm)
|
2019-10-14 12:25:14 +00:00
|
|
|
G_GNUC_WARN_UNUSED_RESULT;
|
2019-10-18 12:33:00 +00:00
|
|
|
|
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainMakeCPUMigratable(virCPUDef *cpu);
|
2019-11-15 15:25:26 +00:00
|
|
|
|
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainInitializePflashStorageSource(virDomainObj *vm);
|
2020-04-17 09:09:58 +00:00
|
|
|
|
|
|
|
bool
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainDiskBlockJobIsSupported(virDomainObj *vm,
|
|
|
|
virDomainDiskDef *disk);
|
2020-06-10 18:35:51 +00:00
|
|
|
|
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainDefNumaCPUsRectify(virDomainDef *def,
|
|
|
|
virQEMUCaps *qemuCaps);
|
2020-08-17 05:07:19 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainRemoveInactiveJob(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm);
|
2020-08-17 05:07:19 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
void qemuDomainRemoveInactiveJobLocked(virQEMUDriver *driver,
|
|
|
|
virDomainObj *vm);
|
2020-07-16 09:17:47 +00:00
|
|
|
|
2020-08-24 15:38:05 +00:00
|
|
|
int virQEMUFileOpenAs(uid_t fallback_uid,
|
|
|
|
gid_t fallback_gid,
|
|
|
|
bool dynamicOwnership,
|
|
|
|
const char *path,
|
|
|
|
int oflags,
|
|
|
|
bool *needUnlink);
|
|
|
|
|
2020-07-16 09:17:47 +00:00
|
|
|
int
|
2021-08-06 08:48:50 +00:00
|
|
|
qemuDomainOpenFile(virQEMUDriverConfig *cfg,
|
2021-08-06 08:31:22 +00:00
|
|
|
const virDomainDef *def,
|
2020-07-16 09:17:47 +00:00
|
|
|
const char *path,
|
|
|
|
int oflags,
|
|
|
|
bool *needUnlink);
|
2020-07-16 09:40:34 +00:00
|
|
|
|
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainFileWrapperFDClose(virDomainObj *vm,
|
|
|
|
virFileWrapperFd *fd);
|
2020-10-08 14:22:50 +00:00
|
|
|
|
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainInterfaceSetDefaultQDisc(virQEMUDriver *driver,
|
|
|
|
virDomainNetDef *net);
|
2020-11-03 07:58:13 +00:00
|
|
|
|
|
|
|
int
|
2021-03-11 07:16:13 +00:00
|
|
|
qemuDomainNamePathsCleanup(virQEMUDriverConfig *cfg,
|
2020-11-03 07:58:13 +00:00
|
|
|
const char *name,
|
|
|
|
bool bestEffort);
|
2021-08-18 08:24:36 +00:00
|
|
|
|
|
|
|
char *
|
|
|
|
qemuDomainGetVHostUserFSSocketPath(qemuDomainObjPrivate *priv,
|
|
|
|
const virDomainFSDef *fs);
|