2008-07-11 16:23:36 +00:00
|
|
|
/*
|
|
|
|
* domain_conf.h: domain XML processing
|
|
|
|
*
|
conf: Split domain forward typedefs into virconftypes.h
Right now, snapshot_conf.h is rather large - it deals with three
separate types: virDomainSnapshotDef (the snapshot definition as it
maps to XML), virDomainSnapshotObj (an object containing a def and the
relationship to other snapshots), and virDomainSnapshotObjList (a list
of snapshot objects), where two of the three types are currently
public rather than opaque. What's more, the types are circular: a
snapshot def includes a virDomainPtr, which contains a snapshot list,
which includes a snapshot object, which includes a snapshot def.
In order to split the three objects into separate files, while still
allowing each header to use sane typedefs to incomplete pointers, the
obvious solution is to lift the typedefs into yet another header, with
no other dependencies. Start the split by factoring out all struct
typedefs from domain_conf.h (enum typedefs don't get used in function
signatures, and function typedefs tend not to suffer from circular
referencing, so those stay put). The only other exception is
virDomainStateReason, which is only ever used directly rather than via
a pointer.
This patch is just straight code motion (all typedefs are listed in
the same order before and after the patch); a later patch will sort
things for legibility.
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-03-15 00:44:34 +00:00
|
|
|
* Copyright (C) 2006-2019 Red Hat, Inc.
|
2008-07-11 16:23:36 +00:00
|
|
|
* Copyright (C) 2006-2008 Daniel P. Berrange
|
2015-01-14 15:15:57 +00:00
|
|
|
* Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2008-07-11 16:23:36 +00:00
|
|
|
*
|
|
|
|
* 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/>.
|
2008-07-11 16:23:36 +00:00
|
|
|
*/
|
|
|
|
|
2019-06-07 20:20:16 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <libxml/parser.h>
|
|
|
|
#include <libxml/tree.h>
|
|
|
|
#include <libxml/xpath.h>
|
|
|
|
|
|
|
|
#include "internal.h"
|
|
|
|
#include "virconftypes.h"
|
|
|
|
#include "capabilities.h"
|
2020-12-08 15:54:30 +00:00
|
|
|
#include "storage_encryption_conf.h"
|
2019-06-07 20:20:16 +00:00
|
|
|
#include "cpu_conf.h"
|
|
|
|
#include "virthread.h"
|
|
|
|
#include "virhash.h"
|
|
|
|
#include "virsocketaddr.h"
|
|
|
|
#include "networkcommon_conf.h"
|
|
|
|
#include "nwfilter_params.h"
|
|
|
|
#include "numa_conf.h"
|
|
|
|
#include "virnetdevmacvlan.h"
|
|
|
|
#include "virsysinfo.h"
|
|
|
|
#include "virnetdev.h"
|
|
|
|
#include "virnetdevip.h"
|
|
|
|
#include "virnetdevvportprofile.h"
|
|
|
|
#include "virnetdevbandwidth.h"
|
|
|
|
#include "virnetdevvlan.h"
|
2020-02-17 17:51:55 +00:00
|
|
|
#include "virnetworkportdef.h"
|
2019-06-07 20:20:16 +00:00
|
|
|
#include "virobject.h"
|
|
|
|
#include "device_conf.h"
|
|
|
|
#include "virbitmap.h"
|
2021-01-21 14:44:53 +00:00
|
|
|
#include "storage_source_conf.h"
|
2019-06-07 20:20:16 +00:00
|
|
|
#include "virseclabel.h"
|
|
|
|
#include "virprocess.h"
|
|
|
|
#include "virgic.h"
|
|
|
|
#include "virperf.h"
|
|
|
|
#include "virtypedparam.h"
|
|
|
|
#include "virsavecookie.h"
|
|
|
|
#include "virresctrl.h"
|
|
|
|
#include "virenum.h"
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2012-02-16 21:41:47 +00:00
|
|
|
/* Flags for the 'type' field in virDomainDeviceDef */
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_DEVICE_NONE = 0,
|
|
|
|
VIR_DOMAIN_DEVICE_DISK,
|
|
|
|
VIR_DOMAIN_DEVICE_LEASE,
|
|
|
|
VIR_DOMAIN_DEVICE_FS,
|
|
|
|
VIR_DOMAIN_DEVICE_NET,
|
|
|
|
VIR_DOMAIN_DEVICE_INPUT,
|
|
|
|
VIR_DOMAIN_DEVICE_SOUND,
|
|
|
|
VIR_DOMAIN_DEVICE_VIDEO,
|
|
|
|
VIR_DOMAIN_DEVICE_HOSTDEV,
|
|
|
|
VIR_DOMAIN_DEVICE_WATCHDOG,
|
|
|
|
VIR_DOMAIN_DEVICE_CONTROLLER,
|
|
|
|
VIR_DOMAIN_DEVICE_GRAPHICS,
|
|
|
|
VIR_DOMAIN_DEVICE_HUB,
|
|
|
|
VIR_DOMAIN_DEVICE_REDIRDEV,
|
|
|
|
VIR_DOMAIN_DEVICE_SMARTCARD,
|
|
|
|
VIR_DOMAIN_DEVICE_CHR,
|
|
|
|
VIR_DOMAIN_DEVICE_MEMBALLOON,
|
2013-04-19 08:37:51 +00:00
|
|
|
VIR_DOMAIN_DEVICE_NVRAM,
|
2013-01-11 16:34:37 +00:00
|
|
|
VIR_DOMAIN_DEVICE_RNG,
|
2014-09-22 08:49:39 +00:00
|
|
|
VIR_DOMAIN_DEVICE_SHMEM,
|
2014-11-30 19:54:50 +00:00
|
|
|
VIR_DOMAIN_DEVICE_TPM,
|
2014-11-30 19:54:50 +00:00
|
|
|
VIR_DOMAIN_DEVICE_PANIC,
|
2014-09-29 17:02:04 +00:00
|
|
|
VIR_DOMAIN_DEVICE_MEMORY,
|
2016-06-22 14:28:22 +00:00
|
|
|
VIR_DOMAIN_DEVICE_IOMMU,
|
2018-05-22 09:21:15 +00:00
|
|
|
VIR_DOMAIN_DEVICE_VSOCK,
|
2020-07-18 06:23:57 +00:00
|
|
|
VIR_DOMAIN_DEVICE_AUDIO,
|
2012-02-16 21:41:47 +00:00
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_DEVICE_LAST
|
2012-02-16 21:41:47 +00:00
|
|
|
} virDomainDeviceType;
|
|
|
|
|
|
|
|
struct _virDomainDeviceDef {
|
|
|
|
int type; /* enum virDomainDeviceType */
|
|
|
|
union {
|
|
|
|
virDomainDiskDefPtr disk;
|
|
|
|
virDomainControllerDefPtr controller;
|
|
|
|
virDomainLeaseDefPtr lease;
|
|
|
|
virDomainFSDefPtr fs;
|
|
|
|
virDomainNetDefPtr net;
|
|
|
|
virDomainInputDefPtr input;
|
|
|
|
virDomainSoundDefPtr sound;
|
|
|
|
virDomainVideoDefPtr video;
|
|
|
|
virDomainHostdevDefPtr hostdev;
|
|
|
|
virDomainWatchdogDefPtr watchdog;
|
|
|
|
virDomainGraphicsDefPtr graphics;
|
|
|
|
virDomainHubDefPtr hub;
|
|
|
|
virDomainRedirdevDefPtr redirdev;
|
|
|
|
virDomainSmartcardDefPtr smartcard;
|
|
|
|
virDomainChrDefPtr chr;
|
|
|
|
virDomainMemballoonDefPtr memballoon;
|
2013-04-19 08:37:51 +00:00
|
|
|
virDomainNVRAMDefPtr nvram;
|
2013-01-11 16:34:37 +00:00
|
|
|
virDomainRNGDefPtr rng;
|
2014-09-22 08:49:39 +00:00
|
|
|
virDomainShmemDefPtr shmem;
|
2014-11-30 19:54:50 +00:00
|
|
|
virDomainTPMDefPtr tpm;
|
2014-11-30 19:54:50 +00:00
|
|
|
virDomainPanicDefPtr panic;
|
2014-09-29 17:02:04 +00:00
|
|
|
virDomainMemoryDefPtr memory;
|
2016-06-22 14:28:22 +00:00
|
|
|
virDomainIOMMUDefPtr iommu;
|
2018-05-22 09:21:15 +00:00
|
|
|
virDomainVsockDefPtr vsock;
|
2020-07-18 06:23:57 +00:00
|
|
|
virDomainAudioDefPtr audio;
|
2012-02-16 21:41:47 +00:00
|
|
|
} data;
|
|
|
|
};
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
/* Different types of hypervisor */
|
2014-06-01 00:22:29 +00:00
|
|
|
typedef enum {
|
2015-09-17 08:46:55 +00:00
|
|
|
VIR_DOMAIN_VIRT_NONE = 0,
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_DOMAIN_VIRT_QEMU,
|
|
|
|
VIR_DOMAIN_VIRT_KQEMU,
|
|
|
|
VIR_DOMAIN_VIRT_KVM,
|
|
|
|
VIR_DOMAIN_VIRT_XEN,
|
|
|
|
VIR_DOMAIN_VIRT_LXC,
|
|
|
|
VIR_DOMAIN_VIRT_UML,
|
|
|
|
VIR_DOMAIN_VIRT_OPENVZ,
|
|
|
|
VIR_DOMAIN_VIRT_TEST,
|
|
|
|
VIR_DOMAIN_VIRT_VMWARE,
|
|
|
|
VIR_DOMAIN_VIRT_HYPERV,
|
2009-04-17 16:09:07 +00:00
|
|
|
VIR_DOMAIN_VIRT_VBOX,
|
2009-07-24 14:17:06 +00:00
|
|
|
VIR_DOMAIN_VIRT_PHYP,
|
2012-07-31 18:56:05 +00:00
|
|
|
VIR_DOMAIN_VIRT_PARALLELS,
|
2014-02-18 10:08:10 +00:00
|
|
|
VIR_DOMAIN_VIRT_BHYVE,
|
2015-05-26 17:12:00 +00:00
|
|
|
VIR_DOMAIN_VIRT_VZ,
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_VIRT_LAST
|
2014-06-01 00:22:29 +00:00
|
|
|
} virDomainVirtType;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2015-04-16 23:18:32 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_OSTYPE_HVM,
|
|
|
|
VIR_DOMAIN_OSTYPE_XEN,
|
|
|
|
VIR_DOMAIN_OSTYPE_LINUX,
|
|
|
|
VIR_DOMAIN_OSTYPE_EXE,
|
|
|
|
VIR_DOMAIN_OSTYPE_UML,
|
2018-11-26 19:34:37 +00:00
|
|
|
VIR_DOMAIN_OSTYPE_XENPVH,
|
2015-04-16 23:18:32 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_OSTYPE_LAST
|
|
|
|
} virDomainOSType;
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virDomainOS);
|
2015-04-16 23:18:32 +00:00
|
|
|
|
|
|
|
|
2011-10-20 09:50:10 +00:00
|
|
|
struct _virDomainHostdevOrigStates {
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
/* Does the device need to unbind from stub when
|
|
|
|
* reattaching to host?
|
|
|
|
*/
|
2013-04-10 10:44:41 +00:00
|
|
|
bool unbind_from_stub;
|
2011-10-20 09:50:10 +00:00
|
|
|
|
|
|
|
/* Does it need to use remove_slot when reattaching
|
|
|
|
* the device to host?
|
|
|
|
*/
|
2013-04-10 10:44:41 +00:00
|
|
|
bool remove_slot;
|
2011-10-20 09:50:10 +00:00
|
|
|
|
|
|
|
/* Does it need to reprobe driver for the device when
|
|
|
|
* reattaching to host?
|
|
|
|
*/
|
2013-04-10 10:44:41 +00:00
|
|
|
bool reprobe;
|
2011-10-20 09:50:10 +00:00
|
|
|
} pci;
|
|
|
|
|
|
|
|
/* Perhaps 'usb' in future */
|
|
|
|
} states;
|
|
|
|
};
|
|
|
|
|
2010-12-09 18:25:11 +00:00
|
|
|
struct _virDomainLeaseDef {
|
|
|
|
char *lockspace;
|
|
|
|
char *key;
|
|
|
|
char *path;
|
|
|
|
unsigned long long offset;
|
|
|
|
};
|
|
|
|
|
2009-11-30 18:35:58 +00:00
|
|
|
|
2014-06-01 00:22:29 +00:00
|
|
|
typedef enum {
|
2012-02-16 21:41:47 +00:00
|
|
|
VIR_DOMAIN_HOSTDEV_MODE_SUBSYS,
|
|
|
|
VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES,
|
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_HOSTDEV_MODE_LAST
|
2014-06-01 00:22:29 +00:00
|
|
|
} virDomainHostdevMode;
|
2012-02-16 21:41:47 +00:00
|
|
|
|
2014-06-01 00:22:29 +00:00
|
|
|
typedef enum {
|
2012-02-16 21:41:47 +00:00
|
|
|
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB,
|
|
|
|
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI,
|
2013-05-03 18:07:20 +00:00
|
|
|
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI,
|
2016-11-22 03:58:16 +00:00
|
|
|
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST,
|
2017-01-31 16:26:36 +00:00
|
|
|
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV,
|
2012-02-16 21:41:47 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST
|
2014-06-01 00:22:29 +00:00
|
|
|
} virDomainHostdevSubsysType;
|
2012-02-16 21:41:47 +00:00
|
|
|
|
2013-03-15 19:15:14 +00:00
|
|
|
/* the backend driver used for PCI hostdev devices */
|
|
|
|
typedef enum {
|
2016-09-22 10:33:24 +00:00
|
|
|
VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT, /* detect automatically, prefer VFIO */
|
2013-04-26 20:44:05 +00:00
|
|
|
VIR_DOMAIN_HOSTDEV_PCI_BACKEND_KVM, /* force legacy kvm style */
|
|
|
|
VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO, /* force vfio */
|
2014-03-06 08:44:22 +00:00
|
|
|
VIR_DOMAIN_HOSTDEV_PCI_BACKEND_XEN, /* force legacy xen style, use pciback */
|
2013-03-15 19:15:14 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_LAST
|
2014-03-13 11:59:32 +00:00
|
|
|
} virDomainHostdevSubsysPCIBackendType;
|
2013-03-15 19:15:14 +00:00
|
|
|
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virDomainHostdevSubsysPCIBackend);
|
2012-02-27 06:42:22 +00:00
|
|
|
|
2014-07-09 13:31:38 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_NONE,
|
|
|
|
VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI,
|
|
|
|
|
|
|
|
VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_LAST,
|
|
|
|
} virDomainHostdevSCSIProtocolType;
|
|
|
|
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virDomainHostdevSubsysSCSIProtocol);
|
2014-07-09 13:31:38 +00:00
|
|
|
|
2014-07-03 19:43:05 +00:00
|
|
|
struct _virDomainHostdevSubsysUSB {
|
|
|
|
bool autoAddress; /* bus/device were filled automatically based
|
|
|
|
on vendor/product */
|
|
|
|
unsigned bus;
|
|
|
|
unsigned device;
|
|
|
|
|
|
|
|
unsigned vendor;
|
|
|
|
unsigned product;
|
|
|
|
};
|
|
|
|
|
2014-07-03 20:31:39 +00:00
|
|
|
struct _virDomainHostdevSubsysPCI {
|
2016-04-03 18:16:51 +00:00
|
|
|
virPCIDeviceAddress addr; /* host address */
|
2014-07-03 20:31:39 +00:00
|
|
|
int backend; /* enum virDomainHostdevSubsysPCIBackendType */
|
|
|
|
};
|
|
|
|
|
2014-06-20 15:35:46 +00:00
|
|
|
struct _virDomainHostdevSubsysSCSIHost {
|
2014-07-03 21:01:10 +00:00
|
|
|
char *adapter;
|
|
|
|
unsigned bus;
|
|
|
|
unsigned target;
|
2015-06-17 03:29:53 +00:00
|
|
|
unsigned long long unit;
|
2020-09-09 13:27:45 +00:00
|
|
|
virStorageSourcePtr src;
|
2014-06-20 15:35:46 +00:00
|
|
|
};
|
|
|
|
|
2014-07-09 13:31:38 +00:00
|
|
|
struct _virDomainHostdevSubsysSCSIiSCSI {
|
2017-09-22 19:18:22 +00:00
|
|
|
virStorageSourcePtr src;
|
2014-07-09 13:31:38 +00:00
|
|
|
};
|
|
|
|
|
2014-06-20 15:35:46 +00:00
|
|
|
struct _virDomainHostdevSubsysSCSI {
|
2014-07-09 13:31:38 +00:00
|
|
|
int protocol; /* enum virDomainHostdevSCSIProtocolType */
|
2014-07-03 21:01:10 +00:00
|
|
|
int sgio; /* enum virDomainDeviceSGIO */
|
2014-09-09 22:48:57 +00:00
|
|
|
int rawio; /* enum virTristateBool */
|
2014-06-20 15:35:46 +00:00
|
|
|
union {
|
|
|
|
virDomainHostdevSubsysSCSIHost host;
|
2014-07-09 13:31:38 +00:00
|
|
|
virDomainHostdevSubsysSCSIiSCSI iscsi;
|
2014-06-20 15:35:46 +00:00
|
|
|
} u;
|
2014-07-03 21:01:10 +00:00
|
|
|
};
|
|
|
|
|
2017-01-31 16:26:36 +00:00
|
|
|
struct _virDomainHostdevSubsysMediatedDev {
|
|
|
|
int model; /* enum virMediatedDeviceModelType */
|
2018-05-24 14:04:26 +00:00
|
|
|
int display; /* virTristateSwitch */
|
2017-01-31 16:26:36 +00:00
|
|
|
char uuidstr[VIR_UUID_STRING_BUFLEN]; /* mediated device's uuid string */
|
2019-10-18 15:30:17 +00:00
|
|
|
int ramfb; /* virTristateSwitch */
|
2017-01-31 16:26:36 +00:00
|
|
|
};
|
|
|
|
|
2016-11-22 03:58:16 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_HOSTDEV_SUBSYS_SCSI_HOST_PROTOCOL_TYPE_NONE,
|
|
|
|
VIR_DOMAIN_HOSTDEV_SUBSYS_SCSI_HOST_PROTOCOL_TYPE_VHOST,
|
|
|
|
|
|
|
|
VIR_DOMAIN_HOSTDEV_SUBSYS_SCSI_HOST_PROTOCOL_TYPE_LAST,
|
|
|
|
} virDomainHostdevSubsysSCSIHostProtocolType;
|
|
|
|
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virDomainHostdevSubsysSCSIHostProtocol);
|
2016-11-22 03:58:16 +00:00
|
|
|
|
2019-01-17 17:52:33 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_HOSTDEV_SUBSYS_SCSI_VHOST_MODEL_TYPE_DEFAULT,
|
|
|
|
VIR_DOMAIN_HOSTDEV_SUBSYS_SCSI_VHOST_MODEL_TYPE_VIRTIO,
|
|
|
|
VIR_DOMAIN_HOSTDEV_SUBSYS_SCSI_VHOST_MODEL_TYPE_VIRTIO_TRANSITIONAL,
|
|
|
|
VIR_DOMAIN_HOSTDEV_SUBSYS_SCSI_VHOST_MODEL_TYPE_VIRTIO_NON_TRANSITIONAL,
|
|
|
|
|
|
|
|
VIR_DOMAIN_HOSTDEV_SUBSYS_SCSI_VHOST_MODEL_TYPE_LAST,
|
|
|
|
} virDomainHostdevSubsysSCSIVHostModelType;
|
|
|
|
|
|
|
|
VIR_ENUM_DECL(virDomainHostdevSubsysSCSIVHostModel);
|
|
|
|
|
2016-11-22 03:58:16 +00:00
|
|
|
struct _virDomainHostdevSubsysSCSIVHost {
|
|
|
|
int protocol; /* enum virDomainHostdevSubsysSCSIHostProtocolType */
|
|
|
|
char *wwpn;
|
2019-01-17 17:52:33 +00:00
|
|
|
int model; /* enum virDomainHostdevSubsysSCSIVHostModelType */
|
2016-11-22 03:58:16 +00:00
|
|
|
};
|
|
|
|
|
2012-02-27 06:42:22 +00:00
|
|
|
struct _virDomainHostdevSubsys {
|
2012-07-25 14:27:06 +00:00
|
|
|
int type; /* enum virDomainHostdevSubsysType */
|
2012-02-27 06:42:22 +00:00
|
|
|
union {
|
2014-07-03 19:43:05 +00:00
|
|
|
virDomainHostdevSubsysUSB usb;
|
2014-07-03 20:31:39 +00:00
|
|
|
virDomainHostdevSubsysPCI pci;
|
2014-07-03 21:01:10 +00:00
|
|
|
virDomainHostdevSubsysSCSI scsi;
|
2016-11-22 03:58:16 +00:00
|
|
|
virDomainHostdevSubsysSCSIVHost scsi_host;
|
2017-01-31 16:26:36 +00:00
|
|
|
virDomainHostdevSubsysMediatedDev mdev;
|
2012-02-27 06:42:22 +00:00
|
|
|
} u;
|
|
|
|
};
|
|
|
|
|
2012-11-23 13:50:29 +00:00
|
|
|
|
2014-06-01 00:22:29 +00:00
|
|
|
typedef enum {
|
2012-11-23 13:50:29 +00:00
|
|
|
VIR_DOMAIN_HOSTDEV_CAPS_TYPE_STORAGE,
|
|
|
|
VIR_DOMAIN_HOSTDEV_CAPS_TYPE_MISC,
|
2013-04-05 12:26:39 +00:00
|
|
|
VIR_DOMAIN_HOSTDEV_CAPS_TYPE_NET,
|
2012-11-23 13:50:29 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_HOSTDEV_CAPS_TYPE_LAST
|
2014-06-01 00:22:29 +00:00
|
|
|
} virDomainHostdevCapsType;
|
2012-11-23 13:50:29 +00:00
|
|
|
|
|
|
|
struct _virDomainHostdevCaps {
|
|
|
|
int type; /* enum virDOmainHostdevCapsType */
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
char *block;
|
|
|
|
} storage;
|
|
|
|
struct {
|
|
|
|
char *chardev;
|
|
|
|
} misc;
|
2013-04-05 12:26:39 +00:00
|
|
|
struct {
|
2016-06-06 19:44:15 +00:00
|
|
|
char *ifname;
|
|
|
|
virNetDevIPInfo ip;
|
2013-04-05 12:26:39 +00:00
|
|
|
} net;
|
2012-11-23 13:50:29 +00:00
|
|
|
} u;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2012-02-16 21:41:47 +00:00
|
|
|
/* basic device for direct passthrough */
|
|
|
|
struct _virDomainHostdevDef {
|
2018-07-26 16:24:30 +00:00
|
|
|
/* If 'parentnet' is non-NULL it means this host dev was
|
|
|
|
* not originally present in the XML. It was copied from
|
|
|
|
* a network interface for convenience when handling
|
|
|
|
* hostdevs internally. This hostdev should never be
|
|
|
|
* visible to the user except as part of the interface
|
|
|
|
*/
|
|
|
|
virDomainNetDefPtr parentnet;
|
2016-04-06 13:46:49 +00:00
|
|
|
|
2012-02-16 21:41:47 +00:00
|
|
|
int mode; /* enum virDomainHostdevMode */
|
2012-10-02 13:14:02 +00:00
|
|
|
int startupPolicy; /* enum virDomainStartupPolicy */
|
2013-04-10 10:09:23 +00:00
|
|
|
bool managed;
|
2013-04-10 10:46:56 +00:00
|
|
|
bool missing;
|
2013-05-03 18:07:25 +00:00
|
|
|
bool readonly;
|
2013-05-03 18:07:33 +00:00
|
|
|
bool shareable;
|
2020-08-14 16:28:38 +00:00
|
|
|
virTristateBool writeFiltering;
|
2012-02-16 21:41:47 +00:00
|
|
|
union {
|
2012-02-27 06:42:22 +00:00
|
|
|
virDomainHostdevSubsys subsys;
|
2012-11-23 13:50:29 +00:00
|
|
|
virDomainHostdevCaps caps;
|
2012-02-16 21:41:47 +00:00
|
|
|
} source;
|
|
|
|
virDomainHostdevOrigStates origstates;
|
2012-01-31 09:16:54 +00:00
|
|
|
virDomainDeviceInfoPtr info; /* Guest address */
|
2012-02-16 21:41:47 +00:00
|
|
|
};
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
|
conf: move host disk type to util/
A continuation of the migration of disk details to virstoragefile.
This patch moves a single enum, but converting the name has quite
a bit of fallout.
* src/conf/domain_conf.h (virDomainDiskType): Move...
* src/util/virstoragefile.h (virStorageType): ...and rename.
* src/bhyve/bhyve_command.c (bhyveBuildDiskArgStr)
(virBhyveProcessBuildLoadCmd): Update clients.
* src/conf/domain_conf.c (virDomainDiskSourceDefParse)
(virDomainDiskDefParseXML, virDomainDiskSourceDefFormatInternal)
(virDomainDiskDefFormat, virDomainDiskGetActualType)
(virDomainDiskDefForeachPath, virDomainDiskSourceIsBlockType):
Likewise.
* src/conf/snapshot_conf.h (_virDomainSnapshotDiskDef): Likewise.
* src/conf/snapshot_conf.c (virDomainSnapshotDiskDefParseXML)
(virDomainSnapshotAlignDisks, virDomainSnapshotDiskDefFormat):
Likewise.
* src/esx/esx_driver.c (esxAutodetectSCSIControllerModel)
(esxDomainDefineXML): Likewise.
* src/locking/domain_lock.c (virDomainLockManagerAddDisk):
Likewise.
* src/lxc/lxc_controller.c
(virLXCControllerSetupLoopDeviceDisk)
(virLXCControllerSetupNBDDeviceDisk)
(virLXCControllerSetupLoopDevices, virLXCControllerSetupDisk):
Likewise.
* src/parallels/parallels_driver.c (parallelsGetHddInfo):
Likewise.
* src/phyp/phyp_driver.c (phypDiskType): Likewise.
* src/qemu/qemu_command.c (qemuGetDriveSourceString)
(qemuDomainDiskGetSourceString, qemuBuildDriveStr)
(qemuBuildCommandLine, qemuParseCommandLineDisk)
(qemuParseCommandLine): Likewise.
* src/qemu/qemu_conf.c (qemuCheckSharedDevice)
(qemuTranslateDiskSourcePool)
(qemuTranslateSnapshotDiskSourcePool): Likewise.
* src/qemu/qemu_domain.c (qemuDomainDeviceDefPostParse)
(qemuDomainDetermineDiskChain): Likewise.
* src/qemu/qemu_driver.c (qemuDomainGetBlockInfo)
(qemuDomainSnapshotPrepareDiskExternalBackingInactive)
(qemuDomainSnapshotPrepareDiskExternalBackingActive)
(qemuDomainSnapshotPrepareDiskExternalOverlayActive)
(qemuDomainSnapshotPrepareDiskExternalOverlayInactive)
(qemuDomainSnapshotPrepareDiskInternal)
(qemuDomainSnapshotPrepare)
(qemuDomainSnapshotCreateSingleDiskActive): Likewise.
* src/qemu/qemu_hotplug.c (qemuDomainChangeEjectableMedia):
Likewise.
* src/qemu/qemu_migration.c (qemuMigrationIsSafe): Likewise.
* src/security/security_apparmor.c
(AppArmorRestoreSecurityImageLabel)
(AppArmorSetSecurityImageLabel): Likewise.
* src/security/security_dac.c (virSecurityDACSetSecurityImageLabel)
(virSecurityDACRestoreSecurityImageLabelInt)
(virSecurityDACSetSecurityAllLabel): Likewise.
* src/security/security_selinux.c
(virSecuritySELinuxRestoreSecurityImageLabelInt)
(virSecuritySELinuxSetSecurityImageLabel)
(virSecuritySELinuxSetSecurityAllLabel): Likewise.
* src/storage/storage_backend.c (virStorageFileBackendForType):
Likewise.
* src/storage/storage_backend_fs.c (virStorageFileBackendFile)
(virStorageFileBackendBlock): Likewise.
* src/storage/storage_backend_gluster.c
(virStorageFileBackendGluster): Likewise.
* src/vbox/vbox_tmpl.c (vboxDomainGetXMLDesc, vboxAttachDrives)
(vboxDomainAttachDeviceImpl, vboxDomainDetachDevice): Likewise.
* src/vmware/vmware_conf.c (vmwareVmxPath): Likewise.
* src/vmx/vmx.c (virVMXParseDisk, virVMXFormatDisk)
(virVMXFormatFloppy): Likewise.
* src/xenxs/xen_sxpr.c (xenParseSxprDisks, xenParseSxpr)
(xenFormatSxprDisk): Likewise.
* src/xenxs/xen_xm.c (xenParseXM, xenFormatXMDisk): Likewise.
* tests/securityselinuxlabeltest.c (testSELinuxLoadDef):
Likewise.
* src/libvirt_private.syms (domain_conf.h): Move symbols...
(virstoragefile.h): ...as appropriate.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-03-27 21:57:49 +00:00
|
|
|
/* Types of disk frontend (guest view). For backends (host view), see
|
2021-01-21 14:44:53 +00:00
|
|
|
* virStorageType in conf/storage_source_conf.h */
|
2014-06-01 00:22:29 +00:00
|
|
|
typedef enum {
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_DOMAIN_DISK_DEVICE_DISK,
|
|
|
|
VIR_DOMAIN_DISK_DEVICE_CDROM,
|
|
|
|
VIR_DOMAIN_DISK_DEVICE_FLOPPY,
|
qemu: add new disk device='lun' for bus='virtio' & type='block'
In the past, generic SCSI commands issued from a guest to a virtio
disk were always passed through to the underlying disk by qemu, and
the kernel would also pass them on.
As a result of CVE-2011-4127 (see:
http://seclists.org/oss-sec/2011/q4/536), qemu now honors its
scsi=on|off device option for virtio-blk-pci (which enables/disables
passthrough of generic SCSI commands), and the kernel will only allow
the commands for physical devices (not for partitions or logical
volumes). The default behavior of qemu is still to allow sending
generic SCSI commands to physical disks that are presented to a guest
as virtio-blk-pci devices, but libvirt prefers to disable those
commands in the standard virtio block devices, enabling it only when
specifically requested (hopefully indicating that the requester
understands what they're asking for). For this purpose, a new libvirt
disk device type (device='lun') has been created.
device='lun' is identical to the default device='disk', except that:
1) It is only allowed if bus='virtio', type='block', and the qemu
version is "new enough" to support it ("new enough" == qemu 0.11 or
better), otherwise the domain will fail to start and a
CONFIG_UNSUPPORTED error will be logged).
2) The option "scsi=on" will be added to the -device arg to allow
SG_IO commands (if device !='lun', "scsi=off" will be added to the
-device arg so that SG_IO commands are specifically forbidden).
Guests which continue to use disk device='disk' (the default) will no
longer be able to use SG_IO commands on the disk; those that have
their disk device changed to device='lun' will still be able to use SG_IO
commands.
*docs/formatdomain.html.in - document the new device attribute value.
*docs/schemas/domaincommon.rng - allow it in the RNG
*tests/* - update the args of several existing tests to add scsi=off, and
add one new test that will test scsi=on.
*src/conf/domain_conf.c - update domain XML parser and formatter
*src/qemu/qemu_(command|driver|hotplug).c - treat
VIR_DOMAIN_DISK_DEVICE_LUN *almost* identically to
VIR_DOMAIN_DISK_DEVICE_DISK, except as indicated above.
Note that no support for this new device value was added to any
hypervisor drivers other than qemu, because it's unclear what it might
mean (if anything) to those drivers.
2012-01-05 03:48:38 +00:00
|
|
|
VIR_DOMAIN_DISK_DEVICE_LUN,
|
2008-07-11 16:23:36 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_DISK_DEVICE_LAST
|
2014-06-01 00:22:29 +00:00
|
|
|
} virDomainDiskDevice;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2014-06-01 00:22:29 +00:00
|
|
|
typedef enum {
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_DOMAIN_DISK_BUS_IDE,
|
|
|
|
VIR_DOMAIN_DISK_BUS_FDC,
|
|
|
|
VIR_DOMAIN_DISK_BUS_SCSI,
|
|
|
|
VIR_DOMAIN_DISK_BUS_VIRTIO,
|
|
|
|
VIR_DOMAIN_DISK_BUS_XEN,
|
2008-08-08 15:03:00 +00:00
|
|
|
VIR_DOMAIN_DISK_BUS_USB,
|
2008-11-19 16:58:23 +00:00
|
|
|
VIR_DOMAIN_DISK_BUS_UML,
|
2009-11-12 14:45:18 +00:00
|
|
|
VIR_DOMAIN_DISK_BUS_SATA,
|
2013-07-31 13:00:26 +00:00
|
|
|
VIR_DOMAIN_DISK_BUS_SD,
|
2008-07-11 16:23:36 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_DISK_BUS_LAST
|
2014-06-01 00:22:29 +00:00
|
|
|
} virDomainDiskBus;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2014-06-01 00:22:29 +00:00
|
|
|
typedef enum {
|
2009-01-30 17:15:39 +00:00
|
|
|
VIR_DOMAIN_DISK_CACHE_DEFAULT,
|
|
|
|
VIR_DOMAIN_DISK_CACHE_DISABLE,
|
|
|
|
VIR_DOMAIN_DISK_CACHE_WRITETHRU,
|
|
|
|
VIR_DOMAIN_DISK_CACHE_WRITEBACK,
|
2011-09-02 13:36:58 +00:00
|
|
|
VIR_DOMAIN_DISK_CACHE_DIRECTSYNC,
|
2011-09-22 19:33:47 +00:00
|
|
|
VIR_DOMAIN_DISK_CACHE_UNSAFE,
|
2009-01-30 17:15:39 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_DISK_CACHE_LAST
|
2014-06-01 00:22:29 +00:00
|
|
|
} virDomainDiskCache;
|
2009-01-30 17:15:39 +00:00
|
|
|
|
2014-06-01 00:22:29 +00:00
|
|
|
typedef enum {
|
2010-03-24 15:32:10 +00:00
|
|
|
VIR_DOMAIN_DISK_ERROR_POLICY_DEFAULT,
|
|
|
|
VIR_DOMAIN_DISK_ERROR_POLICY_STOP,
|
2011-10-04 18:17:06 +00:00
|
|
|
VIR_DOMAIN_DISK_ERROR_POLICY_REPORT,
|
2010-03-24 15:32:10 +00:00
|
|
|
VIR_DOMAIN_DISK_ERROR_POLICY_IGNORE,
|
2010-04-08 20:05:50 +00:00
|
|
|
VIR_DOMAIN_DISK_ERROR_POLICY_ENOSPACE,
|
2010-03-24 15:32:10 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_DISK_ERROR_POLICY_LAST
|
2014-06-01 00:22:29 +00:00
|
|
|
} virDomainDiskErrorPolicy;
|
2010-03-24 15:32:10 +00:00
|
|
|
|
2010-12-06 07:24:09 +00:00
|
|
|
|
2014-06-01 00:22:29 +00:00
|
|
|
typedef enum {
|
2016-04-20 14:39:44 +00:00
|
|
|
VIR_DOMAIN_DISK_TRAY_CLOSED = 0,
|
2012-03-23 14:21:09 +00:00
|
|
|
VIR_DOMAIN_DISK_TRAY_OPEN,
|
|
|
|
|
|
|
|
VIR_DOMAIN_DISK_TRAY_LAST
|
2014-06-01 00:22:29 +00:00
|
|
|
} virDomainDiskTray;
|
2012-03-23 14:21:09 +00:00
|
|
|
|
2014-06-01 00:22:29 +00:00
|
|
|
typedef enum {
|
2012-08-20 13:58:50 +00:00
|
|
|
VIR_DOMAIN_DISK_TRANS_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_DISK_TRANS_NONE,
|
|
|
|
VIR_DOMAIN_DISK_TRANS_AUTO,
|
|
|
|
VIR_DOMAIN_DISK_TRANS_LBA,
|
|
|
|
|
|
|
|
VIR_DOMAIN_DISK_TRANS_LAST
|
2014-06-01 00:22:29 +00:00
|
|
|
} virDomainDiskGeometryTrans;
|
2012-08-20 13:58:50 +00:00
|
|
|
|
2014-06-01 00:22:29 +00:00
|
|
|
typedef enum {
|
2016-04-20 13:50:04 +00:00
|
|
|
VIR_DOMAIN_DISK_IO_DEFAULT = 0,
|
2010-04-21 14:28:21 +00:00
|
|
|
VIR_DOMAIN_DISK_IO_NATIVE,
|
|
|
|
VIR_DOMAIN_DISK_IO_THREADS,
|
2020-04-21 12:19:35 +00:00
|
|
|
VIR_DOMAIN_DISK_IO_URING,
|
2010-04-21 14:28:21 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_DISK_IO_LAST
|
2014-06-01 00:22:29 +00:00
|
|
|
} virDomainDiskIo;
|
2010-04-21 14:28:21 +00:00
|
|
|
|
2014-06-01 00:22:29 +00:00
|
|
|
typedef enum {
|
2011-10-17 14:54:03 +00:00
|
|
|
VIR_DOMAIN_STARTUP_POLICY_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_STARTUP_POLICY_MANDATORY,
|
|
|
|
VIR_DOMAIN_STARTUP_POLICY_REQUISITE,
|
|
|
|
VIR_DOMAIN_STARTUP_POLICY_OPTIONAL,
|
|
|
|
|
|
|
|
VIR_DOMAIN_STARTUP_POLICY_LAST
|
2014-06-01 00:22:29 +00:00
|
|
|
} virDomainStartupPolicy;
|
2011-10-17 14:54:03 +00:00
|
|
|
|
2011-10-28 18:29:39 +00:00
|
|
|
|
2014-06-01 00:22:29 +00:00
|
|
|
typedef enum {
|
2013-05-03 18:07:39 +00:00
|
|
|
VIR_DOMAIN_DEVICE_SGIO_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_DEVICE_SGIO_FILTERED,
|
|
|
|
VIR_DOMAIN_DEVICE_SGIO_UNFILTERED,
|
2013-01-02 14:37:09 +00:00
|
|
|
|
2013-05-03 18:07:39 +00:00
|
|
|
VIR_DOMAIN_DEVICE_SGIO_LAST
|
2014-06-01 00:22:29 +00:00
|
|
|
} virDomainDeviceSGIO;
|
2013-01-02 14:37:09 +00:00
|
|
|
|
2014-06-01 00:22:29 +00:00
|
|
|
typedef enum {
|
2013-05-14 12:44:54 +00:00
|
|
|
VIR_DOMAIN_DISK_DISCARD_DEFAULT = 0,
|
2013-05-17 02:35:02 +00:00
|
|
|
VIR_DOMAIN_DISK_DISCARD_UNMAP,
|
|
|
|
VIR_DOMAIN_DISK_DISCARD_IGNORE,
|
2013-05-14 12:44:54 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_DISK_DISCARD_LAST
|
2014-06-01 00:22:29 +00:00
|
|
|
} virDomainDiskDiscard;
|
2013-05-14 12:44:54 +00:00
|
|
|
|
2016-04-14 20:32:54 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_DISK_DETECT_ZEROES_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_DISK_DETECT_ZEROES_OFF,
|
|
|
|
VIR_DOMAIN_DISK_DETECT_ZEROES_ON,
|
|
|
|
VIR_DOMAIN_DISK_DETECT_ZEROES_UNMAP,
|
|
|
|
|
|
|
|
VIR_DOMAIN_DISK_DETECT_ZEROES_LAST
|
|
|
|
} virDomainDiskDetectZeroes;
|
|
|
|
|
2019-01-11 20:06:05 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_DISK_MODEL_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_DISK_MODEL_VIRTIO,
|
|
|
|
VIR_DOMAIN_DISK_MODEL_VIRTIO_TRANSITIONAL,
|
|
|
|
VIR_DOMAIN_DISK_MODEL_VIRTIO_NON_TRANSITIONAL,
|
|
|
|
|
|
|
|
VIR_DOMAIN_DISK_MODEL_LAST
|
|
|
|
} virDomainDiskModel;
|
|
|
|
|
2011-11-15 09:02:46 +00:00
|
|
|
struct _virDomainBlockIoTuneInfo {
|
|
|
|
unsigned long long total_bytes_sec;
|
|
|
|
unsigned long long read_bytes_sec;
|
|
|
|
unsigned long long write_bytes_sec;
|
|
|
|
unsigned long long total_iops_sec;
|
|
|
|
unsigned long long read_iops_sec;
|
|
|
|
unsigned long long write_iops_sec;
|
2014-10-29 12:16:00 +00:00
|
|
|
unsigned long long total_bytes_sec_max;
|
|
|
|
unsigned long long read_bytes_sec_max;
|
|
|
|
unsigned long long write_bytes_sec_max;
|
|
|
|
unsigned long long total_iops_sec_max;
|
|
|
|
unsigned long long read_iops_sec_max;
|
|
|
|
unsigned long long write_iops_sec_max;
|
|
|
|
unsigned long long size_iops_sec;
|
2016-10-31 21:22:59 +00:00
|
|
|
char *group_name;
|
2016-09-18 16:02:50 +00:00
|
|
|
unsigned long long total_bytes_sec_max_length;
|
|
|
|
unsigned long long read_bytes_sec_max_length;
|
|
|
|
unsigned long long write_bytes_sec_max_length;
|
|
|
|
unsigned long long total_iops_sec_max_length;
|
|
|
|
unsigned long long read_iops_sec_max_length;
|
|
|
|
unsigned long long write_iops_sec_max_length;
|
2020-01-08 06:49:27 +00:00
|
|
|
/* Don't forget to update virDomainBlockIoTuneInfoCopy and
|
|
|
|
* virDomainBlockIoTuneInfoEqual. */
|
2011-11-15 09:02:46 +00:00
|
|
|
};
|
|
|
|
|
conf: prepare to track multiple host source files per <disk>
It's finally time to start tracking disk backing chains in
<domain> XML. The first step is to start refactoring code
so that we have an object more convenient for representing
each host source resource in the context of a single guest
<disk>. Ultimately, I plan to move the new type into src/util
where it can be reused by virStorageFile, but to make the
transition easier to review, this patch just creates the
new type then fixes everything until it compiles again.
* src/conf/domain_conf.h (_virDomainDiskDef): Split...
(_virDomainDiskSourceDef): ...to new struct.
(virDomainDiskAuthClear): Use new type.
* src/conf/domain_conf.c (virDomainDiskDefFree): Split...
(virDomainDiskSourceDefClear): ...to new function.
(virDomainDiskGetType, virDomainDiskSetType)
(virDomainDiskGetSource, virDomainDiskSetSource)
(virDomainDiskGetDriver, virDomainDiskSetDriver)
(virDomainDiskGetFormat, virDomainDiskSetFormat)
(virDomainDiskAuthClear, virDomainDiskGetActualType)
(virDomainDiskDefParseXML, virDomainDiskSourceDefFormat)
(virDomainDiskDefFormat, virDomainDiskDefForeachPath)
(virDomainDiskDefGetSecurityLabelDef)
(virDomainDiskSourceIsBlockType): Adjust all users.
* src/lxc/lxc_controller.c (virLXCControllerSetupDisk):
Likewise.
* src/lxc/lxc_driver.c (lxcDomainAttachDeviceMknodHelper):
Likewise.
* src/qemu/qemu_command.c (qemuAddRBDHost, qemuParseRBDString)
(qemuParseDriveURIString, qemuParseGlusterString)
(qemuParseISCSIString, qemuParseNBDString)
(qemuDomainDiskGetSourceString, qemuBuildDriveStr)
(qemuBuildCommandLine, qemuParseCommandLineDisk)
(qemuParseCommandLine): Likewise.
* src/qemu/qemu_conf.c (qemuCheckSharedDevice)
(qemuAddISCSIPoolSourceHost, qemuTranslateDiskSourcePool):
Likewise.
* src/qemu/qemu_driver.c (qemuDomainUpdateDeviceConfig)
(qemuDomainPrepareDiskChainElement)
(qemuDomainSnapshotCreateInactiveExternal)
(qemuDomainSnapshotPrepareDiskExternalBackingInactive)
(qemuDomainSnapshotPrepareDiskInternal)
(qemuDomainSnapshotPrepare)
(qemuDomainSnapshotCreateSingleDiskActive)
(qemuDomainSnapshotUndoSingleDiskActive)
(qemuDomainBlockPivot, qemuDomainBlockJobImpl)
(qemuDomainBlockCopy, qemuDomainBlockCommit): Likewise.
* src/qemu/qemu_migration.c (qemuMigrationIsSafe): Likewise.
* src/qemu/qemu_process.c (qemuProcessGetVolumeQcowPassphrase)
(qemuProcessInitPasswords): Likewise.
* src/security/security_selinux.c
(virSecuritySELinuxSetSecurityFileLabel): Likewise.
* src/storage/storage_driver.c (virStorageFileInitFromDiskDef):
Likewise.
* tests/securityselinuxlabeltest.c (testSELinuxLoadDef):
Likewise.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-03-19 17:11:16 +00:00
|
|
|
|
2014-07-28 22:25:28 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_DISK_MIRROR_STATE_NONE = 0, /* No job, or job still not synced */
|
|
|
|
VIR_DOMAIN_DISK_MIRROR_STATE_READY, /* Job in second phase */
|
|
|
|
VIR_DOMAIN_DISK_MIRROR_STATE_ABORT, /* Job aborted, waiting for event */
|
|
|
|
VIR_DOMAIN_DISK_MIRROR_STATE_PIVOT, /* Job pivoted, waiting for event */
|
|
|
|
|
|
|
|
VIR_DOMAIN_DISK_MIRROR_STATE_LAST
|
|
|
|
} virDomainDiskMirrorState;
|
|
|
|
|
2017-02-02 13:27:32 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_MEMORY_SOURCE_NONE = 0, /* No memory source defined */
|
|
|
|
VIR_DOMAIN_MEMORY_SOURCE_FILE, /* Memory source is set as file */
|
|
|
|
VIR_DOMAIN_MEMORY_SOURCE_ANONYMOUS, /* Memory source is set as anonymous */
|
2018-11-15 11:55:53 +00:00
|
|
|
VIR_DOMAIN_MEMORY_SOURCE_MEMFD, /* Memory source is set as memfd */
|
2017-02-02 13:27:32 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_MEMORY_SOURCE_LAST,
|
|
|
|
} virDomainMemorySource;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_MEMORY_ALLOCATION_NONE = 0, /* No memory allocation defined */
|
|
|
|
VIR_DOMAIN_MEMORY_ALLOCATION_IMMEDIATE, /* Memory allocation is set as immediate */
|
|
|
|
VIR_DOMAIN_MEMORY_ALLOCATION_ONDEMAND, /* Memory allocation is set as ondemand */
|
|
|
|
|
|
|
|
VIR_DOMAIN_MEMORY_ALLOCATION_LAST,
|
|
|
|
} virDomainMemoryAllocation;
|
|
|
|
|
2014-07-28 22:25:28 +00:00
|
|
|
|
conf: prepare to track multiple host source files per <disk>
It's finally time to start tracking disk backing chains in
<domain> XML. The first step is to start refactoring code
so that we have an object more convenient for representing
each host source resource in the context of a single guest
<disk>. Ultimately, I plan to move the new type into src/util
where it can be reused by virStorageFile, but to make the
transition easier to review, this patch just creates the
new type then fixes everything until it compiles again.
* src/conf/domain_conf.h (_virDomainDiskDef): Split...
(_virDomainDiskSourceDef): ...to new struct.
(virDomainDiskAuthClear): Use new type.
* src/conf/domain_conf.c (virDomainDiskDefFree): Split...
(virDomainDiskSourceDefClear): ...to new function.
(virDomainDiskGetType, virDomainDiskSetType)
(virDomainDiskGetSource, virDomainDiskSetSource)
(virDomainDiskGetDriver, virDomainDiskSetDriver)
(virDomainDiskGetFormat, virDomainDiskSetFormat)
(virDomainDiskAuthClear, virDomainDiskGetActualType)
(virDomainDiskDefParseXML, virDomainDiskSourceDefFormat)
(virDomainDiskDefFormat, virDomainDiskDefForeachPath)
(virDomainDiskDefGetSecurityLabelDef)
(virDomainDiskSourceIsBlockType): Adjust all users.
* src/lxc/lxc_controller.c (virLXCControllerSetupDisk):
Likewise.
* src/lxc/lxc_driver.c (lxcDomainAttachDeviceMknodHelper):
Likewise.
* src/qemu/qemu_command.c (qemuAddRBDHost, qemuParseRBDString)
(qemuParseDriveURIString, qemuParseGlusterString)
(qemuParseISCSIString, qemuParseNBDString)
(qemuDomainDiskGetSourceString, qemuBuildDriveStr)
(qemuBuildCommandLine, qemuParseCommandLineDisk)
(qemuParseCommandLine): Likewise.
* src/qemu/qemu_conf.c (qemuCheckSharedDevice)
(qemuAddISCSIPoolSourceHost, qemuTranslateDiskSourcePool):
Likewise.
* src/qemu/qemu_driver.c (qemuDomainUpdateDeviceConfig)
(qemuDomainPrepareDiskChainElement)
(qemuDomainSnapshotCreateInactiveExternal)
(qemuDomainSnapshotPrepareDiskExternalBackingInactive)
(qemuDomainSnapshotPrepareDiskInternal)
(qemuDomainSnapshotPrepare)
(qemuDomainSnapshotCreateSingleDiskActive)
(qemuDomainSnapshotUndoSingleDiskActive)
(qemuDomainBlockPivot, qemuDomainBlockJobImpl)
(qemuDomainBlockCopy, qemuDomainBlockCommit): Likewise.
* src/qemu/qemu_migration.c (qemuMigrationIsSafe): Likewise.
* src/qemu/qemu_process.c (qemuProcessGetVolumeQcowPassphrase)
(qemuProcessInitPasswords): Likewise.
* src/security/security_selinux.c
(virSecuritySELinuxSetSecurityFileLabel): Likewise.
* src/storage/storage_driver.c (virStorageFileInitFromDiskDef):
Likewise.
* tests/securityselinuxlabeltest.c (testSELinuxLoadDef):
Likewise.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-03-19 17:11:16 +00:00
|
|
|
/* Stores the virtual disk configuration */
|
|
|
|
struct _virDomainDiskDef {
|
2014-05-21 23:13:12 +00:00
|
|
|
virStorageSourcePtr src; /* non-NULL. XXX Allow NULL for empty cdrom? */
|
conf: prepare to track multiple host source files per <disk>
It's finally time to start tracking disk backing chains in
<domain> XML. The first step is to start refactoring code
so that we have an object more convenient for representing
each host source resource in the context of a single guest
<disk>. Ultimately, I plan to move the new type into src/util
where it can be reused by virStorageFile, but to make the
transition easier to review, this patch just creates the
new type then fixes everything until it compiles again.
* src/conf/domain_conf.h (_virDomainDiskDef): Split...
(_virDomainDiskSourceDef): ...to new struct.
(virDomainDiskAuthClear): Use new type.
* src/conf/domain_conf.c (virDomainDiskDefFree): Split...
(virDomainDiskSourceDefClear): ...to new function.
(virDomainDiskGetType, virDomainDiskSetType)
(virDomainDiskGetSource, virDomainDiskSetSource)
(virDomainDiskGetDriver, virDomainDiskSetDriver)
(virDomainDiskGetFormat, virDomainDiskSetFormat)
(virDomainDiskAuthClear, virDomainDiskGetActualType)
(virDomainDiskDefParseXML, virDomainDiskSourceDefFormat)
(virDomainDiskDefFormat, virDomainDiskDefForeachPath)
(virDomainDiskDefGetSecurityLabelDef)
(virDomainDiskSourceIsBlockType): Adjust all users.
* src/lxc/lxc_controller.c (virLXCControllerSetupDisk):
Likewise.
* src/lxc/lxc_driver.c (lxcDomainAttachDeviceMknodHelper):
Likewise.
* src/qemu/qemu_command.c (qemuAddRBDHost, qemuParseRBDString)
(qemuParseDriveURIString, qemuParseGlusterString)
(qemuParseISCSIString, qemuParseNBDString)
(qemuDomainDiskGetSourceString, qemuBuildDriveStr)
(qemuBuildCommandLine, qemuParseCommandLineDisk)
(qemuParseCommandLine): Likewise.
* src/qemu/qemu_conf.c (qemuCheckSharedDevice)
(qemuAddISCSIPoolSourceHost, qemuTranslateDiskSourcePool):
Likewise.
* src/qemu/qemu_driver.c (qemuDomainUpdateDeviceConfig)
(qemuDomainPrepareDiskChainElement)
(qemuDomainSnapshotCreateInactiveExternal)
(qemuDomainSnapshotPrepareDiskExternalBackingInactive)
(qemuDomainSnapshotPrepareDiskInternal)
(qemuDomainSnapshotPrepare)
(qemuDomainSnapshotCreateSingleDiskActive)
(qemuDomainSnapshotUndoSingleDiskActive)
(qemuDomainBlockPivot, qemuDomainBlockJobImpl)
(qemuDomainBlockCopy, qemuDomainBlockCommit): Likewise.
* src/qemu/qemu_migration.c (qemuMigrationIsSafe): Likewise.
* src/qemu/qemu_process.c (qemuProcessGetVolumeQcowPassphrase)
(qemuProcessInitPasswords): Likewise.
* src/security/security_selinux.c
(virSecuritySELinuxSetSecurityFileLabel): Likewise.
* src/storage/storage_driver.c (virStorageFileInitFromDiskDef):
Likewise.
* tests/securityselinuxlabeltest.c (testSELinuxLoadDef):
Likewise.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-03-19 17:11:16 +00:00
|
|
|
|
2015-05-13 07:00:02 +00:00
|
|
|
virObjectPtr privateData;
|
|
|
|
|
conf: prepare to track multiple host source files per <disk>
It's finally time to start tracking disk backing chains in
<domain> XML. The first step is to start refactoring code
so that we have an object more convenient for representing
each host source resource in the context of a single guest
<disk>. Ultimately, I plan to move the new type into src/util
where it can be reused by virStorageFile, but to make the
transition easier to review, this patch just creates the
new type then fixes everything until it compiles again.
* src/conf/domain_conf.h (_virDomainDiskDef): Split...
(_virDomainDiskSourceDef): ...to new struct.
(virDomainDiskAuthClear): Use new type.
* src/conf/domain_conf.c (virDomainDiskDefFree): Split...
(virDomainDiskSourceDefClear): ...to new function.
(virDomainDiskGetType, virDomainDiskSetType)
(virDomainDiskGetSource, virDomainDiskSetSource)
(virDomainDiskGetDriver, virDomainDiskSetDriver)
(virDomainDiskGetFormat, virDomainDiskSetFormat)
(virDomainDiskAuthClear, virDomainDiskGetActualType)
(virDomainDiskDefParseXML, virDomainDiskSourceDefFormat)
(virDomainDiskDefFormat, virDomainDiskDefForeachPath)
(virDomainDiskDefGetSecurityLabelDef)
(virDomainDiskSourceIsBlockType): Adjust all users.
* src/lxc/lxc_controller.c (virLXCControllerSetupDisk):
Likewise.
* src/lxc/lxc_driver.c (lxcDomainAttachDeviceMknodHelper):
Likewise.
* src/qemu/qemu_command.c (qemuAddRBDHost, qemuParseRBDString)
(qemuParseDriveURIString, qemuParseGlusterString)
(qemuParseISCSIString, qemuParseNBDString)
(qemuDomainDiskGetSourceString, qemuBuildDriveStr)
(qemuBuildCommandLine, qemuParseCommandLineDisk)
(qemuParseCommandLine): Likewise.
* src/qemu/qemu_conf.c (qemuCheckSharedDevice)
(qemuAddISCSIPoolSourceHost, qemuTranslateDiskSourcePool):
Likewise.
* src/qemu/qemu_driver.c (qemuDomainUpdateDeviceConfig)
(qemuDomainPrepareDiskChainElement)
(qemuDomainSnapshotCreateInactiveExternal)
(qemuDomainSnapshotPrepareDiskExternalBackingInactive)
(qemuDomainSnapshotPrepareDiskInternal)
(qemuDomainSnapshotPrepare)
(qemuDomainSnapshotCreateSingleDiskActive)
(qemuDomainSnapshotUndoSingleDiskActive)
(qemuDomainBlockPivot, qemuDomainBlockJobImpl)
(qemuDomainBlockCopy, qemuDomainBlockCommit): Likewise.
* src/qemu/qemu_migration.c (qemuMigrationIsSafe): Likewise.
* src/qemu/qemu_process.c (qemuProcessGetVolumeQcowPassphrase)
(qemuProcessInitPasswords): Likewise.
* src/security/security_selinux.c
(virSecuritySELinuxSetSecurityFileLabel): Likewise.
* src/storage/storage_driver.c (virStorageFileInitFromDiskDef):
Likewise.
* tests/securityselinuxlabeltest.c (testSELinuxLoadDef):
Likewise.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-03-19 17:11:16 +00:00
|
|
|
int device; /* enum virDomainDiskDevice */
|
|
|
|
int bus; /* enum virDomainDiskBus */
|
|
|
|
char *dst;
|
|
|
|
int tray_status; /* enum virDomainDiskTray */
|
2014-06-27 15:18:53 +00:00
|
|
|
int removable; /* enum virTristateSwitch */
|
2011-11-15 09:02:46 +00:00
|
|
|
|
2014-05-21 20:22:21 +00:00
|
|
|
virStorageSourcePtr mirror;
|
2014-07-28 22:25:28 +00:00
|
|
|
int mirrorState; /* enum virDomainDiskMirrorState */
|
2014-07-29 03:46:44 +00:00
|
|
|
int mirrorJob; /* virDomainBlockJobType */
|
blockjob: enhance xml to track mirrors across libvirtd restart
In order to track a block copy job across libvirtd restarts, we
need to save internal XML that tracks the name of the file
holding the mirror. Displaying this name in dumpxml might also
be useful to the user, even if we don't yet have a way to (re-)
start a domain with mirroring enabled up front. This is done
with a new <mirror> sub-element to <disk>, as in:
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/var/lib/libvirt/images/original.img'/>
<mirror file='/var/lib/libvirt/images/copy.img' format='qcow2' ready='yes'/>
...
</disk>
For now, the element is output-only, in live domains; it is ignored
when defining a domain or hot-plugging a disk (since those contexts
use VIR_DOMAIN_XML_INACTIVE in parsing). The 'ready' attribute appears
when libvirt knows that the job has changed from the initial pulling
phase over to the mirroring phase, although absence of the attribute
is not a sure indicator of the current phase. If we come up with a way
to make qemu start with mirroring enabled, we can relax the xml
restriction, and allow <mirror> (but not attribute 'ready') on input.
Testing active-only XML meant tweaking the testsuite slightly, but it
was worth it.
* docs/schemas/domaincommon.rng (diskspec): Add diskMirror.
* docs/formatdomain.html.in (elementsDisks): Document it.
* src/conf/domain_conf.h (_virDomainDiskDef): New members.
* src/conf/domain_conf.c (virDomainDiskDefFree): Clean them.
(virDomainDiskDefParseXML): Parse them, but only internally.
(virDomainDiskDefFormat): Output them.
* tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml: New test file.
* tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror.xml: Likewise.
* tests/qemuxml2xmltest.c (testInfo): Alter members.
(testCompareXMLToXMLHelper): Allow more test control.
(mymain): Run new test.
2012-03-29 00:10:18 +00:00
|
|
|
|
2012-08-20 13:58:50 +00:00
|
|
|
struct {
|
|
|
|
unsigned int cylinders;
|
|
|
|
unsigned int heads;
|
|
|
|
unsigned int sectors;
|
2014-03-19 15:09:02 +00:00
|
|
|
int trans; /* enum virDomainDiskGeometryTrans */
|
2012-08-20 13:58:50 +00:00
|
|
|
} geometry;
|
|
|
|
|
2012-08-29 15:48:30 +00:00
|
|
|
struct {
|
|
|
|
unsigned int logical_block_size;
|
|
|
|
unsigned int physical_block_size;
|
2012-09-04 14:30:55 +00:00
|
|
|
} blockio;
|
2012-08-29 15:48:30 +00:00
|
|
|
|
2011-11-15 09:02:46 +00:00
|
|
|
virDomainBlockIoTuneInfo blkdeviotune;
|
|
|
|
|
2018-04-10 14:57:22 +00:00
|
|
|
char *driverName;
|
|
|
|
|
2009-08-14 11:22:01 +00:00
|
|
|
char *serial;
|
2012-09-11 08:57:02 +00:00
|
|
|
char *wwn;
|
2012-12-06 10:23:02 +00:00
|
|
|
char *vendor;
|
|
|
|
char *product;
|
2014-03-19 15:09:02 +00:00
|
|
|
int cachemode; /* enum virDomainDiskCache */
|
2011-10-04 18:17:06 +00:00
|
|
|
int error_policy; /* enum virDomainDiskErrorPolicy */
|
|
|
|
int rerror_policy; /* enum virDomainDiskErrorPolicy */
|
2014-03-19 15:09:02 +00:00
|
|
|
int iomode; /* enum virDomainDiskIo */
|
2014-06-27 15:18:53 +00:00
|
|
|
int ioeventfd; /* enum virTristateSwitch */
|
|
|
|
int event_idx; /* enum virTristateSwitch */
|
|
|
|
int copy_on_read; /* enum virTristateSwitch */
|
2014-05-11 15:08:51 +00:00
|
|
|
int snapshot; /* virDomainSnapshotLocation, snapshot_conf.h */
|
2011-10-17 14:54:03 +00:00
|
|
|
int startupPolicy; /* enum virDomainStartupPolicy */
|
2013-04-10 11:01:48 +00:00
|
|
|
bool transient;
|
2009-11-30 18:35:58 +00:00
|
|
|
virDomainDeviceInfo info;
|
2014-09-18 17:54:18 +00:00
|
|
|
int rawio; /* enum virTristateBool */
|
2013-05-03 18:07:39 +00:00
|
|
|
int sgio; /* enum virDomainDeviceSGIO */
|
2013-05-14 12:44:54 +00:00
|
|
|
int discard; /* enum virDomainDiskDiscard */
|
2014-08-25 12:43:17 +00:00
|
|
|
unsigned int iothread; /* unused = 0, > 0 specific thread # */
|
2016-04-14 20:32:54 +00:00
|
|
|
int detect_zeroes; /* enum virDomainDiskDetectZeroes */
|
2015-02-20 03:22:05 +00:00
|
|
|
char *domain_name; /* backend domain name */
|
2017-09-30 17:15:36 +00:00
|
|
|
unsigned int queues;
|
2019-01-11 20:06:05 +00:00
|
|
|
int model; /* enum virDomainDiskModel */
|
2016-06-06 14:49:17 +00:00
|
|
|
virDomainVirtioOptionsPtr virtio;
|
2020-05-07 12:00:28 +00:00
|
|
|
|
|
|
|
bool diskElementAuth;
|
|
|
|
bool diskElementEnc;
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2009-12-02 19:15:38 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_TYPE_IDE,
|
|
|
|
VIR_DOMAIN_CONTROLLER_TYPE_FDC,
|
|
|
|
VIR_DOMAIN_CONTROLLER_TYPE_SCSI,
|
|
|
|
VIR_DOMAIN_CONTROLLER_TYPE_SATA,
|
2010-02-18 16:52:03 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL,
|
2011-01-10 16:41:33 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_TYPE_CCID,
|
2011-09-02 13:21:23 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_TYPE_USB,
|
2013-04-17 15:05:15 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_TYPE_PCI,
|
2019-03-06 22:59:29 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_TYPE_XENBUS,
|
2019-02-17 13:04:00 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_TYPE_ISA,
|
2009-12-02 19:15:38 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_CONTROLLER_TYPE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainControllerType;
|
2009-12-02 19:15:38 +00:00
|
|
|
|
2010-06-17 14:39:50 +00:00
|
|
|
|
qemu: set/validate slot/connection type when assigning slots for PCI devices
Since PCI bridges, PCIe bridges, PCIe switches, and PCIe root ports
all share the same namespace, they are all defined as controllers of
type='pci' in libvirt (but with a differing model attribute). Each of
these controllers has a certain connection type upstream, allows
certain connection types downstream, and each can either allow a
single downstream connection at slot 0, or connections from slot 1 -
31.
Right now, we only support the pci-root and pci-bridge devices, both
of which only allow PCI devices to connect, and both which have usable
slots 1 - 31. In preparation for adding other types of controllers
that have different capabilities, this patch 1) adds info to the
qemuDomainPCIAddressBus object to indicate the capabilities, 2) sets
those capabilities appropriately for pci-root and pci-bridge devices,
and 3) validates that the controller being connected to is the proper
type when allocating slots or validating that a user-selected slot is
appropriate for a device..
Having this infrastructure in place will make it much easier to add
support for the other PCI controller types.
While it would be possible to do all the necessary checking by just
storing the controller model in the qemyuDomainPCIAddressBus, it
greatly simplifies all the validation code to also keep a "flags",
"minSlot" and "maxSlot" for each - that way we can just check those
attributes rather than requiring a nearly identical switch statement
everywhere we need to validate compatibility.
You may notice many places where the flags are seemingly hard-coded to
QEMU_PCI_CONNECT_HOTPLUGGABLE | QEMU_PCI_CONNECT_TYPE_PCI
This is currently the correct value for all PCI devices, and in the
future will be the default, with small bits of code added to change to
the flags for the few devices which are the exceptions to this rule.
Finally, there are a few places with "FIXME" comments. Note that these
aren't indicating places that are broken according to the currently
supported devices, they are places that will need fixing when support
for new PCI controller models is added.
To assure that there was no regression in the auto-allocation of PCI
addresses or auto-creation of integrated pci-root, ide, and usb
controllers, a new test case (pci-bridge-many-disks) has been added to
both the qemuxml2argv and qemuxml2xml tests. This new test defines a
domain with several dozen virtio disks but no pci-root or
pci-bridges. The .args file of the new test case was created using
libvirt sources from before this patch, and the test still passes
after this patch has been applied.
2013-07-15 00:09:44 +00:00
|
|
|
typedef enum {
|
2018-02-14 10:51:26 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_PCI_DEFAULT = -1,
|
2013-04-17 15:05:15 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT,
|
2013-07-10 19:19:32 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT,
|
2013-04-17 15:05:15 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE,
|
qemu: add dmi-to-pci-bridge controller
This PCI controller, named "dmi-to-pci-bridge" in the libvirt config,
and implemented with qemu's "i82801b11-bridge" device, connects to a
PCI Express slot (e.g. one of the slots provided by the pcie-root
controller, aka "pcie.0" on the qemu commandline), and provides 31
*non-hot-pluggable* PCI (*not* PCIe) slots, numbered 1-31.
Any time a machine is defined which has a pcie-root controller
(i.e. any q35-based machinetype), libvirt will automatically add a
dmi-to-pci-bridge controller if one doesn't exist, and also add a
pci-bridge controller. The reasoning here is that any useful domain
will have either an immediate (startup time) or eventual (subsequent
hot-plug) need for a standard PCI slot; since the pcie-root controller
only provides PCIe slots, we need to connect a dmi-to-pci-bridge
controller to it in order to get a non-hot-plug PCI slot that we can
then use to connect a pci-bridge - the slots provided by the
pci-bridge will be both standard PCI and hot-pluggable.
Since pci-bridge devices themselves can not be hot-plugged into a
running system (although you can hot-plug other devices into a
pci-bridge's slots), any new pci-bridge controller that is added can
(and will) be plugged into the dmi-to-pci-bridge as long as it has
empty slots available.
This patch is also changing the qemuxml2xml-pcie test from a "DO_TEST"
to a "DO_DIFFERENT_TEST". This is so that the "before" xml can omit
the automatically added dmi-to-pci-bridge and pci-bridge devices, and
the "after" xml can include it - this way we are testing if libvirt is
properly adding these devices.
2013-07-31 01:37:32 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_DMI_TO_PCI_BRIDGE,
|
2018-01-11 16:28:43 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE,
|
2015-06-17 17:21:16 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT,
|
2015-06-16 19:00:44 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_UPSTREAM_PORT,
|
2015-06-17 19:27:40 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_DOWNSTREAM_PORT,
|
2016-03-04 15:26:23 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_PCI_EXPANDER_BUS,
|
2016-03-16 17:37:14 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_PCIE_EXPANDER_BUS,
|
2013-04-17 15:05:15 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_PCI_LAST
|
qemu: set/validate slot/connection type when assigning slots for PCI devices
Since PCI bridges, PCIe bridges, PCIe switches, and PCIe root ports
all share the same namespace, they are all defined as controllers of
type='pci' in libvirt (but with a differing model attribute). Each of
these controllers has a certain connection type upstream, allows
certain connection types downstream, and each can either allow a
single downstream connection at slot 0, or connections from slot 1 -
31.
Right now, we only support the pci-root and pci-bridge devices, both
of which only allow PCI devices to connect, and both which have usable
slots 1 - 31. In preparation for adding other types of controllers
that have different capabilities, this patch 1) adds info to the
qemuDomainPCIAddressBus object to indicate the capabilities, 2) sets
those capabilities appropriately for pci-root and pci-bridge devices,
and 3) validates that the controller being connected to is the proper
type when allocating slots or validating that a user-selected slot is
appropriate for a device..
Having this infrastructure in place will make it much easier to add
support for the other PCI controller types.
While it would be possible to do all the necessary checking by just
storing the controller model in the qemyuDomainPCIAddressBus, it
greatly simplifies all the validation code to also keep a "flags",
"minSlot" and "maxSlot" for each - that way we can just check those
attributes rather than requiring a nearly identical switch statement
everywhere we need to validate compatibility.
You may notice many places where the flags are seemingly hard-coded to
QEMU_PCI_CONNECT_HOTPLUGGABLE | QEMU_PCI_CONNECT_TYPE_PCI
This is currently the correct value for all PCI devices, and in the
future will be the default, with small bits of code added to change to
the flags for the few devices which are the exceptions to this rule.
Finally, there are a few places with "FIXME" comments. Note that these
aren't indicating places that are broken according to the currently
supported devices, they are places that will need fixing when support
for new PCI controller models is added.
To assure that there was no regression in the auto-allocation of PCI
addresses or auto-creation of integrated pci-root, ide, and usb
controllers, a new test case (pci-bridge-many-disks) has been added to
both the qemuxml2argv and qemuxml2xml tests. This new test defines a
domain with several dozen virtio disks but no pci-root or
pci-bridges. The .args file of the new test case was created using
libvirt sources from before this patch, and the test still passes
after this patch has been applied.
2013-07-15 00:09:44 +00:00
|
|
|
} virDomainControllerModelPCI;
|
2013-04-17 15:05:15 +00:00
|
|
|
|
conf: add new <model> subelement with name attribute to <controller>
This new subelement is used in PCI controllers: the toplevel
*attribute* "model" of a controller denotes what kind of PCI
controller is being described, e.g. a "dmi-to-pci-bridge",
"pci-bridge", or "pci-root". But in the future there will be different
implementations of some of those types of PCI controllers, which
behave similarly from libvirt's point of view (and so should have the
same model), but use a different device in qemu (and present
themselves as a different piece of hardware in the guest). In an ideal
world we (i.e. "I") would have thought of that back when the pci
controllers were added, and used some sort of type/class/model
notation (where class was used in the way we are now using model, and
model was used for the actual manufacturer's model number of a
particular family of PCI controller), but that opportunity is long
past, so as an alternative, this patch allows selecting a particular
implementation of a pci controller with the "name" attribute of the
<model> subelement, e.g.:
<controller type='pci' model='dmi-to-pci-bridge' index='1'>
<model name='i82801b11-bridge'/>
</controller>
In this case, "dmi-to-pci-bridge" is the kind of controller (one that
has a single PCIe port upstream, and 32 standard PCI ports downstream,
which are not hotpluggable), and the qemu device to be used to
implement this kind of controller is named "i82801b11-bridge".
Implementing the above now will allow us in the future to add a new
kind of dmi-to-pci-bridge that doesn't use qemu's i82801b11-bridge
device, but instead uses something else (which doesn't yet exist, but
qemu people have been discussing it), all without breaking existing
configs.
(note that for the existing "pci-bridge" type of PCI controller, both
the model attribute and <model> name are 'pci-bridge'. This is just a
coincidence, since it turns out that in this case the device name in
qemu really is a generic 'pci-bridge' rather than being the name of
some real-world chip)
2015-06-25 17:30:23 +00:00
|
|
|
typedef enum {
|
2018-03-02 14:26:14 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE = 0,
|
conf: add new <model> subelement with name attribute to <controller>
This new subelement is used in PCI controllers: the toplevel
*attribute* "model" of a controller denotes what kind of PCI
controller is being described, e.g. a "dmi-to-pci-bridge",
"pci-bridge", or "pci-root". But in the future there will be different
implementations of some of those types of PCI controllers, which
behave similarly from libvirt's point of view (and so should have the
same model), but use a different device in qemu (and present
themselves as a different piece of hardware in the guest). In an ideal
world we (i.e. "I") would have thought of that back when the pci
controllers were added, and used some sort of type/class/model
notation (where class was used in the way we are now using model, and
model was used for the actual manufacturer's model number of a
particular family of PCI controller), but that opportunity is long
past, so as an alternative, this patch allows selecting a particular
implementation of a pci controller with the "name" attribute of the
<model> subelement, e.g.:
<controller type='pci' model='dmi-to-pci-bridge' index='1'>
<model name='i82801b11-bridge'/>
</controller>
In this case, "dmi-to-pci-bridge" is the kind of controller (one that
has a single PCIe port upstream, and 32 standard PCI ports downstream,
which are not hotpluggable), and the qemu device to be used to
implement this kind of controller is named "i82801b11-bridge".
Implementing the above now will allow us in the future to add a new
kind of dmi-to-pci-bridge that doesn't use qemu's i82801b11-bridge
device, but instead uses something else (which doesn't yet exist, but
qemu people have been discussing it), all without breaking existing
configs.
(note that for the existing "pci-bridge" type of PCI controller, both
the model attribute and <model> name are 'pci-bridge'. This is just a
coincidence, since it turns out that in this case the device name in
qemu really is a generic 'pci-bridge' rather than being the name of
some real-world chip)
2015-06-25 17:30:23 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCI_BRIDGE,
|
|
|
|
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_I82801B11_BRIDGE,
|
2015-06-17 17:21:16 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_IOH3420,
|
2015-06-16 19:00:44 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_X3130_UPSTREAM,
|
2015-06-17 19:27:40 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_XIO3130_DOWNSTREAM,
|
2016-03-04 15:26:23 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PXB,
|
2016-03-16 17:37:14 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PXB_PCIE,
|
2017-01-16 12:28:20 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_ROOT_PORT,
|
2017-02-28 13:58:08 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_SPAPR_PCI_HOST_BRIDGE,
|
2018-01-11 16:28:43 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_PCI_BRIDGE,
|
conf: add new <model> subelement with name attribute to <controller>
This new subelement is used in PCI controllers: the toplevel
*attribute* "model" of a controller denotes what kind of PCI
controller is being described, e.g. a "dmi-to-pci-bridge",
"pci-bridge", or "pci-root". But in the future there will be different
implementations of some of those types of PCI controllers, which
behave similarly from libvirt's point of view (and so should have the
same model), but use a different device in qemu (and present
themselves as a different piece of hardware in the guest). In an ideal
world we (i.e. "I") would have thought of that back when the pci
controllers were added, and used some sort of type/class/model
notation (where class was used in the way we are now using model, and
model was used for the actual manufacturer's model number of a
particular family of PCI controller), but that opportunity is long
past, so as an alternative, this patch allows selecting a particular
implementation of a pci controller with the "name" attribute of the
<model> subelement, e.g.:
<controller type='pci' model='dmi-to-pci-bridge' index='1'>
<model name='i82801b11-bridge'/>
</controller>
In this case, "dmi-to-pci-bridge" is the kind of controller (one that
has a single PCIe port upstream, and 32 standard PCI ports downstream,
which are not hotpluggable), and the qemu device to be used to
implement this kind of controller is named "i82801b11-bridge".
Implementing the above now will allow us in the future to add a new
kind of dmi-to-pci-bridge that doesn't use qemu's i82801b11-bridge
device, but instead uses something else (which doesn't yet exist, but
qemu people have been discussing it), all without breaking existing
configs.
(note that for the existing "pci-bridge" type of PCI controller, both
the model attribute and <model> name are 'pci-bridge'. This is just a
coincidence, since it turns out that in this case the device name in
qemu really is a generic 'pci-bridge' rather than being the name of
some real-world chip)
2015-06-25 17:30:23 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_LAST
|
|
|
|
} virDomainControllerPCIModelName;
|
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2018-02-14 10:51:26 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_DEFAULT = -1,
|
2011-09-02 13:06:15 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_AUTO,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_BUSLOGIC,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSILOGIC,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1068,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VMPVSCSI,
|
2012-02-27 09:08:23 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI,
|
2012-02-27 09:16:20 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI,
|
2013-03-21 14:11:39 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1078,
|
2019-01-17 17:52:43 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_TRANSITIONAL,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_NON_TRANSITIONAL,
|
2020-11-17 18:15:44 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_NCR53C90,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_DC390,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_AM53C974,
|
2010-06-17 14:39:50 +00:00
|
|
|
|
2011-09-02 13:06:15 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainControllerModelSCSI;
|
2010-06-17 14:39:50 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2018-02-14 10:51:26 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT = -1,
|
2011-09-02 13:14:29 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX3_UHCI,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX4_UHCI,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_EHCI,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_EHCI1,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_UHCI1,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_UHCI2,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_UHCI3,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_VT82C686B_UHCI,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI,
|
2012-06-21 13:45:25 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI,
|
2016-06-15 06:00:08 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB1,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB2,
|
2017-04-13 10:25:25 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI,
|
2012-07-02 15:28:43 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE,
|
2011-09-02 13:14:29 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainControllerModelUSB;
|
2011-09-02 13:14:29 +00:00
|
|
|
|
2017-10-24 19:35:32 +00:00
|
|
|
typedef enum {
|
2018-02-14 10:51:26 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_IDE_DEFAULT = -1,
|
2017-10-24 19:35:32 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_IDE_PIIX3,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_IDE_PIIX4,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_IDE_ICH6,
|
|
|
|
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_IDE_LAST
|
|
|
|
} virDomainControllerModelIDE;
|
|
|
|
|
2019-01-17 17:52:44 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_VIRTIO_SERIAL_DEFAULT = -1,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_VIRTIO_SERIAL_VIRTIO,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_VIRTIO_SERIAL_VIRTIO_TRANSITIONAL,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_VIRTIO_SERIAL_VIRTIO_NON_TRANSITIONAL,
|
|
|
|
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_VIRTIO_SERIAL_LAST
|
|
|
|
} virDomainControllerModelVirtioSerial;
|
|
|
|
|
2019-02-17 13:04:00 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_ISA_DEFAULT = -1,
|
|
|
|
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_ISA_LAST
|
|
|
|
} virDomainControllerModelISA;
|
|
|
|
|
2019-06-07 20:20:16 +00:00
|
|
|
#define IS_USB2_CONTROLLER(ctrl) \
|
2016-05-08 19:56:23 +00:00
|
|
|
(((ctrl)->type == VIR_DOMAIN_CONTROLLER_TYPE_USB) && \
|
|
|
|
((ctrl)->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_EHCI1 || \
|
|
|
|
(ctrl)->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_UHCI1 || \
|
|
|
|
(ctrl)->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_UHCI2 || \
|
|
|
|
(ctrl)->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_UHCI3))
|
|
|
|
|
2010-02-18 16:52:03 +00:00
|
|
|
struct _virDomainVirtioSerialOpts {
|
|
|
|
int ports; /* -1 == undef */
|
|
|
|
int vectors; /* -1 == undef */
|
|
|
|
};
|
|
|
|
|
2014-03-13 11:59:32 +00:00
|
|
|
struct _virDomainPCIControllerOpts {
|
2013-08-12 11:39:04 +00:00
|
|
|
bool pcihole64;
|
|
|
|
unsigned long pcihole64size;
|
conf: add new <model> subelement with name attribute to <controller>
This new subelement is used in PCI controllers: the toplevel
*attribute* "model" of a controller denotes what kind of PCI
controller is being described, e.g. a "dmi-to-pci-bridge",
"pci-bridge", or "pci-root". But in the future there will be different
implementations of some of those types of PCI controllers, which
behave similarly from libvirt's point of view (and so should have the
same model), but use a different device in qemu (and present
themselves as a different piece of hardware in the guest). In an ideal
world we (i.e. "I") would have thought of that back when the pci
controllers were added, and used some sort of type/class/model
notation (where class was used in the way we are now using model, and
model was used for the actual manufacturer's model number of a
particular family of PCI controller), but that opportunity is long
past, so as an alternative, this patch allows selecting a particular
implementation of a pci controller with the "name" attribute of the
<model> subelement, e.g.:
<controller type='pci' model='dmi-to-pci-bridge' index='1'>
<model name='i82801b11-bridge'/>
</controller>
In this case, "dmi-to-pci-bridge" is the kind of controller (one that
has a single PCIe port upstream, and 32 standard PCI ports downstream,
which are not hotpluggable), and the qemu device to be used to
implement this kind of controller is named "i82801b11-bridge".
Implementing the above now will allow us in the future to add a new
kind of dmi-to-pci-bridge that doesn't use qemu's i82801b11-bridge
device, but instead uses something else (which doesn't yet exist, but
qemu people have been discussing it), all without breaking existing
configs.
(note that for the existing "pci-bridge" type of PCI controller, both
the model attribute and <model> name are 'pci-bridge'. This is just a
coincidence, since it turns out that in this case the device name in
qemu really is a generic 'pci-bridge' rather than being the name of
some real-world chip)
2015-06-25 17:30:23 +00:00
|
|
|
|
|
|
|
/* the exact controller name is in the "model" subelement, e.g.:
|
|
|
|
* <controller type='pci' model='pcie-root-port'>
|
|
|
|
* <model name='ioh3420''/>
|
|
|
|
* ...
|
|
|
|
*/
|
|
|
|
int modelName; /* the exact name of the device in hypervisor */
|
2015-07-01 16:47:55 +00:00
|
|
|
|
|
|
|
/* the following items are attributes of the "target" subelement
|
|
|
|
* of controller type='pci'. They are bits of configuration that
|
|
|
|
* are specified on the qemu commandline and are visible to the
|
|
|
|
* guest OS, so they must be preserved to ensure ABI
|
|
|
|
* compatibility.
|
|
|
|
*/
|
|
|
|
int chassisNr; /* used by pci-bridge, -1 == unspecified */
|
2015-06-17 17:21:16 +00:00
|
|
|
/* chassis & port used by
|
|
|
|
* pcie-root-port/pcie-switch-downstream-port, -1 = unspecified */
|
|
|
|
int chassis;
|
|
|
|
int port;
|
2016-03-04 15:26:23 +00:00
|
|
|
int busNr; /* used by pci-expander-bus, -1 == unspecified */
|
2017-02-22 10:42:19 +00:00
|
|
|
int targetIndex; /* used by spapr-pci-host-bridge, -1 == unspecified */
|
2016-03-04 15:26:23 +00:00
|
|
|
/* numaNode is a *subelement* of target (to match existing
|
|
|
|
* item in memory target config) -1 == unspecified
|
|
|
|
*/
|
|
|
|
int numaNode;
|
2020-03-03 17:23:52 +00:00
|
|
|
virTristateSwitch hotplug; /* 'off' to prevent hotplug/unplug, default 'on' */
|
2015-06-17 17:21:16 +00:00
|
|
|
};
|
2013-08-12 11:39:04 +00:00
|
|
|
|
2016-04-23 23:52:56 +00:00
|
|
|
struct _virDomainUSBControllerOpts {
|
|
|
|
int ports; /* -1 == undef */
|
|
|
|
};
|
|
|
|
|
2019-03-06 22:59:29 +00:00
|
|
|
struct _virDomainXenbusControllerOpts {
|
|
|
|
int maxGrantFrames; /* -1 == undef */
|
2020-04-07 22:37:09 +00:00
|
|
|
int maxEventChannels; /* -1 == undef */
|
2019-03-06 22:59:29 +00:00
|
|
|
};
|
|
|
|
|
2009-12-02 19:15:38 +00:00
|
|
|
/* Stores the virtual disk controller configuration */
|
|
|
|
struct _virDomainControllerDef {
|
|
|
|
int type;
|
2016-05-10 17:14:32 +00:00
|
|
|
int idx;
|
2010-06-17 14:39:50 +00:00
|
|
|
int model; /* -1 == undef */
|
2013-04-24 09:24:13 +00:00
|
|
|
unsigned int queues;
|
2014-05-22 18:22:52 +00:00
|
|
|
unsigned int cmd_per_lun;
|
|
|
|
unsigned int max_sectors;
|
2015-07-24 13:49:35 +00:00
|
|
|
int ioeventfd; /* enum virTristateSwitch */
|
2016-04-20 14:49:21 +00:00
|
|
|
unsigned int iothread; /* unused = 0, > 0 specific thread # */
|
2010-02-18 16:52:03 +00:00
|
|
|
union {
|
|
|
|
virDomainVirtioSerialOpts vioserial;
|
2014-03-13 11:59:32 +00:00
|
|
|
virDomainPCIControllerOpts pciopts;
|
2016-04-23 23:52:56 +00:00
|
|
|
virDomainUSBControllerOpts usbopts;
|
2019-03-06 22:59:29 +00:00
|
|
|
virDomainXenbusControllerOpts xenbusopts;
|
2010-02-18 16:52:03 +00:00
|
|
|
} opts;
|
2009-12-02 19:15:38 +00:00
|
|
|
virDomainDeviceInfo info;
|
2016-06-06 14:50:22 +00:00
|
|
|
virDomainVirtioOptionsPtr virtio;
|
2009-12-02 19:15:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2014-08-11 12:52:49 +00:00
|
|
|
/* Types of disk backends */
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2012-06-20 14:03:30 +00:00
|
|
|
VIR_DOMAIN_FS_TYPE_MOUNT, /* Mounts (binds) a host dir on a guest dir */
|
|
|
|
VIR_DOMAIN_FS_TYPE_BLOCK, /* Mounts a host block dev on a guest dir */
|
|
|
|
VIR_DOMAIN_FS_TYPE_FILE, /* Loopback mounts a host file on a guest dir */
|
|
|
|
VIR_DOMAIN_FS_TYPE_TEMPLATE, /* Expands a OS template to a guest dir */
|
|
|
|
VIR_DOMAIN_FS_TYPE_RAM, /* Mount a RAM filesystem on a guest dir */
|
|
|
|
VIR_DOMAIN_FS_TYPE_BIND, /* Binds a guest dir to another guest dir */
|
2016-07-14 13:52:39 +00:00
|
|
|
VIR_DOMAIN_FS_TYPE_VOLUME, /* Mounts storage pool volume to a guest */
|
2008-08-01 13:31:37 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_FS_TYPE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainFSType;
|
2008-08-01 13:31:37 +00:00
|
|
|
|
2011-10-11 11:30:40 +00:00
|
|
|
/* Filesystem driver type */
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2011-10-11 11:30:40 +00:00
|
|
|
VIR_DOMAIN_FS_DRIVER_TYPE_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_FS_DRIVER_TYPE_PATH,
|
|
|
|
VIR_DOMAIN_FS_DRIVER_TYPE_HANDLE,
|
2013-04-22 14:06:14 +00:00
|
|
|
VIR_DOMAIN_FS_DRIVER_TYPE_LOOP,
|
2013-04-22 14:06:17 +00:00
|
|
|
VIR_DOMAIN_FS_DRIVER_TYPE_NBD,
|
2015-01-13 11:27:36 +00:00
|
|
|
VIR_DOMAIN_FS_DRIVER_TYPE_PLOOP,
|
2019-07-16 05:01:30 +00:00
|
|
|
VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIOFS,
|
2011-10-11 11:30:40 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_FS_DRIVER_TYPE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainFSDriverType;
|
2011-10-11 11:30:40 +00:00
|
|
|
|
2010-10-14 13:08:24 +00:00
|
|
|
/* Filesystem mount access mode */
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2010-10-14 13:08:24 +00:00
|
|
|
VIR_DOMAIN_FS_ACCESSMODE_PASSTHROUGH,
|
|
|
|
VIR_DOMAIN_FS_ACCESSMODE_MAPPED,
|
|
|
|
VIR_DOMAIN_FS_ACCESSMODE_SQUASH,
|
|
|
|
|
|
|
|
VIR_DOMAIN_FS_ACCESSMODE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainFSAccessMode;
|
2010-10-14 13:08:24 +00:00
|
|
|
|
2012-01-17 12:44:18 +00:00
|
|
|
/* Filesystem Write policy */
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2012-01-17 12:44:18 +00:00
|
|
|
VIR_DOMAIN_FS_WRPOLICY_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_FS_WRPOLICY_IMMEDIATE,
|
|
|
|
|
|
|
|
VIR_DOMAIN_FS_WRPOLICY_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainFSWrpolicy;
|
2012-01-17 12:44:18 +00:00
|
|
|
|
2020-03-30 18:05:33 +00:00
|
|
|
/* How to handle exports containing multiple devices. */
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_FS_MULTIDEVS_DEFAULT = 0, /* Use QEMU's default setting */
|
|
|
|
VIR_DOMAIN_FS_MULTIDEVS_REMAP, /* Remap inodes from host to guest */
|
|
|
|
VIR_DOMAIN_FS_MULTIDEVS_FORBID, /* Prohibit more than one device */
|
|
|
|
VIR_DOMAIN_FS_MULTIDEVS_WARN, /* Just log a warning if multiple devices */
|
|
|
|
|
|
|
|
VIR_DOMAIN_FS_MULTIDEVS_LAST
|
|
|
|
} virDomainFSMultidevs;
|
|
|
|
|
|
|
|
VIR_ENUM_DECL(virDomainFSMultidevs);
|
|
|
|
|
2019-01-17 17:52:36 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_FS_MODEL_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_FS_MODEL_VIRTIO,
|
|
|
|
VIR_DOMAIN_FS_MODEL_VIRTIO_TRANSITIONAL,
|
|
|
|
VIR_DOMAIN_FS_MODEL_VIRTIO_NON_TRANSITIONAL,
|
|
|
|
|
|
|
|
VIR_DOMAIN_FS_MODEL_LAST
|
|
|
|
} virDomainFSModel;
|
|
|
|
|
2020-01-21 07:14:46 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_FS_CACHE_MODE_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_FS_CACHE_MODE_NONE,
|
|
|
|
VIR_DOMAIN_FS_CACHE_MODE_ALWAYS,
|
|
|
|
|
|
|
|
VIR_DOMAIN_FS_CACHE_MODE_LAST
|
|
|
|
} virDomainFSCacheMode;
|
|
|
|
|
2008-08-01 13:31:37 +00:00
|
|
|
struct _virDomainFSDef {
|
|
|
|
int type;
|
2013-04-22 14:06:14 +00:00
|
|
|
int fsdriver; /* enum virDomainFSDriverType */
|
|
|
|
int accessmode; /* enum virDomainFSAccessMode */
|
2012-01-17 12:44:18 +00:00
|
|
|
int wrpolicy; /* enum virDomainFSWrpolicy */
|
2014-05-11 15:08:50 +00:00
|
|
|
int format; /* virStorageFileFormat */
|
2019-01-17 17:52:36 +00:00
|
|
|
int model; /* virDomainFSModel */
|
2020-10-08 14:32:24 +00:00
|
|
|
unsigned int fmode;
|
|
|
|
unsigned int dmode;
|
2020-03-30 18:05:33 +00:00
|
|
|
int multidevs; /* virDomainFSMultidevs */
|
LXC: Fix handling of RAM filesystem size units
Since 76b644c when the support for RAM filesystems was introduced,
libvirt accepted the following XML:
<source usage='1024' unit='KiB'/>
This was parsed correctly and internally stored in bytes, but it
was formatted as (with an extra 's'):
<source usage='1024' units='KiB'/>
When read again, this was treated as if the units were missing,
meaning libvirt was unable to parse its own XML correctly.
The usage attribute was documented as being in KiB, but it was not
scaled if the unit was missing. Transient domains still worked,
because this was balanced by an extra 'k' in the mount options.
This patch:
Changes the parser to use 'units' instead of 'unit', as the latter
was never documented (fixing persistent domains) and some programs
(libvirt-glib, libvirt-sandbox) already parse the 'units' attribute.
Removes the extra 'k' from the tmpfs mount options, which is needed
because now we parse our own XML correctly.
Changes the default input unit to KiB to match documentation, fixing:
https://bugzilla.redhat.com/show_bug.cgi?id=1015689
2013-10-09 12:17:13 +00:00
|
|
|
unsigned long long usage; /* in bytes */
|
2016-07-14 13:52:38 +00:00
|
|
|
virStorageSourcePtr src;
|
2008-08-01 13:31:37 +00:00
|
|
|
char *dst;
|
2013-04-10 12:15:31 +00:00
|
|
|
bool readonly;
|
Add device info to serial, parallel, channel, input & fs devices
Although the serial, parallel, chanel, input & fs devices do
not have PCI address info, they can all have device aliases.
Thus it neccessary to associate the virDomainDeviceInfo data
with them all.
* src/conf/domain_conf.c, src/conf/domain_conf.h: Add hooks for
parsing / formatting device info for serial, parallel, channel
input and fs devices.
* docs/schemas/domain.rng: Associate device info with character
devices, input & fs device
2010-01-06 12:39:53 +00:00
|
|
|
virDomainDeviceInfo info;
|
2012-05-23 12:38:55 +00:00
|
|
|
unsigned long long space_hard_limit; /* in bytes */
|
|
|
|
unsigned long long space_soft_limit; /* in bytes */
|
2014-11-21 16:45:55 +00:00
|
|
|
bool symlinksResolved;
|
2020-01-21 07:14:46 +00:00
|
|
|
char *binary;
|
|
|
|
unsigned long long queue_size;
|
|
|
|
virTristateSwitch xattr;
|
|
|
|
virDomainFSCacheMode cache;
|
|
|
|
virTristateSwitch posix_lock;
|
|
|
|
virTristateSwitch flock;
|
2016-06-06 14:50:57 +00:00
|
|
|
virDomainVirtioOptionsPtr virtio;
|
2019-12-10 12:52:52 +00:00
|
|
|
virObjectPtr privateData;
|
2008-08-01 13:31:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2013-02-19 10:55:27 +00:00
|
|
|
/* network config types */
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_DOMAIN_NET_TYPE_USER,
|
|
|
|
VIR_DOMAIN_NET_TYPE_ETHERNET,
|
2014-07-11 17:47:31 +00:00
|
|
|
VIR_DOMAIN_NET_TYPE_VHOSTUSER,
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_DOMAIN_NET_TYPE_SERVER,
|
|
|
|
VIR_DOMAIN_NET_TYPE_CLIENT,
|
|
|
|
VIR_DOMAIN_NET_TYPE_MCAST,
|
|
|
|
VIR_DOMAIN_NET_TYPE_NETWORK,
|
|
|
|
VIR_DOMAIN_NET_TYPE_BRIDGE,
|
2009-05-11 09:50:27 +00:00
|
|
|
VIR_DOMAIN_NET_TYPE_INTERNAL,
|
2010-02-12 17:07:06 +00:00
|
|
|
VIR_DOMAIN_NET_TYPE_DIRECT,
|
2012-02-15 17:37:15 +00:00
|
|
|
VIR_DOMAIN_NET_TYPE_HOSTDEV,
|
2015-08-29 20:19:10 +00:00
|
|
|
VIR_DOMAIN_NET_TYPE_UDP,
|
2020-10-14 17:08:25 +00:00
|
|
|
VIR_DOMAIN_NET_TYPE_VDPA,
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_NET_TYPE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainNetType;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2019-01-18 00:12:27 +00:00
|
|
|
/* network model types */
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_NET_MODEL_UNKNOWN,
|
|
|
|
VIR_DOMAIN_NET_MODEL_NETFRONT,
|
2019-01-18 00:53:14 +00:00
|
|
|
VIR_DOMAIN_NET_MODEL_RTL8139,
|
|
|
|
VIR_DOMAIN_NET_MODEL_VIRTIO,
|
|
|
|
VIR_DOMAIN_NET_MODEL_E1000,
|
2019-01-18 14:59:02 +00:00
|
|
|
VIR_DOMAIN_NET_MODEL_E1000E,
|
|
|
|
VIR_DOMAIN_NET_MODEL_VIRTIO_TRANSITIONAL,
|
|
|
|
VIR_DOMAIN_NET_MODEL_VIRTIO_NON_TRANSITIONAL,
|
|
|
|
VIR_DOMAIN_NET_MODEL_USB_NET,
|
|
|
|
VIR_DOMAIN_NET_MODEL_SPAPR_VLAN,
|
|
|
|
VIR_DOMAIN_NET_MODEL_LAN9118,
|
|
|
|
VIR_DOMAIN_NET_MODEL_SMC91C111,
|
2019-01-18 19:02:07 +00:00
|
|
|
VIR_DOMAIN_NET_MODEL_VLANCE,
|
|
|
|
VIR_DOMAIN_NET_MODEL_VMXNET,
|
|
|
|
VIR_DOMAIN_NET_MODEL_VMXNET2,
|
|
|
|
VIR_DOMAIN_NET_MODEL_VMXNET3,
|
2019-01-18 19:13:43 +00:00
|
|
|
VIR_DOMAIN_NET_MODEL_AM79C970A,
|
|
|
|
VIR_DOMAIN_NET_MODEL_AM79C973,
|
|
|
|
VIR_DOMAIN_NET_MODEL_82540EM,
|
|
|
|
VIR_DOMAIN_NET_MODEL_82545EM,
|
|
|
|
VIR_DOMAIN_NET_MODEL_82543GC,
|
2019-01-18 00:12:27 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_NET_MODEL_LAST
|
|
|
|
} virDomainNetModelType;
|
|
|
|
|
2011-01-12 04:18:49 +00:00
|
|
|
/* the backend driver used for virtio interfaces */
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2011-01-12 04:18:49 +00:00
|
|
|
VIR_DOMAIN_NET_BACKEND_TYPE_DEFAULT, /* prefer kernel, fall back to user */
|
|
|
|
VIR_DOMAIN_NET_BACKEND_TYPE_QEMU, /* userland */
|
|
|
|
VIR_DOMAIN_NET_BACKEND_TYPE_VHOST, /* kernel */
|
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_NET_BACKEND_TYPE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainNetBackendType;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
Add txmode attribute to interface XML for virtio backend
This is in response to:
https://bugzilla.redhat.com/show_bug.cgi?id=629662
Explanation
qemu's virtio-net-pci driver allows setting the algorithm used for tx
packets to either "bh" or "timer". This is done by adding ",tx=bh" or
",tx=timer" to the "-device virtio-net-pci" commandline option.
'bh' stands for 'bottom half'; when this is set, packet tx is all done
in an iothread in the bottom half of the driver. (In libvirt, this
option is called the more descriptive "iothread".)
'timer' means that tx work is done in qemu, and if there is more tx
data than can be sent at the present time, a timer is set before qemu
moves on to do other things; when the timer fires, another attempt is
made to send more data. (libvirt retains the name "timer" for this
option.)
The resulting difference, according to the qemu developer who added
the option is:
bh makes tx more asynchronous and reduces latency, but potentially
causes more processor bandwidth contention since the cpu doing the
tx isn't necessarily the cpu where the guest generated the
packets.
Solution
This patch provides a libvirt domain xml knob to change the option on
the qemu commandline, by adding a new attribute "txmode" to the
<driver> element that can be placed inside any <interface> element in
a domain definition. It's use would be something like this:
<interface ...>
...
<model type='virtio'/>
<driver txmode='iothread'/>
...
</interface>
I chose to put this setting as an attribute to <driver> rather than as
a sub-element to <tune> because it is specific to the virtio-net
driver, not something that is generally usable by all network drivers.
(note that this is the same placement as the "driver name=..."
attribute used to choose kernel vs. userland backend for the
virtio-net driver.)
Actually adding the tx=xxx option to the qemu commandline is only done
if the version of qemu being used advertises it in the output of
qemu -device virtio-net-pci,?
If a particular txmode is requested in the XML, and the option isn't
listed in that help output, an UNSUPPORTED_CONFIG error is logged, and
the domain fails to start.
2011-02-03 20:20:01 +00:00
|
|
|
/* the TX algorithm used for virtio interfaces */
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
Add txmode attribute to interface XML for virtio backend
This is in response to:
https://bugzilla.redhat.com/show_bug.cgi?id=629662
Explanation
qemu's virtio-net-pci driver allows setting the algorithm used for tx
packets to either "bh" or "timer". This is done by adding ",tx=bh" or
",tx=timer" to the "-device virtio-net-pci" commandline option.
'bh' stands for 'bottom half'; when this is set, packet tx is all done
in an iothread in the bottom half of the driver. (In libvirt, this
option is called the more descriptive "iothread".)
'timer' means that tx work is done in qemu, and if there is more tx
data than can be sent at the present time, a timer is set before qemu
moves on to do other things; when the timer fires, another attempt is
made to send more data. (libvirt retains the name "timer" for this
option.)
The resulting difference, according to the qemu developer who added
the option is:
bh makes tx more asynchronous and reduces latency, but potentially
causes more processor bandwidth contention since the cpu doing the
tx isn't necessarily the cpu where the guest generated the
packets.
Solution
This patch provides a libvirt domain xml knob to change the option on
the qemu commandline, by adding a new attribute "txmode" to the
<driver> element that can be placed inside any <interface> element in
a domain definition. It's use would be something like this:
<interface ...>
...
<model type='virtio'/>
<driver txmode='iothread'/>
...
</interface>
I chose to put this setting as an attribute to <driver> rather than as
a sub-element to <tune> because it is specific to the virtio-net
driver, not something that is generally usable by all network drivers.
(note that this is the same placement as the "driver name=..."
attribute used to choose kernel vs. userland backend for the
virtio-net driver.)
Actually adding the tx=xxx option to the qemu commandline is only done
if the version of qemu being used advertises it in the output of
qemu -device virtio-net-pci,?
If a particular txmode is requested in the XML, and the option isn't
listed in that help output, an UNSUPPORTED_CONFIG error is logged, and
the domain fails to start.
2011-02-03 20:20:01 +00:00
|
|
|
VIR_DOMAIN_NET_VIRTIO_TX_MODE_DEFAULT, /* default for this version of qemu */
|
|
|
|
VIR_DOMAIN_NET_VIRTIO_TX_MODE_IOTHREAD,
|
|
|
|
VIR_DOMAIN_NET_VIRTIO_TX_MODE_TIMER,
|
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_NET_VIRTIO_TX_MODE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainNetVirtioTxModeType;
|
Add txmode attribute to interface XML for virtio backend
This is in response to:
https://bugzilla.redhat.com/show_bug.cgi?id=629662
Explanation
qemu's virtio-net-pci driver allows setting the algorithm used for tx
packets to either "bh" or "timer". This is done by adding ",tx=bh" or
",tx=timer" to the "-device virtio-net-pci" commandline option.
'bh' stands for 'bottom half'; when this is set, packet tx is all done
in an iothread in the bottom half of the driver. (In libvirt, this
option is called the more descriptive "iothread".)
'timer' means that tx work is done in qemu, and if there is more tx
data than can be sent at the present time, a timer is set before qemu
moves on to do other things; when the timer fires, another attempt is
made to send more data. (libvirt retains the name "timer" for this
option.)
The resulting difference, according to the qemu developer who added
the option is:
bh makes tx more asynchronous and reduces latency, but potentially
causes more processor bandwidth contention since the cpu doing the
tx isn't necessarily the cpu where the guest generated the
packets.
Solution
This patch provides a libvirt domain xml knob to change the option on
the qemu commandline, by adding a new attribute "txmode" to the
<driver> element that can be placed inside any <interface> element in
a domain definition. It's use would be something like this:
<interface ...>
...
<model type='virtio'/>
<driver txmode='iothread'/>
...
</interface>
I chose to put this setting as an attribute to <driver> rather than as
a sub-element to <tune> because it is specific to the virtio-net
driver, not something that is generally usable by all network drivers.
(note that this is the same placement as the "driver name=..."
attribute used to choose kernel vs. userland backend for the
virtio-net driver.)
Actually adding the tx=xxx option to the qemu commandline is only done
if the version of qemu being used advertises it in the output of
qemu -device virtio-net-pci,?
If a particular txmode is requested in the XML, and the option isn't
listed in that help output, an UNSUPPORTED_CONFIG error is logged, and
the domain fails to start.
2011-02-03 20:20:01 +00:00
|
|
|
|
2020-07-13 14:28:53 +00:00
|
|
|
/* whether a mac address should be marked as generated in the esx driver or not*/
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_NET_MAC_TYPE_DEFAULT = 0, /* generated */
|
|
|
|
VIR_DOMAIN_NET_MAC_TYPE_GENERATED,
|
|
|
|
VIR_DOMAIN_NET_MAC_TYPE_STATIC,
|
|
|
|
|
|
|
|
VIR_DOMAIN_NET_MAC_TYPE_LAST
|
|
|
|
} virDomainNetMacType;
|
|
|
|
|
2020-01-22 21:24:10 +00:00
|
|
|
/* the type of teaming device */
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_NET_TEAMING_TYPE_NONE,
|
|
|
|
VIR_DOMAIN_NET_TEAMING_TYPE_PERSISTENT,
|
|
|
|
VIR_DOMAIN_NET_TEAMING_TYPE_TRANSIENT,
|
|
|
|
|
|
|
|
VIR_DOMAIN_NET_TEAMING_TYPE_LAST
|
|
|
|
} virDomainNetTeamingType;
|
|
|
|
|
2011-09-06 08:08:15 +00:00
|
|
|
/* link interface states */
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2011-09-06 08:08:15 +00:00
|
|
|
VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DEFAULT = 0, /* Default link state (up) */
|
|
|
|
VIR_DOMAIN_NET_INTERFACE_LINK_STATE_UP, /* Link is up. ("cable" connected) */
|
|
|
|
VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN , /* Link is down. ("cable" disconnected) */
|
|
|
|
|
|
|
|
VIR_DOMAIN_NET_INTERFACE_LINK_STATE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainNetInterfaceLinkState;
|
2011-09-06 08:08:15 +00:00
|
|
|
|
2011-06-26 08:09:00 +00:00
|
|
|
/* Config that was actually used to bring up interface, after
|
|
|
|
* resolving network reference. This is private data, only used within
|
|
|
|
* libvirt, but still must maintain backward compatibility, because
|
|
|
|
* different versions of libvirt may read the same data file.
|
|
|
|
*/
|
|
|
|
struct _virDomainActualNetDef {
|
|
|
|
int type; /* enum virDomainNetType */
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
char *brname;
|
network: store network macTableManager setting in NetDef actual object
At the time that the network driver allocates a connection to a
network, the tap device that will be used hasn't yet been created -
that will be done later by qemu (or lxc or whoever) - but if the
network has macTableManager='libvirt', then when we do get around to
creating the tap device, we will need to add an entry for it to the
network bridge's fdb (forwarding database) *and* turn off learning and
unicast_flood for that tap device in the bridge's sysfs settings. This
means that qemu needs to know both the bridge name as well as the
setting of macTableManager, so we either need to create a new API to
retrieve that info, or just pass it back in the ActualNetDef that is
created during networkAllocateActualDevice. We choose the latter
method, since it's already done for the bridge device, and it has the
side effect of making the information available in domain status.
(NB: in the future, I think that the tap device should actually be
created by networkAllocateActualDevice(), as that will solve several
other problems, but that is a battle for another day, and this
information will still be useful outside the network driver)
2014-11-21 17:35:15 +00:00
|
|
|
int macTableManager; /* enum virNetworkBridgeMACTableManagerType */
|
2011-06-26 08:09:00 +00:00
|
|
|
} bridge;
|
|
|
|
struct {
|
|
|
|
char *linkdev;
|
|
|
|
int mode; /* enum virMacvtapMode from util/macvtap.h */
|
|
|
|
} direct;
|
2012-02-15 17:37:15 +00:00
|
|
|
struct {
|
|
|
|
virDomainHostdevDef def;
|
|
|
|
} hostdev;
|
2011-06-26 08:09:00 +00:00
|
|
|
} data;
|
2012-07-30 06:03:25 +00:00
|
|
|
virNetDevVPortProfilePtr virtPortProfile;
|
Adjust naming of network device bandwidth management APIs
Rename virBandwidth to virNetDevBandwidth, and virRate to
virNetDevBandwidthRate.
* src/util/network.c, src/util/network.h: Rename bandwidth
structs and APIs
* src/conf/domain_conf.c, src/conf/domain_conf.h,
src/conf/network_conf.c, src/conf/network_conf.h,
src/lxc/lxc_driver.c, src/network/bridge_driver.c,
src/qemu/qemu_command.c, src/util/macvtap.c,
src/util/macvtap.h, tools/virsh.c: Update for API changes.
2011-11-02 14:29:05 +00:00
|
|
|
virNetDevBandwidthPtr bandwidth;
|
2012-08-12 07:51:30 +00:00
|
|
|
virNetDevVlan vlan;
|
2014-09-23 18:19:08 +00:00
|
|
|
int trustGuestRxFilters; /* enum virTristateBool */
|
2020-01-29 15:29:21 +00:00
|
|
|
virTristateBool isolatedPort;
|
2012-11-16 13:29:01 +00:00
|
|
|
unsigned int class_id; /* class ID for bandwidth 'floor' */
|
2011-06-26 08:09:00 +00:00
|
|
|
};
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
/* Stores the virtual network interface configuration */
|
|
|
|
struct _virDomainNetDef {
|
2014-06-01 00:22:30 +00:00
|
|
|
virDomainNetType type;
|
2012-07-17 12:07:59 +00:00
|
|
|
virMacAddr mac;
|
2018-02-16 17:26:17 +00:00
|
|
|
bool mac_generated; /* true if mac was *just now* auto-generated by libvirt */
|
2020-07-13 14:28:53 +00:00
|
|
|
virDomainNetMacType mac_type;
|
2020-07-13 09:44:13 +00:00
|
|
|
virTristateBool mac_check;
|
2019-01-18 00:12:27 +00:00
|
|
|
int model; /* virDomainNetModelType */
|
2019-01-18 21:32:22 +00:00
|
|
|
char *modelstr;
|
Restructure domain struct interface "driver" data for easier expansion
When the <driver> element (and its "name" attribute) was added to the
domain XML's interface element, a "backend" enum was simply added to
the toplevel of the virDomainNetDef struct.
Ignoring the naming inconsistency ("name" vs. "backend"), this is fine
when there's only a single item contained in the driver element of the
XML, but doesn't scale well as we add more attributes that apply to
the backend of the virtio-net driver, or add attributes applicable to
other drivers.
This patch changes virDomainNetDef in two ways:
1) Rename the item in the struct from "backend" to "name", so that
it's the same in the XML and in the struct, hopefully avoiding
confusion for someone unfamiliar with the function of the
attribute.
2) Create a "driver" union within virDomainNetDef, and a "virtio"
struct in that struct, which contains the "name" enum value.
3) Move around the virDomainNetParse and virDomainNetFormat functions
to allow for simple plugin of new attributes without disturbing
existing code. (you'll note that this results in a seemingly
redundant if() in the format function, but that will no longer be
the case as soon as a 2nd attribute is added).
In the future, new attributes for the virtio driver backend can be
added to the "virtio" struct, and any other network device backend that
needs an attribute will have its own struct added to the "driver"
union.
2011-02-03 18:52:08 +00:00
|
|
|
union {
|
|
|
|
struct {
|
2014-06-01 00:22:30 +00:00
|
|
|
virDomainNetBackendType name; /* which driver backend to use */
|
|
|
|
virDomainNetVirtioTxModeType txmode;
|
2014-06-27 15:18:53 +00:00
|
|
|
virTristateSwitch ioeventfd;
|
|
|
|
virTristateSwitch event_idx;
|
2013-04-10 10:19:37 +00:00
|
|
|
unsigned int queues; /* Multiqueue virtio-net */
|
2016-08-18 16:19:13 +00:00
|
|
|
unsigned int rx_queue_size;
|
2017-07-12 12:19:26 +00:00
|
|
|
unsigned int tx_queue_size;
|
2014-09-11 10:56:31 +00:00
|
|
|
struct {
|
|
|
|
virTristateSwitch csum;
|
|
|
|
virTristateSwitch gso;
|
|
|
|
virTristateSwitch tso4;
|
|
|
|
virTristateSwitch tso6;
|
|
|
|
virTristateSwitch ecn;
|
|
|
|
virTristateSwitch ufo;
|
2015-02-06 14:35:57 +00:00
|
|
|
virTristateSwitch mrg_rxbuf;
|
2014-09-11 10:56:31 +00:00
|
|
|
} host;
|
|
|
|
struct {
|
|
|
|
virTristateSwitch csum;
|
|
|
|
virTristateSwitch tso4;
|
|
|
|
virTristateSwitch tso6;
|
|
|
|
virTristateSwitch ecn;
|
|
|
|
virTristateSwitch ufo;
|
|
|
|
} guest;
|
Restructure domain struct interface "driver" data for easier expansion
When the <driver> element (and its "name" attribute) was added to the
domain XML's interface element, a "backend" enum was simply added to
the toplevel of the virDomainNetDef struct.
Ignoring the naming inconsistency ("name" vs. "backend"), this is fine
when there's only a single item contained in the driver element of the
XML, but doesn't scale well as we add more attributes that apply to
the backend of the virtio-net driver, or add attributes applicable to
other drivers.
This patch changes virDomainNetDef in two ways:
1) Rename the item in the struct from "backend" to "name", so that
it's the same in the XML and in the struct, hopefully avoiding
confusion for someone unfamiliar with the function of the
attribute.
2) Create a "driver" union within virDomainNetDef, and a "virtio"
struct in that struct, which contains the "name" enum value.
3) Move around the virDomainNetParse and virDomainNetFormat functions
to allow for simple plugin of new attributes without disturbing
existing code. (you'll note that this results in a seemingly
redundant if() in the format function, but that will no longer be
the case as soon as a 2nd attribute is added).
In the future, new attributes for the virtio driver backend can be
added to the "virtio" struct, and any other network device backend that
needs an attribute will have its own struct added to the "driver"
union.
2011-02-03 18:52:08 +00:00
|
|
|
} virtio;
|
|
|
|
} driver;
|
2014-09-11 15:11:28 +00:00
|
|
|
struct {
|
|
|
|
char *tap;
|
|
|
|
char *vhost;
|
|
|
|
} backend;
|
2020-01-22 21:24:10 +00:00
|
|
|
struct {
|
|
|
|
virDomainNetTeamingType type;
|
|
|
|
char *persistent; /* alias name of persistent device */
|
|
|
|
} teaming;
|
2008-07-11 16:23:36 +00:00
|
|
|
union {
|
2014-07-11 17:47:31 +00:00
|
|
|
virDomainChrSourceDefPtr vhostuser;
|
2008-07-11 16:23:36 +00:00
|
|
|
struct {
|
|
|
|
char *address;
|
|
|
|
int port;
|
2015-08-29 20:19:10 +00:00
|
|
|
char *localaddr;
|
|
|
|
int localport;
|
2008-07-11 16:23:36 +00:00
|
|
|
} socket; /* any of NET_CLIENT or NET_SERVER or NET_MCAST */
|
|
|
|
struct {
|
|
|
|
char *name;
|
2011-06-26 08:09:00 +00:00
|
|
|
char *portgroup;
|
2019-02-01 18:07:08 +00:00
|
|
|
unsigned char portid[VIR_UUID_BUFLEN];
|
2011-06-26 08:09:00 +00:00
|
|
|
/* actual has info about the currently used physical
|
|
|
|
* device (if the network is of type
|
|
|
|
* bridge/private/vepa/passthrough). This is saved in the
|
|
|
|
* domain state, but never written to persistent config,
|
|
|
|
* since it needs to be re-allocated whenever the domain
|
|
|
|
* is restarted. It is also never shown to the user, and
|
|
|
|
* the user cannot specify it in XML documents.
|
2019-02-01 18:07:08 +00:00
|
|
|
*
|
|
|
|
* This information is populated from the virNetworkPort
|
|
|
|
* object associated with the portid UUID above.
|
2011-06-26 08:09:00 +00:00
|
|
|
*/
|
|
|
|
virDomainActualNetDefPtr actual;
|
2008-07-11 16:23:36 +00:00
|
|
|
} network;
|
2020-10-14 17:08:25 +00:00
|
|
|
struct {
|
|
|
|
char *devicepath;
|
|
|
|
} vdpa;
|
2008-07-11 16:23:36 +00:00
|
|
|
struct {
|
|
|
|
char *brname;
|
|
|
|
} bridge;
|
2009-05-11 09:50:27 +00:00
|
|
|
struct {
|
|
|
|
char *name;
|
|
|
|
} internal;
|
2010-02-12 17:07:06 +00:00
|
|
|
struct {
|
|
|
|
char *linkdev;
|
2011-06-20 16:08:41 +00:00
|
|
|
int mode; /* enum virMacvtapMode from util/macvtap.h */
|
2010-02-12 17:07:06 +00:00
|
|
|
} direct;
|
2012-02-15 17:37:15 +00:00
|
|
|
struct {
|
|
|
|
virDomainHostdevDef def;
|
|
|
|
} hostdev;
|
2008-07-11 16:23:36 +00:00
|
|
|
} data;
|
2012-07-30 06:03:25 +00:00
|
|
|
/* virtPortProfile is used by network/bridge/direct/hostdev */
|
|
|
|
virNetDevVPortProfilePtr virtPortProfile;
|
2011-01-12 19:38:01 +00:00
|
|
|
struct {
|
|
|
|
bool sndbuf_specified;
|
|
|
|
unsigned long sndbuf;
|
|
|
|
} tune;
|
config: report error when script given for inappropriate interface type
This fixes https://bugzilla.redhat.com/show_bug.cgi?id=638633
Although scripts are not used by interfaces of type other than
"ethernet" in qemu, due to the fact that the parser stores the script
name in a union that is only valid when type is ethernet or bridge,
there is no way for anyone except the parser itself to catch the
problem of specifying an interface script for an inappropriate
interface type (by the time the parsed data gets back to the code that
called the parser, all evidence that a script was specified is
forgotten).
Since the parser itself should be agnostic to which type of interface
allows scripts (an example of why: a script specified for an interface
of type bridge is valid for xen domains, but not for qemu domains),
the solution here is to move the script out of the union(s) in the
DomainNetDef, always populate it when specified (regardless of
interface type), and let the driver decide whether or not it is
appropriate.
Currently the qemu, xen, libxml, and uml drivers recognize the script
parameter and do something with it (the uml driver only to report that
it isn't supported). Those drivers have been updated to log a
CONFIG_UNSUPPORTED error when a script is specified for an interface
type that's inappropriate for that particular hypervisor.
(NB: There was earlier discussion of solving this problem by adding a
VALIDATE flag to all libvirt APIs that accept XML, which would cause
the XML to be validated against the RNG files. One statement during
that discussion was that the RNG shouldn't contain hypervisor-specific
things, though, and a proper solution to this problem would require
that (again, because a script for an interface of type "bridge" is
accepted by xen, but not by qemu).
2012-01-06 17:59:47 +00:00
|
|
|
char *script;
|
2020-05-26 00:40:59 +00:00
|
|
|
char *downscript;
|
2015-02-20 03:22:05 +00:00
|
|
|
char *domain_name; /* backend domain name */
|
conf: support host-side IP/route information in <interface>
This is place as a sub-element of <source>, where other aspects of the
host-side connection to the network device are located (network or
bridge name, udp listen port, etc). It's a bit odd that the interface
we're configuring with this info is itself named in <target dev='x'/>,
but that ship sailed long ago:
<interface type='ethernet'>
<mac address='00:16:3e:0f:ef:8a'/>
<source>
<ip address='192.168.122.12' family='ipv4'
prefix='24' peer='192.168.122.1'/>
<ip address='192.168.122.13' family='ipv4' prefix='24'/>
<route family='ipv4' address='0.0.0.0'
gateway='192.168.122.1'/>
<route family='ipv4' address='192.168.124.0' prefix='24'
gateway='192.168.124.1'/>
</source>
</interface>
In practice, this will likely only be useful for type='ethernet', so
its presence in any other type of interface is currently forbidden in
the generic device Validate function (but it's been put into the
general population of virDomainNetDef rather than the
ethernet-specific union member so that 1) we can more easily add the
capability to other types if needed, and 2) we can retain the info
when set to an invalid interface type all the way through to
validation and report a proper error, rather than just ignoring it
(which is currently what happens for many other type-specific
settings).
(NB: The already-existing configuration of IP info for the guest-side
of interfaces is in subelements directly under <interface>, and the
name of the guest-side interface (when configurable) is in <guest
dev='x'/>).
(This patch had been pushed earlier in
commit fe6a77898a38f491403a70cc49925a584101daee, but was reverted in
commit d658456530c1010a49f45865613ed361a0fcc5b4 because it had been
accidentally pushed during the freeze for release 2.0.0)
2016-06-09 19:35:08 +00:00
|
|
|
char *ifname; /* interface name on the host (<target dev='x'/>) */
|
conf: new "managed" attribute for target dev of <interface type='ethernet'>
Although <interface type='ethernet'> has always been able to use an
existing tap device, this is just a coincidence due to the fact that
the same ioctl is used to create a new tap device or get a handle to
an existing device.
Even then, once we have the handle to the device, we still insist on
doing extra setup to it (setting the MAC address and IFF_UP). That
*might* be okay if libvirtd is running as a privileged process, but if
libvirtd is running as an unprivileged user, those attempted
modifications to the tap device will fail (yes, even if the tap is set
to be owned by the user running libvirtd). We could avoid this if we
knew that the device already existed, but as stated above, an existing
device and new device are both accessed in the same manner, and
anyway, we need to preserve existing behavior for those who are
already using pre-existing devices with privileged libvirtd (and
allowing/expecting libvirt to configure the pre-existing device).
In order to cleanly support the idea of using a pre-existing and
pre-configured tap device, this patch introduces a new optional
attribute "managed" for the interface <target> element. This
attribute is only valid for <interface type='ethernet'> (since all
other interface types have mandatory config that doesn't apply in the
case where we expect the tap device to be setup before we
get it). The syntax would look something like this:
<interface type='ethernet'>
<target dev='mytap0' managed='no'/>
...
</interface>
This patch just adds managed to the grammar and parser for <target>,
but has no functionality behind it.
(NB: when managed='no' (the default when not specified is 'yes'), the
target dev is always a name explicitly provided, so we don't
auto-remove it from the config just because it starts with "vnet"
(VIR_NET_GENERATED_TAP_PREFIX); this makes it possible to use the
same pattern of names that libvirt itself uses when it automatically
creates the tap devices.)
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019-08-21 20:42:41 +00:00
|
|
|
int managed_tap; /* enum virTristateBool - ABSENT == YES */
|
conf: support host-side IP/route information in <interface>
This is place as a sub-element of <source>, where other aspects of the
host-side connection to the network device are located (network or
bridge name, udp listen port, etc). It's a bit odd that the interface
we're configuring with this info is itself named in <target dev='x'/>,
but that ship sailed long ago:
<interface type='ethernet'>
<mac address='00:16:3e:0f:ef:8a'/>
<source>
<ip address='192.168.122.12' family='ipv4'
prefix='24' peer='192.168.122.1'/>
<ip address='192.168.122.13' family='ipv4' prefix='24'/>
<route family='ipv4' address='0.0.0.0'
gateway='192.168.122.1'/>
<route family='ipv4' address='192.168.124.0' prefix='24'
gateway='192.168.124.1'/>
</source>
</interface>
In practice, this will likely only be useful for type='ethernet', so
its presence in any other type of interface is currently forbidden in
the generic device Validate function (but it's been put into the
general population of virDomainNetDef rather than the
ethernet-specific union member so that 1) we can more easily add the
capability to other types if needed, and 2) we can retain the info
when set to an invalid interface type all the way through to
validation and report a proper error, rather than just ignoring it
(which is currently what happens for many other type-specific
settings).
(NB: The already-existing configuration of IP info for the guest-side
of interfaces is in subelements directly under <interface>, and the
name of the guest-side interface (when configurable) is in <guest
dev='x'/>).
(This patch had been pushed earlier in
commit fe6a77898a38f491403a70cc49925a584101daee, but was reverted in
commit d658456530c1010a49f45865613ed361a0fcc5b4 because it had been
accidentally pushed during the freeze for release 2.0.0)
2016-06-09 19:35:08 +00:00
|
|
|
virNetDevIPInfo hostIP;
|
2014-06-27 08:41:22 +00:00
|
|
|
char *ifname_guest_actual;
|
2016-06-07 15:39:34 +00:00
|
|
|
char *ifname_guest;
|
|
|
|
virNetDevIPInfo guestIP;
|
2009-11-30 18:35:58 +00:00
|
|
|
virDomainDeviceInfo info;
|
2010-03-25 17:46:07 +00:00
|
|
|
char *filter;
|
2020-10-22 17:04:18 +00:00
|
|
|
GHashTable *filterparams;
|
Adjust naming of network device bandwidth management APIs
Rename virBandwidth to virNetDevBandwidth, and virRate to
virNetDevBandwidthRate.
* src/util/network.c, src/util/network.h: Rename bandwidth
structs and APIs
* src/conf/domain_conf.c, src/conf/domain_conf.h,
src/conf/network_conf.c, src/conf/network_conf.h,
src/lxc/lxc_driver.c, src/network/bridge_driver.c,
src/qemu/qemu_command.c, src/util/macvtap.c,
src/util/macvtap.h, tools/virsh.c: Update for API changes.
2011-11-02 14:29:05 +00:00
|
|
|
virNetDevBandwidthPtr bandwidth;
|
2012-08-12 07:51:30 +00:00
|
|
|
virNetDevVlan vlan;
|
2014-09-23 18:19:08 +00:00
|
|
|
int trustGuestRxFilters; /* enum virTristateBool */
|
2020-01-29 15:29:21 +00:00
|
|
|
virTristateBool isolatedPort;
|
2011-09-06 08:08:15 +00:00
|
|
|
int linkstate;
|
2017-01-23 13:32:13 +00:00
|
|
|
unsigned int mtu;
|
2017-04-07 15:46:32 +00:00
|
|
|
virNetDevCoalescePtr coalesce;
|
2017-05-24 14:44:44 +00:00
|
|
|
virDomainVirtioOptionsPtr virtio;
|
2019-08-08 14:55:01 +00:00
|
|
|
virObjectPtr privateData;
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
2014-10-29 15:03:53 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_CHR_DEVICE_STATE_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_CHR_DEVICE_STATE_CONNECTED,
|
|
|
|
VIR_DOMAIN_CHR_DEVICE_STATE_DISCONNECTED,
|
|
|
|
|
|
|
|
VIR_DOMAIN_CHR_DEVICE_STATE_LAST
|
|
|
|
} virDomainChrDeviceState;
|
|
|
|
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virDomainChrDeviceState);
|
2014-10-29 15:03:53 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2011-01-07 23:36:25 +00:00
|
|
|
VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL = 0,
|
2010-07-13 19:05:34 +00:00
|
|
|
VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL,
|
|
|
|
VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE,
|
2010-07-13 20:06:38 +00:00
|
|
|
VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL,
|
2009-11-05 13:19:14 +00:00
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_CHR_DEVICE_TYPE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainChrDeviceType;
|
2010-07-13 20:06:38 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2017-11-10 12:41:06 +00:00
|
|
|
VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE = 0,
|
|
|
|
VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA,
|
2013-01-05 05:25:36 +00:00
|
|
|
VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB,
|
2015-05-06 15:42:41 +00:00
|
|
|
VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI,
|
2017-11-08 14:31:21 +00:00
|
|
|
VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO,
|
2017-11-09 16:14:57 +00:00
|
|
|
VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM,
|
2017-11-14 15:27:04 +00:00
|
|
|
VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP,
|
2013-01-05 05:25:36 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainChrSerialTargetType;
|
2013-01-05 05:25:36 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2012-06-19 10:08:49 +00:00
|
|
|
VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_NONE = 0,
|
|
|
|
VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD,
|
2010-07-13 20:06:38 +00:00
|
|
|
VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO,
|
2016-09-26 17:33:15 +00:00
|
|
|
VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_XEN,
|
2010-07-13 20:06:38 +00:00
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainChrChannelTargetType;
|
2009-11-05 13:19:14 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2013-03-13 20:39:34 +00:00
|
|
|
VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_NONE = 0,
|
|
|
|
VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL,
|
2010-07-22 17:56:21 +00:00
|
|
|
VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_XEN,
|
|
|
|
VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_UML,
|
2010-07-14 17:02:04 +00:00
|
|
|
VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO,
|
Fix default console type setting
The default console type may vary based on the OS type. ie a Xen
paravirt guests wants a 'xen' console, while a fullvirt guests
wants a 'serial' console.
A plain integer default console type in the capabilities does
not suffice. Instead introduce a callback that is passed the
OS type.
* src/conf/capabilities.h: Use a callback for default console
type
* src/conf/domain_conf.c, src/conf/domain_conf.h: Use callback
for default console type. Add missing LXC/OpenVZ console types.
* src/esx/esx_driver.c, src/libxl/libxl_conf.c,
src/lxc/lxc_conf.c, src/openvz/openvz_conf.c,
src/phyp/phyp_driver.c, src/qemu/qemu_capabilities.c,
src/uml/uml_conf.c, src/vbox/vbox_tmpl.c,
src/vmware/vmware_conf.c, src/xen/xen_hypervisor.c,
src/xenapi/xenapi_driver.c: Set default console type callback
2011-10-20 13:56:20 +00:00
|
|
|
VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LXC,
|
|
|
|
VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_OPENVZ,
|
2013-01-07 17:17:14 +00:00
|
|
|
VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLP,
|
|
|
|
VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLPLM,
|
2010-07-22 17:56:21 +00:00
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainChrConsoleTargetType;
|
2010-07-22 17:56:21 +00:00
|
|
|
|
2017-11-20 11:05:17 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE = 0,
|
|
|
|
VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_SERIAL,
|
|
|
|
VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_USB_SERIAL,
|
|
|
|
VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PCI_SERIAL,
|
2017-11-08 14:31:21 +00:00
|
|
|
VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY,
|
2017-11-09 16:14:57 +00:00
|
|
|
VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011,
|
2017-11-14 15:27:04 +00:00
|
|
|
VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE,
|
|
|
|
VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE,
|
2018-08-27 08:25:17 +00:00
|
|
|
VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_16550A,
|
2017-11-20 11:05:17 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST
|
|
|
|
} virDomainChrSerialTargetModel;
|
|
|
|
|
|
|
|
VIR_ENUM_DECL(virDomainChrSerialTargetModel);
|
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_DOMAIN_CHR_TYPE_NULL,
|
|
|
|
VIR_DOMAIN_CHR_TYPE_VC,
|
|
|
|
VIR_DOMAIN_CHR_TYPE_PTY,
|
|
|
|
VIR_DOMAIN_CHR_TYPE_DEV,
|
|
|
|
VIR_DOMAIN_CHR_TYPE_FILE,
|
|
|
|
VIR_DOMAIN_CHR_TYPE_PIPE,
|
|
|
|
VIR_DOMAIN_CHR_TYPE_STDIO,
|
|
|
|
VIR_DOMAIN_CHR_TYPE_UDP,
|
|
|
|
VIR_DOMAIN_CHR_TYPE_TCP,
|
|
|
|
VIR_DOMAIN_CHR_TYPE_UNIX,
|
2011-02-03 04:09:44 +00:00
|
|
|
VIR_DOMAIN_CHR_TYPE_SPICEVMC,
|
2014-02-10 10:18:16 +00:00
|
|
|
VIR_DOMAIN_CHR_TYPE_SPICEPORT,
|
2014-03-15 12:30:01 +00:00
|
|
|
VIR_DOMAIN_CHR_TYPE_NMDM,
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_CHR_TYPE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainChrType;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2017-08-18 13:37:08 +00:00
|
|
|
VIR_DOMAIN_CHR_TCP_PROTOCOL_RAW = 0,
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_DOMAIN_CHR_TCP_PROTOCOL_TELNET,
|
2010-09-29 21:04:19 +00:00
|
|
|
VIR_DOMAIN_CHR_TCP_PROTOCOL_TELNETS, /* secure telnet */
|
|
|
|
VIR_DOMAIN_CHR_TCP_PROTOCOL_TLS,
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_CHR_TCP_PROTOCOL_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainChrTcpProtocol;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2011-02-04 02:23:31 +00:00
|
|
|
VIR_DOMAIN_CHR_SPICEVMC_VDAGENT,
|
|
|
|
VIR_DOMAIN_CHR_SPICEVMC_SMARTCARD,
|
2011-09-02 15:19:11 +00:00
|
|
|
VIR_DOMAIN_CHR_SPICEVMC_USBREDIR,
|
2011-02-04 02:23:31 +00:00
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_CHR_SPICEVMC_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainChrSpicevmcName;
|
2011-02-04 02:23:31 +00:00
|
|
|
|
2017-08-23 15:08:07 +00:00
|
|
|
|
|
|
|
struct _virDomainChrSourceReconnectDef {
|
|
|
|
virTristateBool enabled;
|
|
|
|
unsigned int timeout;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
domain_conf: split source data out from ChrDef
This opens up the possibility of reusing the smaller ChrSourceDef
for both qemu monitor and a passthrough smartcard device.
* src/conf/domain_conf.h (_virDomainChrDef): Factor host
details...
(_virDomainChrSourceDef): ...into new struct.
(virDomainChrSourceDefFree): New prototype.
* src/conf/domain_conf.c (virDomainChrDefFree)
(virDomainChrDefParseXML, virDomainChrDefFormat): Split...
(virDomainChrSourceDefClear, virDomainChrSourceDefFree)
(virDomainChrSourceDefParseXML, virDomainChrSourceDefFormat):
...into new functions.
(virDomainChrDefParseTargetXML): Update clients to reflect type
split.
* src/vmx/vmx.c (virVMXParseSerial, virVMXParseParallel)
(virVMXFormatSerial, virVMXFormatParallel): Likewise.
* src/xen/xen_driver.c (xenUnifiedDomainOpenConsole): Likewise.
* src/xen/xend_internal.c (xenDaemonParseSxprChar)
(xenDaemonFormatSxprChr): Likewise.
* src/vbox/vbox_tmpl.c (vboxDomainDumpXML, vboxAttachSerial)
(vboxAttachParallel): Likewise.
* src/security/security_dac.c (virSecurityDACSetChardevLabel)
(virSecurityDACSetChardevCallback)
(virSecurityDACRestoreChardevLabel)
(virSecurityDACRestoreChardevCallback): Likewise.
* src/security/security_selinux.c (SELinuxSetSecurityChardevLabel)
(SELinuxSetSecurityChardevCallback)
(SELinuxRestoreSecurityChardevLabel)
(SELinuxSetSecurityChardevCallback): Likewise.
* src/security/virt-aa-helper.c (get_files): Likewise.
* src/lxc/lxc_driver.c (lxcVmStart, lxcDomainOpenConsole):
Likewise.
* src/uml/uml_conf.c (umlBuildCommandLineChr): Likewise.
* src/uml/uml_driver.c (umlIdentifyOneChrPTY, umlIdentifyChrPTY)
(umlDomainOpenConsole): Likewise.
* src/qemu/qemu_command.c (qemuBuildChrChardevStr)
(qemuBuildChrArgStr, qemuBuildCommandLine)
(qemuParseCommandLineChr): Likewise.
* src/qemu/qemu_domain.c (qemuDomainObjPrivateXMLFormat)
(qemuDomainObjPrivateXMLParse): Likewise.
* src/qemu/qemu_cgroup.c (qemuSetupChardevCgroup): Likewise.
* src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
* src/qemu/qemu_driver.c (qemudFindCharDevicePTYsMonitor)
(qemudFindCharDevicePTYs, qemuPrepareChardevDevice)
(qemuPrepareMonitorChr, qemudShutdownVMDaemon)
(qemuDomainOpenConsole): Likewise.
* src/qemu/qemu_command.h (qemuBuildChrChardevStr)
(qemuBuildChrArgStr): Delete, now that they are static.
* src/libvirt_private.syms (domain_conf.h): New exports.
* cfg.mk (useless_free_options): Update list.
* tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Update
tests.
2011-01-07 22:45:01 +00:00
|
|
|
/* The host side information for a character device. */
|
|
|
|
struct _virDomainChrSourceDef {
|
2018-04-12 07:10:33 +00:00
|
|
|
virObject parent;
|
domain_conf: split source data out from ChrDef
This opens up the possibility of reusing the smaller ChrSourceDef
for both qemu monitor and a passthrough smartcard device.
* src/conf/domain_conf.h (_virDomainChrDef): Factor host
details...
(_virDomainChrSourceDef): ...into new struct.
(virDomainChrSourceDefFree): New prototype.
* src/conf/domain_conf.c (virDomainChrDefFree)
(virDomainChrDefParseXML, virDomainChrDefFormat): Split...
(virDomainChrSourceDefClear, virDomainChrSourceDefFree)
(virDomainChrSourceDefParseXML, virDomainChrSourceDefFormat):
...into new functions.
(virDomainChrDefParseTargetXML): Update clients to reflect type
split.
* src/vmx/vmx.c (virVMXParseSerial, virVMXParseParallel)
(virVMXFormatSerial, virVMXFormatParallel): Likewise.
* src/xen/xen_driver.c (xenUnifiedDomainOpenConsole): Likewise.
* src/xen/xend_internal.c (xenDaemonParseSxprChar)
(xenDaemonFormatSxprChr): Likewise.
* src/vbox/vbox_tmpl.c (vboxDomainDumpXML, vboxAttachSerial)
(vboxAttachParallel): Likewise.
* src/security/security_dac.c (virSecurityDACSetChardevLabel)
(virSecurityDACSetChardevCallback)
(virSecurityDACRestoreChardevLabel)
(virSecurityDACRestoreChardevCallback): Likewise.
* src/security/security_selinux.c (SELinuxSetSecurityChardevLabel)
(SELinuxSetSecurityChardevCallback)
(SELinuxRestoreSecurityChardevLabel)
(SELinuxSetSecurityChardevCallback): Likewise.
* src/security/virt-aa-helper.c (get_files): Likewise.
* src/lxc/lxc_driver.c (lxcVmStart, lxcDomainOpenConsole):
Likewise.
* src/uml/uml_conf.c (umlBuildCommandLineChr): Likewise.
* src/uml/uml_driver.c (umlIdentifyOneChrPTY, umlIdentifyChrPTY)
(umlDomainOpenConsole): Likewise.
* src/qemu/qemu_command.c (qemuBuildChrChardevStr)
(qemuBuildChrArgStr, qemuBuildCommandLine)
(qemuParseCommandLineChr): Likewise.
* src/qemu/qemu_domain.c (qemuDomainObjPrivateXMLFormat)
(qemuDomainObjPrivateXMLParse): Likewise.
* src/qemu/qemu_cgroup.c (qemuSetupChardevCgroup): Likewise.
* src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
* src/qemu/qemu_driver.c (qemudFindCharDevicePTYsMonitor)
(qemudFindCharDevicePTYs, qemuPrepareChardevDevice)
(qemuPrepareMonitorChr, qemudShutdownVMDaemon)
(qemuDomainOpenConsole): Likewise.
* src/qemu/qemu_command.h (qemuBuildChrChardevStr)
(qemuBuildChrArgStr): Delete, now that they are static.
* src/libvirt_private.syms (domain_conf.h): New exports.
* cfg.mk (useless_free_options): Update list.
* tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Update
tests.
2011-01-07 22:45:01 +00:00
|
|
|
int type; /* virDomainChrType */
|
2016-10-21 12:31:37 +00:00
|
|
|
virObjectPtr privateData;
|
2008-07-11 16:23:36 +00:00
|
|
|
union {
|
2011-02-04 02:23:31 +00:00
|
|
|
/* no <source> for null, vc, stdio */
|
2008-07-11 16:23:36 +00:00
|
|
|
struct {
|
|
|
|
char *path;
|
2015-12-24 14:27:54 +00:00
|
|
|
int append; /* enum virTristateSwitch */
|
2008-07-11 16:23:36 +00:00
|
|
|
} file; /* pty, file, pipe, or device */
|
2014-03-15 12:30:01 +00:00
|
|
|
struct {
|
|
|
|
char *master;
|
|
|
|
char *slave;
|
|
|
|
} nmdm;
|
2008-07-11 16:23:36 +00:00
|
|
|
struct {
|
|
|
|
char *host;
|
|
|
|
char *service;
|
domain_conf: split source data out from ChrDef
This opens up the possibility of reusing the smaller ChrSourceDef
for both qemu monitor and a passthrough smartcard device.
* src/conf/domain_conf.h (_virDomainChrDef): Factor host
details...
(_virDomainChrSourceDef): ...into new struct.
(virDomainChrSourceDefFree): New prototype.
* src/conf/domain_conf.c (virDomainChrDefFree)
(virDomainChrDefParseXML, virDomainChrDefFormat): Split...
(virDomainChrSourceDefClear, virDomainChrSourceDefFree)
(virDomainChrSourceDefParseXML, virDomainChrSourceDefFormat):
...into new functions.
(virDomainChrDefParseTargetXML): Update clients to reflect type
split.
* src/vmx/vmx.c (virVMXParseSerial, virVMXParseParallel)
(virVMXFormatSerial, virVMXFormatParallel): Likewise.
* src/xen/xen_driver.c (xenUnifiedDomainOpenConsole): Likewise.
* src/xen/xend_internal.c (xenDaemonParseSxprChar)
(xenDaemonFormatSxprChr): Likewise.
* src/vbox/vbox_tmpl.c (vboxDomainDumpXML, vboxAttachSerial)
(vboxAttachParallel): Likewise.
* src/security/security_dac.c (virSecurityDACSetChardevLabel)
(virSecurityDACSetChardevCallback)
(virSecurityDACRestoreChardevLabel)
(virSecurityDACRestoreChardevCallback): Likewise.
* src/security/security_selinux.c (SELinuxSetSecurityChardevLabel)
(SELinuxSetSecurityChardevCallback)
(SELinuxRestoreSecurityChardevLabel)
(SELinuxSetSecurityChardevCallback): Likewise.
* src/security/virt-aa-helper.c (get_files): Likewise.
* src/lxc/lxc_driver.c (lxcVmStart, lxcDomainOpenConsole):
Likewise.
* src/uml/uml_conf.c (umlBuildCommandLineChr): Likewise.
* src/uml/uml_driver.c (umlIdentifyOneChrPTY, umlIdentifyChrPTY)
(umlDomainOpenConsole): Likewise.
* src/qemu/qemu_command.c (qemuBuildChrChardevStr)
(qemuBuildChrArgStr, qemuBuildCommandLine)
(qemuParseCommandLineChr): Likewise.
* src/qemu/qemu_domain.c (qemuDomainObjPrivateXMLFormat)
(qemuDomainObjPrivateXMLParse): Likewise.
* src/qemu/qemu_cgroup.c (qemuSetupChardevCgroup): Likewise.
* src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
* src/qemu/qemu_driver.c (qemudFindCharDevicePTYsMonitor)
(qemudFindCharDevicePTYs, qemuPrepareChardevDevice)
(qemuPrepareMonitorChr, qemudShutdownVMDaemon)
(qemuDomainOpenConsole): Likewise.
* src/qemu/qemu_command.h (qemuBuildChrChardevStr)
(qemuBuildChrArgStr): Delete, now that they are static.
* src/libvirt_private.syms (domain_conf.h): New exports.
* cfg.mk (useless_free_options): Update list.
* tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Update
tests.
2011-01-07 22:45:01 +00:00
|
|
|
bool listen;
|
2008-07-11 16:23:36 +00:00
|
|
|
int protocol;
|
2016-06-13 16:30:34 +00:00
|
|
|
bool tlscreds;
|
2016-10-24 12:05:54 +00:00
|
|
|
int haveTLS; /* enum virTristateBool */
|
2016-10-21 14:42:26 +00:00
|
|
|
bool tlsFromConfig;
|
2017-08-23 15:08:07 +00:00
|
|
|
virDomainChrSourceReconnectDef reconnect;
|
2008-07-11 16:23:36 +00:00
|
|
|
} tcp;
|
|
|
|
struct {
|
|
|
|
char *bindHost;
|
|
|
|
char *bindService;
|
|
|
|
char *connectHost;
|
|
|
|
char *connectService;
|
|
|
|
} udp;
|
|
|
|
struct {
|
|
|
|
char *path;
|
domain_conf: split source data out from ChrDef
This opens up the possibility of reusing the smaller ChrSourceDef
for both qemu monitor and a passthrough smartcard device.
* src/conf/domain_conf.h (_virDomainChrDef): Factor host
details...
(_virDomainChrSourceDef): ...into new struct.
(virDomainChrSourceDefFree): New prototype.
* src/conf/domain_conf.c (virDomainChrDefFree)
(virDomainChrDefParseXML, virDomainChrDefFormat): Split...
(virDomainChrSourceDefClear, virDomainChrSourceDefFree)
(virDomainChrSourceDefParseXML, virDomainChrSourceDefFormat):
...into new functions.
(virDomainChrDefParseTargetXML): Update clients to reflect type
split.
* src/vmx/vmx.c (virVMXParseSerial, virVMXParseParallel)
(virVMXFormatSerial, virVMXFormatParallel): Likewise.
* src/xen/xen_driver.c (xenUnifiedDomainOpenConsole): Likewise.
* src/xen/xend_internal.c (xenDaemonParseSxprChar)
(xenDaemonFormatSxprChr): Likewise.
* src/vbox/vbox_tmpl.c (vboxDomainDumpXML, vboxAttachSerial)
(vboxAttachParallel): Likewise.
* src/security/security_dac.c (virSecurityDACSetChardevLabel)
(virSecurityDACSetChardevCallback)
(virSecurityDACRestoreChardevLabel)
(virSecurityDACRestoreChardevCallback): Likewise.
* src/security/security_selinux.c (SELinuxSetSecurityChardevLabel)
(SELinuxSetSecurityChardevCallback)
(SELinuxRestoreSecurityChardevLabel)
(SELinuxSetSecurityChardevCallback): Likewise.
* src/security/virt-aa-helper.c (get_files): Likewise.
* src/lxc/lxc_driver.c (lxcVmStart, lxcDomainOpenConsole):
Likewise.
* src/uml/uml_conf.c (umlBuildCommandLineChr): Likewise.
* src/uml/uml_driver.c (umlIdentifyOneChrPTY, umlIdentifyChrPTY)
(umlDomainOpenConsole): Likewise.
* src/qemu/qemu_command.c (qemuBuildChrChardevStr)
(qemuBuildChrArgStr, qemuBuildCommandLine)
(qemuParseCommandLineChr): Likewise.
* src/qemu/qemu_domain.c (qemuDomainObjPrivateXMLFormat)
(qemuDomainObjPrivateXMLParse): Likewise.
* src/qemu/qemu_cgroup.c (qemuSetupChardevCgroup): Likewise.
* src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
* src/qemu/qemu_driver.c (qemudFindCharDevicePTYsMonitor)
(qemudFindCharDevicePTYs, qemuPrepareChardevDevice)
(qemuPrepareMonitorChr, qemudShutdownVMDaemon)
(qemuDomainOpenConsole): Likewise.
* src/qemu/qemu_command.h (qemuBuildChrChardevStr)
(qemuBuildChrArgStr): Delete, now that they are static.
* src/libvirt_private.syms (domain_conf.h): New exports.
* cfg.mk (useless_free_options): Update list.
* tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Update
tests.
2011-01-07 22:45:01 +00:00
|
|
|
bool listen;
|
2017-08-23 15:08:07 +00:00
|
|
|
virDomainChrSourceReconnectDef reconnect;
|
2008-07-11 16:23:36 +00:00
|
|
|
} nix;
|
2011-02-04 02:23:31 +00:00
|
|
|
int spicevmc;
|
2014-02-10 10:18:16 +00:00
|
|
|
struct {
|
|
|
|
char *channel;
|
|
|
|
} spiceport;
|
2008-07-11 16:23:36 +00:00
|
|
|
} data;
|
2015-12-11 16:58:13 +00:00
|
|
|
char *logfile;
|
|
|
|
int logappend;
|
2017-05-26 15:53:09 +00:00
|
|
|
|
|
|
|
size_t nseclabels;
|
|
|
|
virSecurityDeviceLabelDefPtr *seclabels;
|
domain_conf: split source data out from ChrDef
This opens up the possibility of reusing the smaller ChrSourceDef
for both qemu monitor and a passthrough smartcard device.
* src/conf/domain_conf.h (_virDomainChrDef): Factor host
details...
(_virDomainChrSourceDef): ...into new struct.
(virDomainChrSourceDefFree): New prototype.
* src/conf/domain_conf.c (virDomainChrDefFree)
(virDomainChrDefParseXML, virDomainChrDefFormat): Split...
(virDomainChrSourceDefClear, virDomainChrSourceDefFree)
(virDomainChrSourceDefParseXML, virDomainChrSourceDefFormat):
...into new functions.
(virDomainChrDefParseTargetXML): Update clients to reflect type
split.
* src/vmx/vmx.c (virVMXParseSerial, virVMXParseParallel)
(virVMXFormatSerial, virVMXFormatParallel): Likewise.
* src/xen/xen_driver.c (xenUnifiedDomainOpenConsole): Likewise.
* src/xen/xend_internal.c (xenDaemonParseSxprChar)
(xenDaemonFormatSxprChr): Likewise.
* src/vbox/vbox_tmpl.c (vboxDomainDumpXML, vboxAttachSerial)
(vboxAttachParallel): Likewise.
* src/security/security_dac.c (virSecurityDACSetChardevLabel)
(virSecurityDACSetChardevCallback)
(virSecurityDACRestoreChardevLabel)
(virSecurityDACRestoreChardevCallback): Likewise.
* src/security/security_selinux.c (SELinuxSetSecurityChardevLabel)
(SELinuxSetSecurityChardevCallback)
(SELinuxRestoreSecurityChardevLabel)
(SELinuxSetSecurityChardevCallback): Likewise.
* src/security/virt-aa-helper.c (get_files): Likewise.
* src/lxc/lxc_driver.c (lxcVmStart, lxcDomainOpenConsole):
Likewise.
* src/uml/uml_conf.c (umlBuildCommandLineChr): Likewise.
* src/uml/uml_driver.c (umlIdentifyOneChrPTY, umlIdentifyChrPTY)
(umlDomainOpenConsole): Likewise.
* src/qemu/qemu_command.c (qemuBuildChrChardevStr)
(qemuBuildChrArgStr, qemuBuildCommandLine)
(qemuParseCommandLineChr): Likewise.
* src/qemu/qemu_domain.c (qemuDomainObjPrivateXMLFormat)
(qemuDomainObjPrivateXMLParse): Likewise.
* src/qemu/qemu_cgroup.c (qemuSetupChardevCgroup): Likewise.
* src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
* src/qemu/qemu_driver.c (qemudFindCharDevicePTYsMonitor)
(qemudFindCharDevicePTYs, qemuPrepareChardevDevice)
(qemuPrepareMonitorChr, qemudShutdownVMDaemon)
(qemuDomainOpenConsole): Likewise.
* src/qemu/qemu_command.h (qemuBuildChrChardevStr)
(qemuBuildChrArgStr): Delete, now that they are static.
* src/libvirt_private.syms (domain_conf.h): New exports.
* cfg.mk (useless_free_options): Update list.
* tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Update
tests.
2011-01-07 22:45:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* A complete character device, both host and domain views. */
|
|
|
|
struct _virDomainChrDef {
|
2014-10-29 12:03:57 +00:00
|
|
|
int deviceType; /* enum virDomainChrDeviceType */
|
2013-01-05 05:25:36 +00:00
|
|
|
|
2014-10-29 12:03:57 +00:00
|
|
|
int targetType; /* enum virDomainChrConsoleTargetType ||
|
|
|
|
enum virDomainChrChannelTargetType ||
|
|
|
|
enum virDomainChrSerialTargetType according to deviceType */
|
2017-11-20 11:05:17 +00:00
|
|
|
int targetModel; /* enum virDomainChrSerialTargetModel */
|
2014-10-29 12:03:57 +00:00
|
|
|
|
domain_conf: split source data out from ChrDef
This opens up the possibility of reusing the smaller ChrSourceDef
for both qemu monitor and a passthrough smartcard device.
* src/conf/domain_conf.h (_virDomainChrDef): Factor host
details...
(_virDomainChrSourceDef): ...into new struct.
(virDomainChrSourceDefFree): New prototype.
* src/conf/domain_conf.c (virDomainChrDefFree)
(virDomainChrDefParseXML, virDomainChrDefFormat): Split...
(virDomainChrSourceDefClear, virDomainChrSourceDefFree)
(virDomainChrSourceDefParseXML, virDomainChrSourceDefFormat):
...into new functions.
(virDomainChrDefParseTargetXML): Update clients to reflect type
split.
* src/vmx/vmx.c (virVMXParseSerial, virVMXParseParallel)
(virVMXFormatSerial, virVMXFormatParallel): Likewise.
* src/xen/xen_driver.c (xenUnifiedDomainOpenConsole): Likewise.
* src/xen/xend_internal.c (xenDaemonParseSxprChar)
(xenDaemonFormatSxprChr): Likewise.
* src/vbox/vbox_tmpl.c (vboxDomainDumpXML, vboxAttachSerial)
(vboxAttachParallel): Likewise.
* src/security/security_dac.c (virSecurityDACSetChardevLabel)
(virSecurityDACSetChardevCallback)
(virSecurityDACRestoreChardevLabel)
(virSecurityDACRestoreChardevCallback): Likewise.
* src/security/security_selinux.c (SELinuxSetSecurityChardevLabel)
(SELinuxSetSecurityChardevCallback)
(SELinuxRestoreSecurityChardevLabel)
(SELinuxSetSecurityChardevCallback): Likewise.
* src/security/virt-aa-helper.c (get_files): Likewise.
* src/lxc/lxc_driver.c (lxcVmStart, lxcDomainOpenConsole):
Likewise.
* src/uml/uml_conf.c (umlBuildCommandLineChr): Likewise.
* src/uml/uml_driver.c (umlIdentifyOneChrPTY, umlIdentifyChrPTY)
(umlDomainOpenConsole): Likewise.
* src/qemu/qemu_command.c (qemuBuildChrChardevStr)
(qemuBuildChrArgStr, qemuBuildCommandLine)
(qemuParseCommandLineChr): Likewise.
* src/qemu/qemu_domain.c (qemuDomainObjPrivateXMLFormat)
(qemuDomainObjPrivateXMLParse): Likewise.
* src/qemu/qemu_cgroup.c (qemuSetupChardevCgroup): Likewise.
* src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
* src/qemu/qemu_driver.c (qemudFindCharDevicePTYsMonitor)
(qemudFindCharDevicePTYs, qemuPrepareChardevDevice)
(qemuPrepareMonitorChr, qemudShutdownVMDaemon)
(qemuDomainOpenConsole): Likewise.
* src/qemu/qemu_command.h (qemuBuildChrChardevStr)
(qemuBuildChrArgStr): Delete, now that they are static.
* src/libvirt_private.syms (domain_conf.h): New exports.
* cfg.mk (useless_free_options): Update list.
* tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Update
tests.
2011-01-07 22:45:01 +00:00
|
|
|
union {
|
|
|
|
int port; /* parallel, serial, console */
|
|
|
|
virSocketAddrPtr addr; /* guestfwd */
|
|
|
|
char *name; /* virtio */
|
|
|
|
} target;
|
|
|
|
|
2014-10-29 15:03:53 +00:00
|
|
|
virDomainChrDeviceState state;
|
|
|
|
|
2016-10-21 11:45:54 +00:00
|
|
|
virDomainChrSourceDefPtr source;
|
Add device info to serial, parallel, channel, input & fs devices
Although the serial, parallel, chanel, input & fs devices do
not have PCI address info, they can all have device aliases.
Thus it neccessary to associate the virDomainDeviceInfo data
with them all.
* src/conf/domain_conf.c, src/conf/domain_conf.h: Add hooks for
parsing / formatting device info for serial, parallel, channel
input and fs devices.
* docs/schemas/domain.rng: Associate device info with character
devices, input & fs device
2010-01-06 12:39:53 +00:00
|
|
|
|
|
|
|
virDomainDeviceInfo info;
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2011-01-10 16:41:33 +00:00
|
|
|
VIR_DOMAIN_SMARTCARD_TYPE_HOST,
|
|
|
|
VIR_DOMAIN_SMARTCARD_TYPE_HOST_CERTIFICATES,
|
|
|
|
VIR_DOMAIN_SMARTCARD_TYPE_PASSTHROUGH,
|
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_SMARTCARD_TYPE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainSmartcardType;
|
2011-01-10 16:41:33 +00:00
|
|
|
|
2019-06-07 20:20:16 +00:00
|
|
|
#define VIR_DOMAIN_SMARTCARD_NUM_CERTIFICATES 3
|
|
|
|
#define VIR_DOMAIN_SMARTCARD_DEFAULT_DATABASE "/etc/pki/nssdb"
|
2011-01-10 16:41:33 +00:00
|
|
|
|
|
|
|
struct _virDomainSmartcardDef {
|
|
|
|
int type; /* virDomainSmartcardType */
|
|
|
|
union {
|
|
|
|
/* no extra data for 'host' */
|
|
|
|
struct {
|
|
|
|
char *file[VIR_DOMAIN_SMARTCARD_NUM_CERTIFICATES];
|
|
|
|
char *database;
|
|
|
|
} cert; /* 'host-certificates' */
|
2016-10-21 22:08:02 +00:00
|
|
|
virDomainChrSourceDefPtr passthru; /* 'passthrough' */
|
2011-01-10 16:41:33 +00:00
|
|
|
} data;
|
|
|
|
|
|
|
|
virDomainDeviceInfo info;
|
|
|
|
};
|
|
|
|
|
2011-09-02 14:20:40 +00:00
|
|
|
struct _virDomainHubDef {
|
|
|
|
int type;
|
|
|
|
virDomainDeviceInfo info;
|
|
|
|
};
|
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2020-02-05 18:35:45 +00:00
|
|
|
VIR_DOMAIN_TPM_MODEL_DEFAULT,
|
2013-04-12 20:55:45 +00:00
|
|
|
VIR_DOMAIN_TPM_MODEL_TIS,
|
2018-04-26 17:42:16 +00:00
|
|
|
VIR_DOMAIN_TPM_MODEL_CRB,
|
2020-02-05 18:35:46 +00:00
|
|
|
VIR_DOMAIN_TPM_MODEL_SPAPR,
|
2020-06-10 18:11:47 +00:00
|
|
|
VIR_DOMAIN_TPM_MODEL_SPAPR_PROXY,
|
2013-04-12 20:55:45 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_TPM_MODEL_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainTPMModel;
|
2013-04-12 20:55:45 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2013-04-12 20:55:45 +00:00
|
|
|
VIR_DOMAIN_TPM_TYPE_PASSTHROUGH,
|
2017-04-04 16:22:31 +00:00
|
|
|
VIR_DOMAIN_TPM_TYPE_EMULATOR,
|
2013-04-12 20:55:45 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_TPM_TYPE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainTPMBackendType;
|
2013-04-12 20:55:45 +00:00
|
|
|
|
2018-04-04 18:40:17 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_TPM_VERSION_DEFAULT,
|
|
|
|
VIR_DOMAIN_TPM_VERSION_1_2,
|
|
|
|
VIR_DOMAIN_TPM_VERSION_2_0,
|
|
|
|
|
|
|
|
VIR_DOMAIN_TPM_VERSION_LAST
|
|
|
|
} virDomainTPMVersion;
|
|
|
|
|
2019-06-07 20:20:16 +00:00
|
|
|
#define VIR_DOMAIN_TPM_DEFAULT_DEVICE "/dev/tpm0"
|
2013-04-12 20:55:45 +00:00
|
|
|
|
|
|
|
struct _virDomainTPMDef {
|
2018-06-06 16:37:49 +00:00
|
|
|
int type; /* virDomainTPMBackendType */
|
2013-04-12 20:55:45 +00:00
|
|
|
virDomainDeviceInfo info;
|
2018-06-06 16:37:49 +00:00
|
|
|
int model; /* virDomainTPMModel */
|
|
|
|
int version; /* virDomainTPMVersion */
|
2013-04-12 20:55:45 +00:00
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
virDomainChrSourceDef source;
|
|
|
|
} passthrough;
|
2017-04-04 16:22:31 +00:00
|
|
|
struct {
|
|
|
|
virDomainChrSourceDef source;
|
|
|
|
char *storagepath;
|
|
|
|
char *logfile;
|
2019-07-25 18:21:59 +00:00
|
|
|
unsigned char secretuuid[VIR_UUID_BUFLEN];
|
|
|
|
bool hassecretuuid;
|
2021-01-04 02:31:59 +00:00
|
|
|
bool persistent_state;
|
2017-04-04 16:22:31 +00:00
|
|
|
} emulator;
|
2013-04-12 20:55:45 +00:00
|
|
|
} data;
|
|
|
|
};
|
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_DOMAIN_INPUT_TYPE_MOUSE,
|
|
|
|
VIR_DOMAIN_INPUT_TYPE_TABLET,
|
2014-02-17 10:17:53 +00:00
|
|
|
VIR_DOMAIN_INPUT_TYPE_KBD,
|
2015-11-16 08:36:12 +00:00
|
|
|
VIR_DOMAIN_INPUT_TYPE_PASSTHROUGH,
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_INPUT_TYPE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainInputType;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_DOMAIN_INPUT_BUS_PS2,
|
|
|
|
VIR_DOMAIN_INPUT_BUS_USB,
|
|
|
|
VIR_DOMAIN_INPUT_BUS_XEN,
|
2015-04-07 20:35:09 +00:00
|
|
|
VIR_DOMAIN_INPUT_BUS_PARALLELS, /* pseudo device for VNC in containers */
|
2015-11-13 10:37:12 +00:00
|
|
|
VIR_DOMAIN_INPUT_BUS_VIRTIO,
|
2008-07-11 16:23:36 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_INPUT_BUS_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainInputBus;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2019-01-17 17:52:41 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_INPUT_MODEL_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_INPUT_MODEL_VIRTIO,
|
|
|
|
VIR_DOMAIN_INPUT_MODEL_VIRTIO_TRANSITIONAL,
|
|
|
|
VIR_DOMAIN_INPUT_MODEL_VIRTIO_NON_TRANSITIONAL,
|
|
|
|
|
|
|
|
VIR_DOMAIN_INPUT_MODEL_LAST
|
|
|
|
} virDomainInputModel;
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
struct _virDomainInputDef {
|
|
|
|
int type;
|
|
|
|
int bus;
|
2019-01-17 17:52:41 +00:00
|
|
|
int model; /* virDomainInputModel */
|
2015-11-16 08:36:12 +00:00
|
|
|
struct {
|
|
|
|
char *evdev;
|
|
|
|
} source;
|
Add device info to serial, parallel, channel, input & fs devices
Although the serial, parallel, chanel, input & fs devices do
not have PCI address info, they can all have device aliases.
Thus it neccessary to associate the virDomainDeviceInfo data
with them all.
* src/conf/domain_conf.c, src/conf/domain_conf.h: Add hooks for
parsing / formatting device info for serial, parallel, channel
input and fs devices.
* docs/schemas/domain.rng: Associate device info with character
devices, input & fs device
2010-01-06 12:39:53 +00:00
|
|
|
virDomainDeviceInfo info;
|
2016-08-08 13:42:18 +00:00
|
|
|
virDomainVirtioOptionsPtr virtio;
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2012-05-15 22:55:09 +00:00
|
|
|
VIR_DOMAIN_SOUND_CODEC_TYPE_DUPLEX,
|
|
|
|
VIR_DOMAIN_SOUND_CODEC_TYPE_MICRO,
|
2018-05-22 11:12:32 +00:00
|
|
|
VIR_DOMAIN_SOUND_CODEC_TYPE_OUTPUT,
|
2012-05-15 22:55:09 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_SOUND_CODEC_TYPE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainSoundCodecType;
|
2012-05-15 22:55:09 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_DOMAIN_SOUND_MODEL_SB16,
|
|
|
|
VIR_DOMAIN_SOUND_MODEL_ES1370,
|
|
|
|
VIR_DOMAIN_SOUND_MODEL_PCSPK,
|
2009-05-21 14:16:06 +00:00
|
|
|
VIR_DOMAIN_SOUND_MODEL_AC97,
|
2011-01-13 14:15:11 +00:00
|
|
|
VIR_DOMAIN_SOUND_MODEL_ICH6,
|
2013-09-24 14:17:38 +00:00
|
|
|
VIR_DOMAIN_SOUND_MODEL_ICH9,
|
2014-07-24 15:32:31 +00:00
|
|
|
VIR_DOMAIN_SOUND_MODEL_USB,
|
2020-08-06 14:40:37 +00:00
|
|
|
VIR_DOMAIN_SOUND_MODEL_ICH7,
|
2008-07-11 16:23:36 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_SOUND_MODEL_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainSoundModel;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2012-05-15 22:55:09 +00:00
|
|
|
struct _virDomainSoundCodecDef {
|
|
|
|
int type;
|
|
|
|
int cad;
|
|
|
|
};
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
struct _virDomainSoundDef {
|
|
|
|
int model;
|
2009-12-10 19:19:08 +00:00
|
|
|
virDomainDeviceInfo info;
|
2012-05-15 22:55:09 +00:00
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t ncodecs;
|
2012-05-15 22:55:09 +00:00
|
|
|
virDomainSoundCodecDefPtr *codecs;
|
2020-07-18 06:23:57 +00:00
|
|
|
|
|
|
|
unsigned int audioId;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_AUDIO_TYPE_OSS,
|
|
|
|
|
|
|
|
VIR_DOMAIN_AUDIO_TYPE_LAST
|
|
|
|
} virDomainAudioType;
|
|
|
|
|
|
|
|
struct _virDomainAudioDef {
|
|
|
|
int type;
|
|
|
|
|
|
|
|
unsigned int id;
|
|
|
|
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
char *inputDev;
|
|
|
|
char *outputDev;
|
|
|
|
} oss;
|
|
|
|
} backend;
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2009-10-21 12:26:38 +00:00
|
|
|
VIR_DOMAIN_WATCHDOG_MODEL_I6300ESB,
|
|
|
|
VIR_DOMAIN_WATCHDOG_MODEL_IB700,
|
2015-06-24 09:28:43 +00:00
|
|
|
VIR_DOMAIN_WATCHDOG_MODEL_DIAG288,
|
2009-10-21 12:26:38 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_WATCHDOG_MODEL_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainWatchdogModel;
|
2009-10-21 12:26:38 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2009-10-21 12:26:38 +00:00
|
|
|
VIR_DOMAIN_WATCHDOG_ACTION_RESET,
|
|
|
|
VIR_DOMAIN_WATCHDOG_ACTION_SHUTDOWN,
|
|
|
|
VIR_DOMAIN_WATCHDOG_ACTION_POWEROFF,
|
|
|
|
VIR_DOMAIN_WATCHDOG_ACTION_PAUSE,
|
2010-12-08 06:19:17 +00:00
|
|
|
VIR_DOMAIN_WATCHDOG_ACTION_DUMP,
|
2009-10-21 12:26:38 +00:00
|
|
|
VIR_DOMAIN_WATCHDOG_ACTION_NONE,
|
2015-06-24 09:28:41 +00:00
|
|
|
VIR_DOMAIN_WATCHDOG_ACTION_INJECTNMI,
|
2009-10-21 12:26:38 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_WATCHDOG_ACTION_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainWatchdogAction;
|
2009-10-21 12:26:38 +00:00
|
|
|
|
|
|
|
struct _virDomainWatchdogDef {
|
|
|
|
int model;
|
|
|
|
int action;
|
2009-12-10 19:19:08 +00:00
|
|
|
virDomainDeviceInfo info;
|
2009-10-21 12:26:38 +00:00
|
|
|
};
|
|
|
|
|
2009-07-06 13:54:44 +00:00
|
|
|
|
2019-09-23 10:44:26 +00:00
|
|
|
/* the backend driver used for virtio interfaces */
|
|
|
|
typedef enum {
|
2019-09-25 07:54:49 +00:00
|
|
|
VIR_DOMAIN_VIDEO_BACKEND_TYPE_DEFAULT = 0,
|
2019-09-23 10:44:26 +00:00
|
|
|
VIR_DOMAIN_VIDEO_BACKEND_TYPE_QEMU,
|
|
|
|
VIR_DOMAIN_VIDEO_BACKEND_TYPE_VHOSTUSER,
|
|
|
|
|
|
|
|
VIR_DOMAIN_VIDEO_BACKEND_TYPE_LAST
|
|
|
|
} virDomainVideoBackendType;
|
|
|
|
|
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2017-08-27 15:04:39 +00:00
|
|
|
VIR_DOMAIN_VIDEO_TYPE_DEFAULT,
|
2009-07-06 13:54:44 +00:00
|
|
|
VIR_DOMAIN_VIDEO_TYPE_VGA,
|
|
|
|
VIR_DOMAIN_VIDEO_TYPE_CIRRUS,
|
|
|
|
VIR_DOMAIN_VIDEO_TYPE_VMVGA,
|
|
|
|
VIR_DOMAIN_VIDEO_TYPE_XEN,
|
|
|
|
VIR_DOMAIN_VIDEO_TYPE_VBOX,
|
2009-07-08 13:47:14 +00:00
|
|
|
VIR_DOMAIN_VIDEO_TYPE_QXL,
|
2015-04-07 20:35:07 +00:00
|
|
|
VIR_DOMAIN_VIDEO_TYPE_PARALLELS, /* pseudo device for VNC in containers */
|
2015-11-25 08:42:32 +00:00
|
|
|
VIR_DOMAIN_VIDEO_TYPE_VIRTIO,
|
2016-07-16 21:03:33 +00:00
|
|
|
VIR_DOMAIN_VIDEO_TYPE_GOP,
|
2018-05-21 12:29:26 +00:00
|
|
|
VIR_DOMAIN_VIDEO_TYPE_NONE,
|
2019-07-12 20:12:16 +00:00
|
|
|
VIR_DOMAIN_VIDEO_TYPE_BOCHS,
|
2019-09-13 21:20:29 +00:00
|
|
|
VIR_DOMAIN_VIDEO_TYPE_RAMFB,
|
2009-07-06 13:54:44 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_VIDEO_TYPE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainVideoType;
|
2009-07-06 13:54:44 +00:00
|
|
|
|
|
|
|
|
2017-05-09 10:48:30 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_VIDEO_VGACONF_IO = 0,
|
|
|
|
VIR_DOMAIN_VIDEO_VGACONF_ON,
|
|
|
|
VIR_DOMAIN_VIDEO_VGACONF_OFF,
|
|
|
|
|
|
|
|
VIR_DOMAIN_VIDEO_VGACONF_LAST
|
|
|
|
} virDomainVideoVGAConf;
|
|
|
|
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virDomainVideoVGAConf);
|
2017-05-09 10:48:30 +00:00
|
|
|
|
2009-09-03 08:26:41 +00:00
|
|
|
struct _virDomainVideoAccelDef {
|
2015-11-25 08:42:31 +00:00
|
|
|
int accel2d; /* enum virTristateBool */
|
|
|
|
int accel3d; /* enum virTristateBool */
|
2019-09-23 10:44:27 +00:00
|
|
|
char *rendernode;
|
2009-09-03 08:26:41 +00:00
|
|
|
};
|
|
|
|
|
2019-10-17 04:30:31 +00:00
|
|
|
struct _virDomainVideoResolutionDef {
|
|
|
|
unsigned int x;
|
|
|
|
unsigned int y;
|
|
|
|
};
|
2009-09-03 08:26:41 +00:00
|
|
|
|
2017-05-09 10:48:30 +00:00
|
|
|
struct _virDomainVideoDriverDef {
|
|
|
|
virDomainVideoVGAConf vgaconf;
|
2019-09-23 10:44:33 +00:00
|
|
|
char *vhost_user_binary;
|
2017-05-09 10:48:30 +00:00
|
|
|
};
|
|
|
|
|
2009-07-06 13:54:44 +00:00
|
|
|
struct _virDomainVideoDef {
|
2019-09-23 10:44:35 +00:00
|
|
|
virObjectPtr privateData;
|
|
|
|
|
2018-06-28 08:55:47 +00:00
|
|
|
int type; /* enum virDomainVideoType */
|
2013-01-18 18:36:36 +00:00
|
|
|
unsigned int ram; /* kibibytes (multiples of 1024) */
|
|
|
|
unsigned int vram; /* kibibytes (multiples of 1024) */
|
2016-02-23 16:04:19 +00:00
|
|
|
unsigned int vram64; /* kibibytes (multiples of 1024) */
|
2014-11-20 18:52:00 +00:00
|
|
|
unsigned int vgamem; /* kibibytes (multiples of 1024) */
|
2009-07-06 13:54:44 +00:00
|
|
|
unsigned int heads;
|
2012-12-17 06:01:20 +00:00
|
|
|
bool primary;
|
2009-09-03 08:26:41 +00:00
|
|
|
virDomainVideoAccelDefPtr accel;
|
2019-10-17 04:30:31 +00:00
|
|
|
virDomainVideoResolutionDefPtr res;
|
2017-05-09 10:48:30 +00:00
|
|
|
virDomainVideoDriverDefPtr driver;
|
2009-12-10 19:19:08 +00:00
|
|
|
virDomainDeviceInfo info;
|
2016-06-06 14:51:31 +00:00
|
|
|
virDomainVirtioOptionsPtr virtio;
|
2019-09-23 10:44:26 +00:00
|
|
|
virDomainVideoBackendType backend;
|
2009-07-06 13:54:44 +00:00
|
|
|
};
|
|
|
|
|
2013-04-22 13:13:46 +00:00
|
|
|
/* graphics console modes */
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_DOMAIN_GRAPHICS_TYPE_SDL,
|
|
|
|
VIR_DOMAIN_GRAPHICS_TYPE_VNC,
|
2009-05-15 09:43:51 +00:00
|
|
|
VIR_DOMAIN_GRAPHICS_TYPE_RDP,
|
|
|
|
VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP,
|
2009-08-14 09:54:14 +00:00
|
|
|
VIR_DOMAIN_GRAPHICS_TYPE_SPICE,
|
2018-06-30 14:23:01 +00:00
|
|
|
VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS,
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_GRAPHICS_TYPE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainGraphicsType;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2013-05-21 14:31:48 +00:00
|
|
|
VIR_DOMAIN_GRAPHICS_VNC_SHARE_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_GRAPHICS_VNC_SHARE_ALLOW_EXCLUSIVE,
|
|
|
|
VIR_DOMAIN_GRAPHICS_VNC_SHARE_FORCE_SHARED,
|
|
|
|
VIR_DOMAIN_GRAPHICS_VNC_SHARE_IGNORE,
|
|
|
|
|
|
|
|
VIR_DOMAIN_GRAPHICS_VNC_SHARE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainGraphicsVNCSharePolicy;
|
2013-05-21 14:31:48 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2011-05-26 14:15:54 +00:00
|
|
|
VIR_DOMAIN_GRAPHICS_AUTH_CONNECTED_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_GRAPHICS_AUTH_CONNECTED_FAIL,
|
|
|
|
VIR_DOMAIN_GRAPHICS_AUTH_CONNECTED_DISCONNECT,
|
|
|
|
VIR_DOMAIN_GRAPHICS_AUTH_CONNECTED_KEEP,
|
|
|
|
|
|
|
|
VIR_DOMAIN_GRAPHICS_AUTH_CONNECTED_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainGraphicsAuthConnectedType;
|
2011-05-26 14:15:54 +00:00
|
|
|
|
2010-04-08 12:43:23 +00:00
|
|
|
struct _virDomainGraphicsAuthDef {
|
|
|
|
char *passwd;
|
2013-04-10 10:54:17 +00:00
|
|
|
bool expires; /* Whether there is an expiry time set */
|
2010-04-08 12:43:23 +00:00
|
|
|
time_t validTo; /* seconds since epoch */
|
2011-05-26 14:15:54 +00:00
|
|
|
int connected; /* action if connected */
|
2010-04-08 12:43:23 +00:00
|
|
|
};
|
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2010-04-09 16:56:00 +00:00
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MAIN,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_DISPLAY,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_INPUT,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_CURSOR,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_PLAYBACK,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_RECORD,
|
2011-02-04 02:23:31 +00:00
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_SMARTCARD,
|
2012-05-08 13:00:28 +00:00
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_USBREDIR,
|
2010-04-09 16:56:00 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainGraphicsSpiceChannelName;
|
2010-04-09 16:56:00 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2010-04-09 16:56:00 +00:00
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_ANY,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_SECURE,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_INSECURE,
|
|
|
|
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainGraphicsSpiceChannelMode;
|
2010-04-08 12:43:23 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2011-04-14 08:44:20 +00:00
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_IMAGE_COMPRESSION_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_IMAGE_COMPRESSION_AUTO_GLZ,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_IMAGE_COMPRESSION_AUTO_LZ,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_IMAGE_COMPRESSION_QUIC,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_IMAGE_COMPRESSION_GLZ,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_IMAGE_COMPRESSION_LZ,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_IMAGE_COMPRESSION_OFF,
|
|
|
|
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_IMAGE_COMPRESSION_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainGraphicsSpiceImageCompression;
|
2011-04-14 08:44:20 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2011-04-14 08:44:20 +00:00
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_JPEG_COMPRESSION_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_JPEG_COMPRESSION_AUTO,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_JPEG_COMPRESSION_NEVER,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_JPEG_COMPRESSION_ALWAYS,
|
|
|
|
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_JPEG_COMPRESSION_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainGraphicsSpiceJpegCompression;
|
2011-04-14 08:44:20 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2011-04-14 08:44:20 +00:00
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_ZLIB_COMPRESSION_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_ZLIB_COMPRESSION_AUTO,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_ZLIB_COMPRESSION_NEVER,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_ZLIB_COMPRESSION_ALWAYS,
|
|
|
|
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_ZLIB_COMPRESSION_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainGraphicsSpiceZlibCompression;
|
2011-04-14 08:44:20 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2012-03-09 07:26:24 +00:00
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_SERVER,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_CLIENT,
|
|
|
|
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainGraphicsSpiceMouseMode;
|
2012-03-09 07:26:24 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2011-05-23 15:16:42 +00:00
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_STREAMING_MODE_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_STREAMING_MODE_FILTER,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_STREAMING_MODE_ALL,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_STREAMING_MODE_OFF,
|
|
|
|
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_STREAMING_MODE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainGraphicsSpiceStreamingMode;
|
2011-05-23 15:16:42 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
conf: add <listen> subelement to domain <graphics> element
Once it's plugged in, the <listen> element will be an optional
replacement for the "listen" attribute that graphics elements already
have. If the <listen> element is type='address', it will have an
attribute called 'address' which will contain an IP address or dns
name that the guest's display server should listen on. If, however,
type='network', the <listen> element should have an attribute called
'network' that will be set to the name of a network configuration to
get the IP address from.
* docs/schemas/domain.rng: updated to allow the <listen> element
* docs/formatdomain.html.in: document the <listen> element and its
attributes.
* src/conf/domain_conf.[hc]:
1) The domain parser, formatter, and data structure are modified to
support 0 or more <listen> subelements to each <graphics>
element. The old style "legacy" listen attribute is also still
accepted, and will be stored internally just as if it were a
separate <listen> element. On output (i.e. format), the address
attribute of the first <listen> element of type 'address' will be
duplicated in the legacy "listen" attribute of the <graphic>
element.
2) The "listenAddr" attribute has been removed from the unions in
virDomainGRaphicsDef for graphics types vnc, rdp, and spice.
This attribute is now in the <listen> subelement (aka
virDomainGraphicsListenDef)
3) Helper functions were written to provide simple access
(both Get and Set) to the listen elements and their attributes.
* src/libvirt_private.syms: export the listen helper functions
* src/qemu/qemu_command.c, src/qemu/qemu_hotplug.c,
src/qemu/qemu_migration.c, src/vbox/vbox_tmpl.c,
src/vmx/vmx.c, src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c
Modify all these files to use the listen helper functions rather
than directly referencing the (now missing) listenAddr
attribute. There can be multiple <listen> elements to a single
<graphics>, but the drivers all currently only support one, so all
replacements of direct access with a helper function indicate index
"0".
* tests/* - only 3 of these are new files added explicitly to test the
new <listen> element. All the others have been modified to reflect
the fact that any legacy "listen" attributes passed in to the domain
parse will be saved in a <listen> element (i.e. one of the
virDomainGraphicsListenDefs), and during the domain format function,
both the <listen> element as well as the legacy attributes will be
output.
2011-07-07 04:20:28 +00:00
|
|
|
VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NONE = 0,
|
|
|
|
VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS,
|
|
|
|
VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK,
|
2016-06-08 08:35:37 +00:00
|
|
|
VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET,
|
conf: add <listen> subelement to domain <graphics> element
Once it's plugged in, the <listen> element will be an optional
replacement for the "listen" attribute that graphics elements already
have. If the <listen> element is type='address', it will have an
attribute called 'address' which will contain an IP address or dns
name that the guest's display server should listen on. If, however,
type='network', the <listen> element should have an attribute called
'network' that will be set to the name of a network configuration to
get the IP address from.
* docs/schemas/domain.rng: updated to allow the <listen> element
* docs/formatdomain.html.in: document the <listen> element and its
attributes.
* src/conf/domain_conf.[hc]:
1) The domain parser, formatter, and data structure are modified to
support 0 or more <listen> subelements to each <graphics>
element. The old style "legacy" listen attribute is also still
accepted, and will be stored internally just as if it were a
separate <listen> element. On output (i.e. format), the address
attribute of the first <listen> element of type 'address' will be
duplicated in the legacy "listen" attribute of the <graphic>
element.
2) The "listenAddr" attribute has been removed from the unions in
virDomainGRaphicsDef for graphics types vnc, rdp, and spice.
This attribute is now in the <listen> subelement (aka
virDomainGraphicsListenDef)
3) Helper functions were written to provide simple access
(both Get and Set) to the listen elements and their attributes.
* src/libvirt_private.syms: export the listen helper functions
* src/qemu/qemu_command.c, src/qemu/qemu_hotplug.c,
src/qemu/qemu_migration.c, src/vbox/vbox_tmpl.c,
src/vmx/vmx.c, src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c
Modify all these files to use the listen helper functions rather
than directly referencing the (now missing) listenAddr
attribute. There can be multiple <listen> elements to a single
<graphics>, but the drivers all currently only support one, so all
replacements of direct access with a helper function indicate index
"0".
* tests/* - only 3 of these are new files added explicitly to test the
new <listen> element. All the others have been modified to reflect
the fact that any legacy "listen" attributes passed in to the domain
parse will be saved in a <listen> element (i.e. one of the
virDomainGraphicsListenDefs), and during the domain format function,
both the <listen> element as well as the legacy attributes will be
output.
2011-07-07 04:20:28 +00:00
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainGraphicsListenType;
|
conf: add <listen> subelement to domain <graphics> element
Once it's plugged in, the <listen> element will be an optional
replacement for the "listen" attribute that graphics elements already
have. If the <listen> element is type='address', it will have an
attribute called 'address' which will contain an IP address or dns
name that the guest's display server should listen on. If, however,
type='network', the <listen> element should have an attribute called
'network' that will be set to the name of a network configuration to
get the IP address from.
* docs/schemas/domain.rng: updated to allow the <listen> element
* docs/formatdomain.html.in: document the <listen> element and its
attributes.
* src/conf/domain_conf.[hc]:
1) The domain parser, formatter, and data structure are modified to
support 0 or more <listen> subelements to each <graphics>
element. The old style "legacy" listen attribute is also still
accepted, and will be stored internally just as if it were a
separate <listen> element. On output (i.e. format), the address
attribute of the first <listen> element of type 'address' will be
duplicated in the legacy "listen" attribute of the <graphic>
element.
2) The "listenAddr" attribute has been removed from the unions in
virDomainGRaphicsDef for graphics types vnc, rdp, and spice.
This attribute is now in the <listen> subelement (aka
virDomainGraphicsListenDef)
3) Helper functions were written to provide simple access
(both Get and Set) to the listen elements and their attributes.
* src/libvirt_private.syms: export the listen helper functions
* src/qemu/qemu_command.c, src/qemu/qemu_hotplug.c,
src/qemu/qemu_migration.c, src/vbox/vbox_tmpl.c,
src/vmx/vmx.c, src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c
Modify all these files to use the listen helper functions rather
than directly referencing the (now missing) listenAddr
attribute. There can be multiple <listen> elements to a single
<graphics>, but the drivers all currently only support one, so all
replacements of direct access with a helper function indicate index
"0".
* tests/* - only 3 of these are new files added explicitly to test the
new <listen> element. All the others have been modified to reflect
the fact that any legacy "listen" attributes passed in to the domain
parse will be saved in a <listen> element (i.e. one of the
virDomainGraphicsListenDefs), and during the domain format function,
both the <listen> element as well as the legacy attributes will be
output.
2011-07-07 04:20:28 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2011-09-02 14:20:40 +00:00
|
|
|
VIR_DOMAIN_HUB_TYPE_USB,
|
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_HUB_TYPE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainHubType;
|
2011-09-02 14:20:40 +00:00
|
|
|
|
conf: add <listen> subelement to domain <graphics> element
Once it's plugged in, the <listen> element will be an optional
replacement for the "listen" attribute that graphics elements already
have. If the <listen> element is type='address', it will have an
attribute called 'address' which will contain an IP address or dns
name that the guest's display server should listen on. If, however,
type='network', the <listen> element should have an attribute called
'network' that will be set to the name of a network configuration to
get the IP address from.
* docs/schemas/domain.rng: updated to allow the <listen> element
* docs/formatdomain.html.in: document the <listen> element and its
attributes.
* src/conf/domain_conf.[hc]:
1) The domain parser, formatter, and data structure are modified to
support 0 or more <listen> subelements to each <graphics>
element. The old style "legacy" listen attribute is also still
accepted, and will be stored internally just as if it were a
separate <listen> element. On output (i.e. format), the address
attribute of the first <listen> element of type 'address' will be
duplicated in the legacy "listen" attribute of the <graphic>
element.
2) The "listenAddr" attribute has been removed from the unions in
virDomainGRaphicsDef for graphics types vnc, rdp, and spice.
This attribute is now in the <listen> subelement (aka
virDomainGraphicsListenDef)
3) Helper functions were written to provide simple access
(both Get and Set) to the listen elements and their attributes.
* src/libvirt_private.syms: export the listen helper functions
* src/qemu/qemu_command.c, src/qemu/qemu_hotplug.c,
src/qemu/qemu_migration.c, src/vbox/vbox_tmpl.c,
src/vmx/vmx.c, src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c
Modify all these files to use the listen helper functions rather
than directly referencing the (now missing) listenAddr
attribute. There can be multiple <listen> elements to a single
<graphics>, but the drivers all currently only support one, so all
replacements of direct access with a helper function indicate index
"0".
* tests/* - only 3 of these are new files added explicitly to test the
new <listen> element. All the others have been modified to reflect
the fact that any legacy "listen" attributes passed in to the domain
parse will be saved in a <listen> element (i.e. one of the
virDomainGraphicsListenDefs), and during the domain format function,
both the <listen> element as well as the legacy attributes will be
output.
2011-07-07 04:20:28 +00:00
|
|
|
struct _virDomainGraphicsListenDef {
|
2016-05-02 15:45:23 +00:00
|
|
|
virDomainGraphicsListenType type;
|
conf: add <listen> subelement to domain <graphics> element
Once it's plugged in, the <listen> element will be an optional
replacement for the "listen" attribute that graphics elements already
have. If the <listen> element is type='address', it will have an
attribute called 'address' which will contain an IP address or dns
name that the guest's display server should listen on. If, however,
type='network', the <listen> element should have an attribute called
'network' that will be set to the name of a network configuration to
get the IP address from.
* docs/schemas/domain.rng: updated to allow the <listen> element
* docs/formatdomain.html.in: document the <listen> element and its
attributes.
* src/conf/domain_conf.[hc]:
1) The domain parser, formatter, and data structure are modified to
support 0 or more <listen> subelements to each <graphics>
element. The old style "legacy" listen attribute is also still
accepted, and will be stored internally just as if it were a
separate <listen> element. On output (i.e. format), the address
attribute of the first <listen> element of type 'address' will be
duplicated in the legacy "listen" attribute of the <graphic>
element.
2) The "listenAddr" attribute has been removed from the unions in
virDomainGRaphicsDef for graphics types vnc, rdp, and spice.
This attribute is now in the <listen> subelement (aka
virDomainGraphicsListenDef)
3) Helper functions were written to provide simple access
(both Get and Set) to the listen elements and their attributes.
* src/libvirt_private.syms: export the listen helper functions
* src/qemu/qemu_command.c, src/qemu/qemu_hotplug.c,
src/qemu/qemu_migration.c, src/vbox/vbox_tmpl.c,
src/vmx/vmx.c, src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c
Modify all these files to use the listen helper functions rather
than directly referencing the (now missing) listenAddr
attribute. There can be multiple <listen> elements to a single
<graphics>, but the drivers all currently only support one, so all
replacements of direct access with a helper function indicate index
"0".
* tests/* - only 3 of these are new files added explicitly to test the
new <listen> element. All the others have been modified to reflect
the fact that any legacy "listen" attributes passed in to the domain
parse will be saved in a <listen> element (i.e. one of the
virDomainGraphicsListenDefs), and during the domain format function,
both the <listen> element as well as the legacy attributes will be
output.
2011-07-07 04:20:28 +00:00
|
|
|
char *address;
|
|
|
|
char *network;
|
2016-06-08 08:35:37 +00:00
|
|
|
char *socket;
|
2013-06-10 15:51:46 +00:00
|
|
|
bool fromConfig; /* true if the @address is config file originated */
|
2016-06-08 08:35:37 +00:00
|
|
|
bool autoGenerated;
|
conf: add <listen> subelement to domain <graphics> element
Once it's plugged in, the <listen> element will be an optional
replacement for the "listen" attribute that graphics elements already
have. If the <listen> element is type='address', it will have an
attribute called 'address' which will contain an IP address or dns
name that the guest's display server should listen on. If, however,
type='network', the <listen> element should have an attribute called
'network' that will be set to the name of a network configuration to
get the IP address from.
* docs/schemas/domain.rng: updated to allow the <listen> element
* docs/formatdomain.html.in: document the <listen> element and its
attributes.
* src/conf/domain_conf.[hc]:
1) The domain parser, formatter, and data structure are modified to
support 0 or more <listen> subelements to each <graphics>
element. The old style "legacy" listen attribute is also still
accepted, and will be stored internally just as if it were a
separate <listen> element. On output (i.e. format), the address
attribute of the first <listen> element of type 'address' will be
duplicated in the legacy "listen" attribute of the <graphic>
element.
2) The "listenAddr" attribute has been removed from the unions in
virDomainGRaphicsDef for graphics types vnc, rdp, and spice.
This attribute is now in the <listen> subelement (aka
virDomainGraphicsListenDef)
3) Helper functions were written to provide simple access
(both Get and Set) to the listen elements and their attributes.
* src/libvirt_private.syms: export the listen helper functions
* src/qemu/qemu_command.c, src/qemu/qemu_hotplug.c,
src/qemu/qemu_migration.c, src/vbox/vbox_tmpl.c,
src/vmx/vmx.c, src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c
Modify all these files to use the listen helper functions rather
than directly referencing the (now missing) listenAddr
attribute. There can be multiple <listen> elements to a single
<graphics>, but the drivers all currently only support one, so all
replacements of direct access with a helper function indicate index
"0".
* tests/* - only 3 of these are new files added explicitly to test the
new <listen> element. All the others have been modified to reflect
the fact that any legacy "listen" attributes passed in to the domain
parse will be saved in a <listen> element (i.e. one of the
virDomainGraphicsListenDefs), and during the domain format function,
both the <listen> element as well as the legacy attributes will be
output.
2011-07-07 04:20:28 +00:00
|
|
|
};
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
struct _virDomainGraphicsDef {
|
2019-01-10 15:34:00 +00:00
|
|
|
virObjectPtr privateData;
|
|
|
|
|
2012-03-12 15:50:39 +00:00
|
|
|
/* Port value discipline:
|
|
|
|
* Value -1 is legacy syntax indicating that it should be auto-allocated.
|
|
|
|
* Value 0 means port wasn't specified in XML at all.
|
|
|
|
* Positive value is actual port number given in XML.
|
|
|
|
*/
|
2016-05-02 15:45:23 +00:00
|
|
|
virDomainGraphicsType type;
|
2008-07-11 16:23:36 +00:00
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
int port;
|
2014-06-24 11:34:18 +00:00
|
|
|
bool portReserved;
|
2013-04-29 12:34:01 +00:00
|
|
|
int websocket;
|
2016-11-22 11:09:32 +00:00
|
|
|
bool websocketGenerated;
|
2013-04-12 08:49:38 +00:00
|
|
|
bool autoport;
|
2008-07-11 16:23:36 +00:00
|
|
|
char *keymap;
|
2010-04-08 12:43:23 +00:00
|
|
|
virDomainGraphicsAuthDef auth;
|
2013-05-21 14:31:48 +00:00
|
|
|
int sharePolicy;
|
2008-07-11 16:23:36 +00:00
|
|
|
} vnc;
|
|
|
|
struct {
|
|
|
|
char *display;
|
|
|
|
char *xauth;
|
2013-04-12 08:49:38 +00:00
|
|
|
bool fullscreen;
|
2018-05-10 10:53:57 +00:00
|
|
|
virTristateBool gl;
|
2008-07-11 16:23:36 +00:00
|
|
|
} sdl;
|
2009-05-15 09:43:51 +00:00
|
|
|
struct {
|
|
|
|
int port;
|
2013-04-12 08:49:38 +00:00
|
|
|
bool autoport;
|
|
|
|
bool replaceUser;
|
|
|
|
bool multiUser;
|
2009-05-15 09:43:51 +00:00
|
|
|
} rdp;
|
|
|
|
struct {
|
|
|
|
char *display;
|
2013-04-12 08:49:38 +00:00
|
|
|
bool fullscreen;
|
2009-05-15 09:43:51 +00:00
|
|
|
} desktop;
|
2009-08-14 09:54:14 +00:00
|
|
|
struct {
|
|
|
|
int port;
|
|
|
|
int tlsPort;
|
2014-06-24 11:34:18 +00:00
|
|
|
bool portReserved;
|
|
|
|
bool tlsPortReserved;
|
2016-05-02 15:45:23 +00:00
|
|
|
virDomainGraphicsSpiceMouseMode mousemode;
|
2009-08-14 09:54:14 +00:00
|
|
|
char *keymap;
|
2010-04-08 12:43:23 +00:00
|
|
|
virDomainGraphicsAuthDef auth;
|
2013-04-12 08:49:38 +00:00
|
|
|
bool autoport;
|
2010-04-09 16:56:00 +00:00
|
|
|
int channels[VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_LAST];
|
2016-05-02 15:45:23 +00:00
|
|
|
virDomainGraphicsSpiceChannelMode defaultMode;
|
2011-04-14 08:44:20 +00:00
|
|
|
int image;
|
|
|
|
int jpeg;
|
|
|
|
int zlib;
|
|
|
|
int playback;
|
2011-05-23 15:16:42 +00:00
|
|
|
int streaming;
|
2016-05-02 15:45:23 +00:00
|
|
|
virTristateBool copypaste;
|
|
|
|
virTristateBool filetransfer;
|
|
|
|
virTristateBool gl;
|
2017-02-14 21:04:13 +00:00
|
|
|
char *rendernode;
|
2009-08-14 09:54:14 +00:00
|
|
|
} spice;
|
2018-11-15 10:37:00 +00:00
|
|
|
struct {
|
|
|
|
char *rendernode;
|
|
|
|
} egl_headless;
|
2008-07-11 16:23:36 +00:00
|
|
|
} data;
|
conf: add <listen> subelement to domain <graphics> element
Once it's plugged in, the <listen> element will be an optional
replacement for the "listen" attribute that graphics elements already
have. If the <listen> element is type='address', it will have an
attribute called 'address' which will contain an IP address or dns
name that the guest's display server should listen on. If, however,
type='network', the <listen> element should have an attribute called
'network' that will be set to the name of a network configuration to
get the IP address from.
* docs/schemas/domain.rng: updated to allow the <listen> element
* docs/formatdomain.html.in: document the <listen> element and its
attributes.
* src/conf/domain_conf.[hc]:
1) The domain parser, formatter, and data structure are modified to
support 0 or more <listen> subelements to each <graphics>
element. The old style "legacy" listen attribute is also still
accepted, and will be stored internally just as if it were a
separate <listen> element. On output (i.e. format), the address
attribute of the first <listen> element of type 'address' will be
duplicated in the legacy "listen" attribute of the <graphic>
element.
2) The "listenAddr" attribute has been removed from the unions in
virDomainGRaphicsDef for graphics types vnc, rdp, and spice.
This attribute is now in the <listen> subelement (aka
virDomainGraphicsListenDef)
3) Helper functions were written to provide simple access
(both Get and Set) to the listen elements and their attributes.
* src/libvirt_private.syms: export the listen helper functions
* src/qemu/qemu_command.c, src/qemu/qemu_hotplug.c,
src/qemu/qemu_migration.c, src/vbox/vbox_tmpl.c,
src/vmx/vmx.c, src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c
Modify all these files to use the listen helper functions rather
than directly referencing the (now missing) listenAddr
attribute. There can be multiple <listen> elements to a single
<graphics>, but the drivers all currently only support one, so all
replacements of direct access with a helper function indicate index
"0".
* tests/* - only 3 of these are new files added explicitly to test the
new <listen> element. All the others have been modified to reflect
the fact that any legacy "listen" attributes passed in to the domain
parse will be saved in a <listen> element (i.e. one of the
virDomainGraphicsListenDefs), and during the domain format function,
both the <listen> element as well as the legacy attributes will be
output.
2011-07-07 04:20:28 +00:00
|
|
|
/* nListens, listens, and *port are only useful if type is vnc,
|
|
|
|
* rdp, or spice. They've been extracted from the union only to
|
|
|
|
* simplify parsing code.*/
|
|
|
|
size_t nListens;
|
|
|
|
virDomainGraphicsListenDefPtr listens;
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2011-09-02 15:09:14 +00:00
|
|
|
VIR_DOMAIN_REDIRDEV_BUS_USB,
|
|
|
|
|
|
|
|
VIR_DOMAIN_REDIRDEV_BUS_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainRedirdevBus;
|
2011-09-02 15:09:14 +00:00
|
|
|
|
|
|
|
struct _virDomainRedirdevDef {
|
|
|
|
int bus; /* enum virDomainRedirdevBus */
|
|
|
|
|
2016-10-24 12:24:51 +00:00
|
|
|
virDomainChrSourceDefPtr source;
|
2011-09-02 15:09:14 +00:00
|
|
|
|
|
|
|
virDomainDeviceInfo info; /* Guest address */
|
|
|
|
};
|
2010-07-15 13:02:42 +00:00
|
|
|
|
2014-03-13 11:58:17 +00:00
|
|
|
struct _virDomainRedirFilterUSBDevDef {
|
2012-09-13 07:25:45 +00:00
|
|
|
int usbClass;
|
|
|
|
int vendor;
|
|
|
|
int product;
|
|
|
|
int version;
|
2013-04-12 08:51:36 +00:00
|
|
|
bool allow;
|
2012-09-13 07:25:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _virDomainRedirFilterDef {
|
|
|
|
size_t nusbdevs;
|
2014-03-13 11:58:17 +00:00
|
|
|
virDomainRedirFilterUSBDevDefPtr *usbdevs;
|
2012-09-13 07:25:45 +00:00
|
|
|
};
|
|
|
|
|
2016-10-07 19:51:30 +00:00
|
|
|
typedef enum {
|
2010-07-15 13:02:42 +00:00
|
|
|
VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO,
|
|
|
|
VIR_DOMAIN_MEMBALLOON_MODEL_XEN,
|
2010-08-11 09:28:17 +00:00
|
|
|
VIR_DOMAIN_MEMBALLOON_MODEL_NONE,
|
2019-01-17 17:52:39 +00:00
|
|
|
VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO_TRANSITIONAL,
|
|
|
|
VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO_NON_TRANSITIONAL,
|
2010-07-15 13:02:42 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_MEMBALLOON_MODEL_LAST
|
2016-10-07 19:51:30 +00:00
|
|
|
} virDomainMemballoonModel;
|
2010-07-15 13:02:42 +00:00
|
|
|
|
|
|
|
struct _virDomainMemballoonDef {
|
|
|
|
int model;
|
|
|
|
virDomainDeviceInfo info;
|
2015-03-13 16:08:15 +00:00
|
|
|
int period; /* seconds between collections */
|
2016-01-08 10:45:05 +00:00
|
|
|
int autodeflate; /* enum virTristateSwitch */
|
2020-10-12 23:35:36 +00:00
|
|
|
int free_page_reporting; /* enum virTristateSwitch */
|
2017-05-24 14:47:28 +00:00
|
|
|
virDomainVirtioOptionsPtr virtio;
|
2010-07-15 13:02:42 +00:00
|
|
|
};
|
|
|
|
|
2013-04-19 08:37:51 +00:00
|
|
|
struct _virDomainNVRAMDef {
|
|
|
|
virDomainDeviceInfo info;
|
|
|
|
};
|
2010-07-15 13:02:42 +00:00
|
|
|
|
2016-08-19 12:57:07 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_SHMEM_MODEL_IVSHMEM,
|
2016-08-19 12:58:35 +00:00
|
|
|
VIR_DOMAIN_SHMEM_MODEL_IVSHMEM_PLAIN,
|
|
|
|
VIR_DOMAIN_SHMEM_MODEL_IVSHMEM_DOORBELL,
|
2016-08-19 12:57:07 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_SHMEM_MODEL_LAST
|
|
|
|
} virDomainShmemModel;
|
|
|
|
|
2020-07-24 03:34:11 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_SHMEM_ROLE_DEFAULT,
|
|
|
|
VIR_DOMAIN_SHMEM_ROLE_MASTER,
|
|
|
|
VIR_DOMAIN_SHMEM_ROLE_PEER,
|
|
|
|
|
|
|
|
VIR_DOMAIN_SHMEM_ROLE_LAST
|
|
|
|
} virDomainShmemRole;
|
|
|
|
|
2014-09-22 08:49:39 +00:00
|
|
|
struct _virDomainShmemDef {
|
|
|
|
char *name;
|
|
|
|
unsigned long long size;
|
2016-08-19 12:57:07 +00:00
|
|
|
int model; /* enum virDomainShmemModel */
|
2020-07-24 03:34:11 +00:00
|
|
|
int role; /* enum virDomainShmemRole */
|
2014-09-22 08:49:39 +00:00
|
|
|
struct {
|
|
|
|
bool enabled;
|
2015-06-17 03:56:15 +00:00
|
|
|
virDomainChrSourceDef chr;
|
2014-09-22 08:49:39 +00:00
|
|
|
} server;
|
|
|
|
struct {
|
|
|
|
bool enabled;
|
|
|
|
unsigned vectors;
|
|
|
|
virTristateSwitch ioeventfd;
|
|
|
|
} msi;
|
|
|
|
virDomainDeviceInfo info;
|
|
|
|
};
|
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2013-02-19 10:55:27 +00:00
|
|
|
VIR_DOMAIN_SMBIOS_NONE = 0,
|
2010-11-05 13:10:34 +00:00
|
|
|
VIR_DOMAIN_SMBIOS_EMULATE,
|
|
|
|
VIR_DOMAIN_SMBIOS_HOST,
|
|
|
|
VIR_DOMAIN_SMBIOS_SYSINFO,
|
|
|
|
|
|
|
|
VIR_DOMAIN_SMBIOS_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainSmbiosMode;
|
2010-11-05 13:10:34 +00:00
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2019-06-07 20:20:16 +00:00
|
|
|
#define VIR_DOMAIN_MAX_BOOT_DEVS 4
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_DOMAIN_BOOT_FLOPPY,
|
|
|
|
VIR_DOMAIN_BOOT_CDROM,
|
|
|
|
VIR_DOMAIN_BOOT_DISK,
|
|
|
|
VIR_DOMAIN_BOOT_NET,
|
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_BOOT_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainBootOrder;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_DOMAIN_FEATURE_ACPI,
|
|
|
|
VIR_DOMAIN_FEATURE_APIC,
|
|
|
|
VIR_DOMAIN_FEATURE_PAE,
|
2011-01-05 21:56:48 +00:00
|
|
|
VIR_DOMAIN_FEATURE_HAP,
|
2011-06-15 13:27:43 +00:00
|
|
|
VIR_DOMAIN_FEATURE_VIRIDIAN,
|
2012-01-18 11:38:49 +00:00
|
|
|
VIR_DOMAIN_FEATURE_PRIVNET,
|
2012-10-16 16:25:56 +00:00
|
|
|
VIR_DOMAIN_FEATURE_HYPERV,
|
2014-08-21 17:04:45 +00:00
|
|
|
VIR_DOMAIN_FEATURE_KVM,
|
2013-09-23 16:32:11 +00:00
|
|
|
VIR_DOMAIN_FEATURE_PVSPINLOCK,
|
2014-07-18 08:02:29 +00:00
|
|
|
VIR_DOMAIN_FEATURE_CAPABILITIES,
|
2015-01-05 15:21:51 +00:00
|
|
|
VIR_DOMAIN_FEATURE_PMU,
|
2015-04-02 16:42:20 +00:00
|
|
|
VIR_DOMAIN_FEATURE_VMPORT,
|
2015-04-27 12:03:19 +00:00
|
|
|
VIR_DOMAIN_FEATURE_GIC,
|
2016-07-13 12:09:20 +00:00
|
|
|
VIR_DOMAIN_FEATURE_SMM,
|
2017-03-17 07:26:35 +00:00
|
|
|
VIR_DOMAIN_FEATURE_IOAPIC,
|
2017-11-06 15:39:40 +00:00
|
|
|
VIR_DOMAIN_FEATURE_HPT,
|
2017-11-16 16:49:38 +00:00
|
|
|
VIR_DOMAIN_FEATURE_VMCOREINFO,
|
2018-07-02 08:35:54 +00:00
|
|
|
VIR_DOMAIN_FEATURE_HTM,
|
2018-11-20 13:57:27 +00:00
|
|
|
VIR_DOMAIN_FEATURE_NESTED_HV,
|
2019-01-24 03:23:31 +00:00
|
|
|
VIR_DOMAIN_FEATURE_MSRS,
|
2019-10-08 20:06:24 +00:00
|
|
|
VIR_DOMAIN_FEATURE_CCF_ASSIST,
|
2020-04-14 02:37:04 +00:00
|
|
|
VIR_DOMAIN_FEATURE_XEN,
|
2020-04-27 12:14:27 +00:00
|
|
|
VIR_DOMAIN_FEATURE_CFPC,
|
2020-04-27 12:14:29 +00:00
|
|
|
VIR_DOMAIN_FEATURE_SBBC,
|
2020-04-27 12:14:31 +00:00
|
|
|
VIR_DOMAIN_FEATURE_IBS,
|
2008-07-11 16:23:36 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_FEATURE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainFeature;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2019-06-07 20:20:16 +00:00
|
|
|
#define VIR_DOMAIN_HYPERV_VENDOR_ID_MAX 12
|
2016-03-10 12:43:49 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2012-10-16 16:25:56 +00:00
|
|
|
VIR_DOMAIN_HYPERV_RELAXED = 0,
|
2013-06-21 10:20:12 +00:00
|
|
|
VIR_DOMAIN_HYPERV_VAPIC,
|
|
|
|
VIR_DOMAIN_HYPERV_SPINLOCKS,
|
2016-03-10 12:43:49 +00:00
|
|
|
VIR_DOMAIN_HYPERV_VPINDEX,
|
|
|
|
VIR_DOMAIN_HYPERV_RUNTIME,
|
|
|
|
VIR_DOMAIN_HYPERV_SYNIC,
|
|
|
|
VIR_DOMAIN_HYPERV_STIMER,
|
|
|
|
VIR_DOMAIN_HYPERV_RESET,
|
|
|
|
VIR_DOMAIN_HYPERV_VENDOR_ID,
|
2018-08-09 13:14:19 +00:00
|
|
|
VIR_DOMAIN_HYPERV_FREQUENCIES,
|
2018-08-09 13:14:20 +00:00
|
|
|
VIR_DOMAIN_HYPERV_REENLIGHTENMENT,
|
2018-08-09 13:14:21 +00:00
|
|
|
VIR_DOMAIN_HYPERV_TLBFLUSH,
|
2018-11-14 22:46:04 +00:00
|
|
|
VIR_DOMAIN_HYPERV_IPI,
|
2018-11-14 22:46:06 +00:00
|
|
|
VIR_DOMAIN_HYPERV_EVMCS,
|
2012-10-16 16:25:56 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_HYPERV_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainHyperv;
|
2012-10-16 16:25:56 +00:00
|
|
|
|
2014-08-21 17:04:45 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_KVM_HIDDEN = 0,
|
2019-08-12 12:30:29 +00:00
|
|
|
VIR_DOMAIN_KVM_DEDICATED,
|
2020-11-13 08:49:43 +00:00
|
|
|
VIR_DOMAIN_KVM_POLLCONTROL,
|
2014-08-21 17:04:45 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_KVM_LAST
|
|
|
|
} virDomainKVM;
|
|
|
|
|
2019-01-24 03:23:31 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_MSRS_UNKNOWN = 0,
|
|
|
|
|
|
|
|
VIR_DOMAIN_MSRS_LAST
|
|
|
|
} virDomainMsrs;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_MSRS_UNKNOWN_IGNORE = 0,
|
|
|
|
VIR_DOMAIN_MSRS_UNKNOWN_FAULT,
|
|
|
|
|
|
|
|
VIR_DOMAIN_MSRS_UNKNOWN_LAST
|
|
|
|
} virDomainMsrsUnknown;
|
|
|
|
|
2020-04-14 02:37:04 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_XEN_E820_HOST = 0,
|
2020-04-15 22:34:54 +00:00
|
|
|
VIR_DOMAIN_XEN_PASSTHROUGH,
|
2020-04-14 02:37:04 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_XEN_LAST
|
|
|
|
} virDomainXen;
|
|
|
|
|
2020-04-15 22:34:54 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_XEN_PASSTHROUGH_MODE_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_XEN_PASSTHROUGH_MODE_SYNC_PT,
|
|
|
|
VIR_DOMAIN_XEN_PASSTHROUGH_MODE_SHARE_PT,
|
|
|
|
|
|
|
|
VIR_DOMAIN_XEN_PASSTHROUGH_MODE_LAST
|
|
|
|
} virDomainXenPassthroughMode;
|
|
|
|
|
2014-07-18 08:02:29 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_CAPABILITIES_POLICY_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_CAPABILITIES_POLICY_ALLOW,
|
|
|
|
VIR_DOMAIN_CAPABILITIES_POLICY_DENY,
|
|
|
|
|
|
|
|
VIR_DOMAIN_CAPABILITIES_POLICY_LAST
|
|
|
|
} virDomainCapabilitiesPolicy;
|
|
|
|
|
|
|
|
/* The capabilities are ordered alphabetically to help check for new ones */
|
|
|
|
typedef enum {
|
2019-10-25 12:50:15 +00:00
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_AUDIT_CONTROL = 0,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_AUDIT_WRITE,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_BLOCK_SUSPEND,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_CHOWN,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_DAC_OVERRIDE,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_DAC_READ_SEARCH,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_FOWNER,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_FSETID,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_IPC_LOCK,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_IPC_OWNER,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_KILL,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_LEASE,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_LINUX_IMMUTABLE,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_MAC_ADMIN,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_MAC_OVERRIDE,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_MKNOD,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_NET_ADMIN,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_NET_BIND_SERVICE,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_NET_BROADCAST,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_NET_RAW,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SETGID,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SETFCAP,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SETPCAP,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SETUID,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SYS_ADMIN,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SYS_BOOT,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SYS_CHROOT,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SYS_MODULE,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SYS_NICE,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SYS_PACCT,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SYS_PTRACE,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SYS_RAWIO,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SYS_RESOURCE,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SYS_TIME,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SYS_TTY_CONFIG,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_SYSLOG,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_WAKE_ALARM,
|
|
|
|
VIR_DOMAIN_PROCES_CAPS_FEATURE_LAST
|
|
|
|
} virDomainProcessCapsFeature;
|
2014-07-18 08:02:29 +00:00
|
|
|
|
2012-09-06 20:17:01 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_LOCK_FAILURE_DEFAULT,
|
|
|
|
VIR_DOMAIN_LOCK_FAILURE_POWEROFF,
|
|
|
|
VIR_DOMAIN_LOCK_FAILURE_RESTART,
|
|
|
|
VIR_DOMAIN_LOCK_FAILURE_PAUSE,
|
|
|
|
VIR_DOMAIN_LOCK_FAILURE_IGNORE,
|
|
|
|
|
|
|
|
VIR_DOMAIN_LOCK_FAILURE_LAST
|
|
|
|
} virDomainLockFailureAction;
|
|
|
|
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virDomainLockFailure);
|
2012-09-06 20:17:01 +00:00
|
|
|
|
2011-07-08 07:56:17 +00:00
|
|
|
struct _virDomainBIOSDef {
|
2014-06-27 15:16:54 +00:00
|
|
|
int useserial; /* enum virTristateBool */
|
2012-09-18 10:30:52 +00:00
|
|
|
/* reboot-timeout parameters */
|
|
|
|
bool rt_set;
|
|
|
|
int rt_delay;
|
2011-07-08 07:56:17 +00:00
|
|
|
};
|
|
|
|
|
2014-08-06 11:18:53 +00:00
|
|
|
typedef enum {
|
2019-02-25 13:46:07 +00:00
|
|
|
VIR_DOMAIN_LOADER_TYPE_NONE = 0,
|
|
|
|
VIR_DOMAIN_LOADER_TYPE_ROM,
|
2014-08-06 11:18:53 +00:00
|
|
|
VIR_DOMAIN_LOADER_TYPE_PFLASH,
|
|
|
|
|
|
|
|
VIR_DOMAIN_LOADER_TYPE_LAST
|
|
|
|
} virDomainLoader;
|
|
|
|
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virDomainLoader);
|
2014-08-06 11:18:53 +00:00
|
|
|
|
|
|
|
struct _virDomainLoaderDef {
|
|
|
|
char *path;
|
|
|
|
int readonly; /* enum virTristateBool */
|
|
|
|
virDomainLoader type;
|
2016-07-13 07:22:51 +00:00
|
|
|
int secure; /* enum virTristateBool */
|
2014-08-06 11:18:53 +00:00
|
|
|
char *nvram; /* path to non-volatile RAM */
|
2014-08-07 14:59:21 +00:00
|
|
|
char *templt; /* user override of path to master nvram */
|
2014-08-06 11:18:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void virDomainLoaderDefFree(virDomainLoaderDefPtr loader);
|
|
|
|
|
2017-03-17 07:26:35 +00:00
|
|
|
typedef enum {
|
2018-02-06 13:30:40 +00:00
|
|
|
VIR_DOMAIN_IOAPIC_NONE = 0,
|
|
|
|
VIR_DOMAIN_IOAPIC_QEMU,
|
2017-03-17 07:26:35 +00:00
|
|
|
VIR_DOMAIN_IOAPIC_KVM,
|
|
|
|
|
|
|
|
VIR_DOMAIN_IOAPIC_LAST
|
|
|
|
} virDomainIOAPIC;
|
|
|
|
|
|
|
|
VIR_ENUM_DECL(virDomainIOAPIC);
|
|
|
|
|
2017-11-06 15:39:40 +00:00
|
|
|
typedef enum {
|
2018-02-06 13:49:41 +00:00
|
|
|
VIR_DOMAIN_HPT_RESIZING_NONE = 0,
|
|
|
|
VIR_DOMAIN_HPT_RESIZING_ENABLED,
|
2017-11-06 15:39:40 +00:00
|
|
|
VIR_DOMAIN_HPT_RESIZING_DISABLED,
|
|
|
|
VIR_DOMAIN_HPT_RESIZING_REQUIRED,
|
|
|
|
|
|
|
|
VIR_DOMAIN_HPT_RESIZING_LAST
|
|
|
|
} virDomainHPTResizing;
|
|
|
|
|
|
|
|
VIR_ENUM_DECL(virDomainHPTResizing);
|
|
|
|
|
2020-04-27 12:14:27 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_CFPC_NONE = 0,
|
|
|
|
VIR_DOMAIN_CFPC_BROKEN,
|
|
|
|
VIR_DOMAIN_CFPC_WORKAROUND,
|
|
|
|
VIR_DOMAIN_CFPC_FIXED,
|
|
|
|
|
|
|
|
VIR_DOMAIN_CFPC_LAST
|
|
|
|
} virDomainCFPC;
|
|
|
|
|
|
|
|
VIR_ENUM_DECL(virDomainCFPC);
|
|
|
|
|
2020-04-27 12:14:29 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_SBBC_NONE = 0,
|
|
|
|
VIR_DOMAIN_SBBC_BROKEN,
|
|
|
|
VIR_DOMAIN_SBBC_WORKAROUND,
|
|
|
|
VIR_DOMAIN_SBBC_FIXED,
|
|
|
|
|
|
|
|
VIR_DOMAIN_SBBC_LAST
|
|
|
|
} virDomainSBBC;
|
|
|
|
|
|
|
|
VIR_ENUM_DECL(virDomainSBBC);
|
|
|
|
|
2020-04-27 12:14:31 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_IBS_NONE = 0,
|
|
|
|
VIR_DOMAIN_IBS_BROKEN,
|
|
|
|
VIR_DOMAIN_IBS_WORKAROUND,
|
|
|
|
VIR_DOMAIN_IBS_FIXEDIBS,
|
|
|
|
VIR_DOMAIN_IBS_FIXEDCCD,
|
|
|
|
VIR_DOMAIN_IBS_FIXEDNA,
|
|
|
|
|
|
|
|
VIR_DOMAIN_IBS_LAST
|
|
|
|
} virDomainIBS;
|
|
|
|
|
|
|
|
VIR_ENUM_DECL(virDomainIBS);
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
/* Operating system configuration data & machine / arch */
|
2017-05-30 15:03:58 +00:00
|
|
|
struct _virDomainOSEnv {
|
|
|
|
char *name;
|
|
|
|
char *value;
|
|
|
|
};
|
|
|
|
|
2019-02-22 14:25:17 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_OS_DEF_FIRMWARE_NONE = 0,
|
2020-01-08 08:42:47 +00:00
|
|
|
VIR_DOMAIN_OS_DEF_FIRMWARE_BIOS = VIR_DOMAIN_LOADER_TYPE_ROM,
|
|
|
|
VIR_DOMAIN_OS_DEF_FIRMWARE_EFI = VIR_DOMAIN_LOADER_TYPE_PFLASH,
|
2019-02-22 14:25:17 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_OS_DEF_FIRMWARE_LAST
|
|
|
|
} virDomainOsDefFirmware;
|
|
|
|
|
2020-01-08 08:42:47 +00:00
|
|
|
G_STATIC_ASSERT((int)VIR_DOMAIN_OS_DEF_FIRMWARE_LAST == (int)VIR_DOMAIN_LOADER_TYPE_LAST);
|
|
|
|
|
2019-02-22 14:25:17 +00:00
|
|
|
VIR_ENUM_DECL(virDomainOsDefFirmware);
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
struct _virDomainOSDef {
|
2015-04-17 00:11:06 +00:00
|
|
|
int type;
|
2019-02-22 14:25:17 +00:00
|
|
|
virDomainOsDefFirmware firmware;
|
2012-12-10 22:28:09 +00:00
|
|
|
virArch arch;
|
2008-07-11 16:23:36 +00:00
|
|
|
char *machine;
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nBootDevs;
|
2008-07-11 16:23:36 +00:00
|
|
|
int bootDevs[VIR_DOMAIN_BOOT_LAST];
|
2014-06-27 15:16:54 +00:00
|
|
|
int bootmenu; /* enum virTristateBool */
|
2014-08-22 11:39:26 +00:00
|
|
|
unsigned int bm_timeout;
|
|
|
|
bool bm_timeout_set;
|
2008-08-01 13:31:37 +00:00
|
|
|
char *init;
|
2012-03-26 17:09:31 +00:00
|
|
|
char **initargv;
|
2017-05-30 15:03:58 +00:00
|
|
|
virDomainOSEnvPtr *initenv;
|
2017-05-31 13:32:11 +00:00
|
|
|
char *initdir;
|
2017-06-06 08:54:16 +00:00
|
|
|
char *inituser;
|
|
|
|
char *initgroup;
|
2008-07-11 16:23:36 +00:00
|
|
|
char *kernel;
|
|
|
|
char *initrd;
|
|
|
|
char *cmdline;
|
2013-03-14 04:49:42 +00:00
|
|
|
char *dtb;
|
2008-07-11 16:23:36 +00:00
|
|
|
char *root;
|
2016-04-18 15:13:02 +00:00
|
|
|
char *slic_table;
|
2014-08-06 11:18:53 +00:00
|
|
|
virDomainLoaderDefPtr loader;
|
2008-07-11 16:23:36 +00:00
|
|
|
char *bootloader;
|
|
|
|
char *bootloaderArgs;
|
2010-11-05 13:10:34 +00:00
|
|
|
int smbios_mode;
|
2012-09-18 09:38:18 +00:00
|
|
|
|
2011-07-08 07:56:17 +00:00
|
|
|
virDomainBIOSDef bios;
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2010-03-30 11:44:22 +00:00
|
|
|
VIR_DOMAIN_TIMER_NAME_PLATFORM = 0,
|
|
|
|
VIR_DOMAIN_TIMER_NAME_PIT,
|
|
|
|
VIR_DOMAIN_TIMER_NAME_RTC,
|
|
|
|
VIR_DOMAIN_TIMER_NAME_HPET,
|
|
|
|
VIR_DOMAIN_TIMER_NAME_TSC,
|
2012-01-27 13:49:51 +00:00
|
|
|
VIR_DOMAIN_TIMER_NAME_KVMCLOCK,
|
2014-01-21 17:50:12 +00:00
|
|
|
VIR_DOMAIN_TIMER_NAME_HYPERVCLOCK,
|
2020-02-06 15:54:45 +00:00
|
|
|
VIR_DOMAIN_TIMER_NAME_ARMVTIMER,
|
2010-03-30 11:44:22 +00:00
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_TIMER_NAME_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainTimerNameType;
|
2010-03-30 11:44:22 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2010-03-31 17:03:54 +00:00
|
|
|
VIR_DOMAIN_TIMER_TRACK_BOOT = 0,
|
|
|
|
VIR_DOMAIN_TIMER_TRACK_GUEST,
|
|
|
|
VIR_DOMAIN_TIMER_TRACK_WALL,
|
2010-03-30 11:44:22 +00:00
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_TIMER_TRACK_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainTimerTrackType;
|
2010-03-30 11:44:22 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2010-03-30 11:44:22 +00:00
|
|
|
VIR_DOMAIN_TIMER_TICKPOLICY_DELAY = 0,
|
|
|
|
VIR_DOMAIN_TIMER_TICKPOLICY_CATCHUP,
|
|
|
|
VIR_DOMAIN_TIMER_TICKPOLICY_MERGE,
|
|
|
|
VIR_DOMAIN_TIMER_TICKPOLICY_DISCARD,
|
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_TIMER_TICKPOLICY_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainTimerTickpolicyType;
|
2010-03-30 11:44:22 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2010-03-30 11:44:22 +00:00
|
|
|
VIR_DOMAIN_TIMER_MODE_AUTO = 0,
|
|
|
|
VIR_DOMAIN_TIMER_MODE_NATIVE,
|
|
|
|
VIR_DOMAIN_TIMER_MODE_EMULATE,
|
|
|
|
VIR_DOMAIN_TIMER_MODE_PARAVIRT,
|
2010-03-31 17:03:54 +00:00
|
|
|
VIR_DOMAIN_TIMER_MODE_SMPSAFE,
|
2010-03-30 11:44:22 +00:00
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_TIMER_MODE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainTimerModeType;
|
2010-03-30 11:44:22 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2012-05-08 16:04:36 +00:00
|
|
|
VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC = 0,
|
2012-03-08 13:36:26 +00:00
|
|
|
VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO,
|
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_CPU_PLACEMENT_MODE_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainCpuPlacementMode;
|
2012-03-08 13:36:26 +00:00
|
|
|
|
2015-01-08 12:54:21 +00:00
|
|
|
struct _virDomainThreadSchedParam {
|
2015-03-02 16:14:39 +00:00
|
|
|
virProcessSchedPolicy policy;
|
2015-01-08 12:54:21 +00:00
|
|
|
int priority;
|
|
|
|
};
|
|
|
|
|
2010-03-31 17:03:54 +00:00
|
|
|
struct _virDomainTimerCatchupDef {
|
|
|
|
unsigned long threshold;
|
|
|
|
unsigned long slew;
|
|
|
|
unsigned long limit;
|
|
|
|
};
|
|
|
|
|
2010-03-30 11:44:22 +00:00
|
|
|
struct _virDomainTimerDef {
|
|
|
|
int name;
|
|
|
|
int present; /* unspecified = -1, no = 0, yes = 1 */
|
|
|
|
int tickpolicy; /* none|catchup|merge|discard */
|
|
|
|
|
2010-03-31 17:03:54 +00:00
|
|
|
virDomainTimerCatchupDef catchup;
|
|
|
|
|
|
|
|
/* track is only valid for name='platform|rtc' */
|
2020-04-16 11:24:54 +00:00
|
|
|
int track; /* boot|guest|wall */
|
2010-03-30 11:44:22 +00:00
|
|
|
|
|
|
|
/* frequency & mode are only valid for name='tsc' */
|
2020-11-11 15:50:16 +00:00
|
|
|
unsigned long long frequency; /* in Hz, unspecified = 0 */
|
2010-03-30 11:44:22 +00:00
|
|
|
int mode; /* auto|native|emulate|paravirt */
|
|
|
|
};
|
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2010-02-02 17:22:03 +00:00
|
|
|
VIR_DOMAIN_CLOCK_OFFSET_UTC = 0,
|
|
|
|
VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME = 1,
|
2010-02-02 17:49:09 +00:00
|
|
|
VIR_DOMAIN_CLOCK_OFFSET_VARIABLE = 2,
|
2010-02-02 18:28:44 +00:00
|
|
|
VIR_DOMAIN_CLOCK_OFFSET_TIMEZONE = 3,
|
2010-02-02 17:22:03 +00:00
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_CLOCK_OFFSET_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainClockOffsetType;
|
2010-02-02 17:22:03 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2012-02-06 13:59:16 +00:00
|
|
|
VIR_DOMAIN_CLOCK_BASIS_UTC = 0,
|
|
|
|
VIR_DOMAIN_CLOCK_BASIS_LOCALTIME = 1,
|
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_CLOCK_BASIS_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainClockBasis;
|
2012-02-06 13:59:16 +00:00
|
|
|
|
2010-02-02 17:22:03 +00:00
|
|
|
struct _virDomainClockDef {
|
|
|
|
int offset;
|
2010-02-02 17:49:09 +00:00
|
|
|
|
2010-02-02 18:28:44 +00:00
|
|
|
union {
|
2012-02-06 13:59:16 +00:00
|
|
|
/* Bug-compatibility-mode for Xen utc|localtime */
|
|
|
|
int utc_reset;
|
|
|
|
/* Adjustment in seconds, relative to UTC or LOCALTIME, when
|
2010-02-02 18:28:44 +00:00
|
|
|
* offset == VIR_DOMAIN_CLOCK_OFFSET_VARIABLE */
|
2012-02-06 13:59:16 +00:00
|
|
|
struct {
|
|
|
|
long long adjustment;
|
|
|
|
int basis;
|
qemu: fix RTC_CHANGE event for <clock offset='variable' basis='utc'/>
commit e31b5cf393857 attempted to fix libvirt's
VIR_DOMAIN_EVENT_ID_RTC_CHANGE, which is documentated to always
provide the new offset of the domain's real time clock from UTC. The
problem was that, in the case that qemu is provided with an "-rtc
base=x" where x is an absolute time (rather than "utc" or
"localtime"), the offset sent by qemu's RTC_CHANGE event is *not* the
new offset from UTC, but rather is the sum of all changes to the
domain's RTC since it was started with base=x.
So, despite what was said in commit e31b5cf393857, if we assume that
the original value stored in "adjustment" was the offset from UTC at
the time the domain was started, we can always determine the current
offset from UTC by simply adding the most recent (i.e. current) offset
from qemu to that original adjustment.
This patch accomplishes that by storing the initial adjustment in the
domain's status as "adjustment0". Each time a new RTC_CHANGE event is
received from qemu, we simply add adjustment0 to the value sent by
qemu, store that as the new adjustment, and forward that value on to
any event handler.
This patch (*not* e31b5cf393857, which should be reverted prior to
applying this patch) fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=964177
(for the case where basis='utc'. It does not fix basis='localtime')
2014-05-21 09:54:34 +00:00
|
|
|
|
|
|
|
/* domain start-time adjustment. This is a
|
|
|
|
* private/internal read-only value that only exists when
|
|
|
|
* a domain is running, and only if the clock
|
|
|
|
* offset='variable'
|
|
|
|
*/
|
|
|
|
long long adjustment0;
|
2012-02-06 13:59:16 +00:00
|
|
|
} variable;
|
2010-02-02 18:28:44 +00:00
|
|
|
|
|
|
|
/* Timezone name, when
|
|
|
|
* offset == VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME */
|
|
|
|
char *timezone;
|
|
|
|
} data;
|
2010-03-30 11:44:22 +00:00
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t ntimers;
|
2010-03-30 11:44:22 +00:00
|
|
|
virDomainTimerDefPtr *timers;
|
2010-02-02 17:22:03 +00:00
|
|
|
};
|
|
|
|
|
2011-03-29 13:33:36 +00:00
|
|
|
|
2013-12-11 08:29:48 +00:00
|
|
|
struct _virBlkioDevice {
|
2011-11-08 11:00:33 +00:00
|
|
|
char *path;
|
|
|
|
unsigned int weight;
|
2013-12-11 08:29:49 +00:00
|
|
|
unsigned int riops;
|
|
|
|
unsigned int wiops;
|
|
|
|
unsigned long long rbps;
|
|
|
|
unsigned long long wbps;
|
2011-11-08 11:00:33 +00:00
|
|
|
};
|
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2013-01-11 16:34:37 +00:00
|
|
|
VIR_DOMAIN_RNG_MODEL_VIRTIO,
|
2019-01-17 17:52:35 +00:00
|
|
|
VIR_DOMAIN_RNG_MODEL_VIRTIO_TRANSITIONAL,
|
|
|
|
VIR_DOMAIN_RNG_MODEL_VIRTIO_NON_TRANSITIONAL,
|
2013-01-11 16:34:37 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_RNG_MODEL_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainRNGModel;
|
2013-01-11 16:34:37 +00:00
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2013-01-11 16:34:37 +00:00
|
|
|
VIR_DOMAIN_RNG_BACKEND_RANDOM,
|
|
|
|
VIR_DOMAIN_RNG_BACKEND_EGD,
|
2020-01-09 08:00:07 +00:00
|
|
|
VIR_DOMAIN_RNG_BACKEND_BUILTIN,
|
2013-01-11 16:34:37 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_RNG_BACKEND_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainRNGBackend;
|
2013-01-11 16:34:37 +00:00
|
|
|
|
|
|
|
struct _virDomainRNGDef {
|
|
|
|
int model;
|
|
|
|
int backend;
|
2013-02-13 14:37:39 +00:00
|
|
|
unsigned int rate; /* bytes per period */
|
|
|
|
unsigned int period; /* milliseconds */
|
2013-01-11 16:34:37 +00:00
|
|
|
|
|
|
|
union {
|
|
|
|
char *file; /* file name for 'random' source */
|
|
|
|
virDomainChrSourceDefPtr chardev; /* a char backend for
|
|
|
|
the EGD source */
|
|
|
|
} source;
|
|
|
|
|
|
|
|
virDomainDeviceInfo info;
|
2016-06-06 15:01:56 +00:00
|
|
|
virDomainVirtioOptionsPtr virtio;
|
2013-01-11 16:34:37 +00:00
|
|
|
};
|
|
|
|
|
2014-09-29 17:02:04 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_MEMORY_MODEL_NONE,
|
|
|
|
VIR_DOMAIN_MEMORY_MODEL_DIMM, /* dimm hotpluggable memory device */
|
2016-07-28 16:54:18 +00:00
|
|
|
VIR_DOMAIN_MEMORY_MODEL_NVDIMM, /* nvdimm memory device */
|
2020-12-07 14:24:17 +00:00
|
|
|
VIR_DOMAIN_MEMORY_MODEL_VIRTIO_PMEM, /* virtio-pmem memory device */
|
2014-09-29 17:02:04 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_MEMORY_MODEL_LAST
|
|
|
|
} virDomainMemoryModel;
|
|
|
|
|
|
|
|
struct _virDomainMemoryDef {
|
2016-08-01 12:59:38 +00:00
|
|
|
virDomainMemoryAccess access;
|
2018-05-11 13:08:53 +00:00
|
|
|
virTristateBool discard;
|
2016-08-01 12:59:38 +00:00
|
|
|
|
2014-09-29 17:02:04 +00:00
|
|
|
/* source */
|
|
|
|
virBitmapPtr sourceNodes;
|
|
|
|
unsigned long long pagesize; /* kibibytes */
|
2020-12-07 14:24:17 +00:00
|
|
|
char *nvdimmPath; /* valid for NVDIMM an VIRTIO_PMEM */
|
2018-12-20 09:14:40 +00:00
|
|
|
unsigned long long alignsize; /* kibibytes; valid only for NVDIMM */
|
2018-12-20 09:14:41 +00:00
|
|
|
bool nvdimmPmem; /* valid only for NVDIMM */
|
2014-09-29 17:02:04 +00:00
|
|
|
|
|
|
|
/* target */
|
2020-10-31 20:24:08 +00:00
|
|
|
virDomainMemoryModel model;
|
2015-10-07 11:52:45 +00:00
|
|
|
int targetNode;
|
2014-09-29 17:02:04 +00:00
|
|
|
unsigned long long size; /* kibibytes */
|
2017-02-27 10:20:26 +00:00
|
|
|
unsigned long long labelsize; /* kibibytes; valid only for NVDIMM */
|
2018-12-20 09:14:42 +00:00
|
|
|
bool readonly; /* valid only for NVDIMM */
|
2014-09-29 17:02:04 +00:00
|
|
|
|
2020-03-23 19:40:47 +00:00
|
|
|
/* required for QEMU NVDIMM ppc64 support */
|
2021-01-18 13:10:30 +00:00
|
|
|
unsigned char *uuid; /* VIR_UUID_BUFLEN bytes long */
|
2020-03-23 19:40:47 +00:00
|
|
|
|
2014-09-29 17:02:04 +00:00
|
|
|
virDomainDeviceInfo info;
|
|
|
|
};
|
|
|
|
|
|
|
|
void virDomainMemoryDefFree(virDomainMemoryDefPtr def);
|
|
|
|
|
2013-06-07 07:12:18 +00:00
|
|
|
struct _virDomainIdMapEntry {
|
|
|
|
unsigned int start;
|
|
|
|
unsigned int target;
|
|
|
|
unsigned int count;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _virDomainIdMapDef {
|
|
|
|
size_t nuidmap;
|
|
|
|
virDomainIdMapEntryPtr uidmap;
|
|
|
|
|
|
|
|
size_t ngidmap;
|
|
|
|
virDomainIdMapEntryPtr gidmap;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-11-24 12:26:31 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_PANIC_MODEL_DEFAULT,
|
|
|
|
VIR_DOMAIN_PANIC_MODEL_ISA,
|
|
|
|
VIR_DOMAIN_PANIC_MODEL_PSERIES,
|
|
|
|
VIR_DOMAIN_PANIC_MODEL_HYPERV,
|
2016-04-29 13:23:41 +00:00
|
|
|
VIR_DOMAIN_PANIC_MODEL_S390,
|
2015-11-24 12:26:31 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_PANIC_MODEL_LAST
|
|
|
|
} virDomainPanicModel;
|
|
|
|
|
2013-12-09 09:11:14 +00:00
|
|
|
struct _virDomainPanicDef {
|
2015-11-24 12:26:31 +00:00
|
|
|
int model; /* virDomainPanicModel */
|
2013-12-09 09:11:14 +00:00
|
|
|
virDomainDeviceInfo info;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2013-12-11 08:29:48 +00:00
|
|
|
void virBlkioDeviceArrayClear(virBlkioDevicePtr deviceWeights,
|
2013-12-11 08:29:47 +00:00
|
|
|
int ndevices);
|
2011-11-08 11:00:33 +00:00
|
|
|
|
2013-03-21 11:28:10 +00:00
|
|
|
struct _virDomainResourceDef {
|
|
|
|
char *partition;
|
|
|
|
};
|
2011-11-08 11:00:33 +00:00
|
|
|
|
2014-09-16 16:41:12 +00:00
|
|
|
struct _virDomainHugePage {
|
2014-07-23 15:37:20 +00:00
|
|
|
virBitmapPtr nodemask; /* guest's NUMA node mask */
|
|
|
|
unsigned long long size; /* hugepage size in KiB */
|
|
|
|
};
|
|
|
|
|
2020-06-11 11:53:27 +00:00
|
|
|
#define VIR_DOMAIN_CPUMASK_LEN 16384
|
2015-05-21 14:16:15 +00:00
|
|
|
|
2015-04-02 23:59:25 +00:00
|
|
|
struct _virDomainIOThreadIDDef {
|
|
|
|
bool autofill;
|
|
|
|
unsigned int iothread_id;
|
2015-04-10 13:21:23 +00:00
|
|
|
int thread_id;
|
2015-04-21 19:43:05 +00:00
|
|
|
virBitmapPtr cpumask;
|
2016-01-29 14:12:26 +00:00
|
|
|
|
|
|
|
virDomainThreadSchedParam sched;
|
2015-04-02 23:59:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void virDomainIOThreadIDDefFree(virDomainIOThreadIDDefPtr def);
|
|
|
|
|
2015-05-21 14:16:15 +00:00
|
|
|
|
2014-09-16 16:41:12 +00:00
|
|
|
struct _virDomainCputune {
|
2016-05-25 10:14:00 +00:00
|
|
|
unsigned long long shares;
|
2014-09-16 16:41:12 +00:00
|
|
|
bool sharesSpecified;
|
|
|
|
unsigned long long period;
|
|
|
|
long long quota;
|
2016-02-16 13:43:33 +00:00
|
|
|
unsigned long long global_period;
|
2016-02-16 13:43:34 +00:00
|
|
|
long long global_quota;
|
2014-09-16 16:41:12 +00:00
|
|
|
unsigned long long emulator_period;
|
|
|
|
long long emulator_quota;
|
2016-07-25 11:04:38 +00:00
|
|
|
unsigned long long iothread_period;
|
|
|
|
long long iothread_quota;
|
2015-05-21 12:55:18 +00:00
|
|
|
virBitmapPtr emulatorpin;
|
2019-04-15 08:45:38 +00:00
|
|
|
virDomainThreadSchedParamPtr emulatorsched;
|
2014-09-16 16:41:12 +00:00
|
|
|
};
|
|
|
|
|
2015-10-23 07:38:01 +00:00
|
|
|
|
2018-11-12 13:31:44 +00:00
|
|
|
struct _virDomainResctrlMonDef {
|
|
|
|
virBitmapPtr vcpus;
|
|
|
|
virResctrlMonitorType tag;
|
|
|
|
virResctrlMonitorPtr instance;
|
|
|
|
};
|
|
|
|
|
2018-07-30 03:12:35 +00:00
|
|
|
struct _virDomainResctrlDef {
|
2017-11-10 13:47:05 +00:00
|
|
|
virBitmapPtr vcpus;
|
|
|
|
virResctrlAllocPtr alloc;
|
2018-11-12 13:31:44 +00:00
|
|
|
|
|
|
|
virDomainResctrlMonDefPtr *monitors;
|
|
|
|
size_t nmonitors;
|
2017-11-10 13:47:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2016-06-29 11:16:22 +00:00
|
|
|
struct _virDomainVcpuDef {
|
2015-10-23 07:38:01 +00:00
|
|
|
bool online;
|
2016-08-02 15:58:43 +00:00
|
|
|
virTristateBool hotpluggable;
|
|
|
|
unsigned int order;
|
|
|
|
|
2016-01-29 09:20:44 +00:00
|
|
|
virBitmapPtr cpumask;
|
2016-01-12 12:12:05 +00:00
|
|
|
|
|
|
|
virDomainThreadSchedParam sched;
|
2016-06-29 12:55:24 +00:00
|
|
|
|
|
|
|
virObjectPtr privateData;
|
2015-10-23 07:38:01 +00:00
|
|
|
};
|
|
|
|
|
2014-09-16 16:41:12 +00:00
|
|
|
struct _virDomainBlkiotune {
|
|
|
|
unsigned int weight;
|
|
|
|
|
|
|
|
size_t ndevices;
|
|
|
|
virBlkioDevicePtr devices;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _virDomainMemtune {
|
2015-09-16 12:25:42 +00:00
|
|
|
/* total memory size including memory modules in kibibytes, this field
|
|
|
|
* should be accessed only via accessors */
|
|
|
|
unsigned long long total_memory;
|
2014-10-30 19:42:44 +00:00
|
|
|
unsigned long long cur_balloon; /* in kibibytes, capped at ulong thanks
|
|
|
|
to virDomainGetInfo */
|
2014-09-16 16:41:12 +00:00
|
|
|
|
|
|
|
virDomainHugePagePtr hugepages;
|
|
|
|
size_t nhugepages;
|
|
|
|
|
2014-08-11 15:40:32 +00:00
|
|
|
/* maximum supported memory for a guest, for hotplugging */
|
|
|
|
unsigned long long max_memory; /* in kibibytes */
|
|
|
|
unsigned int memory_slots; /* maximum count of RAM memory slots */
|
|
|
|
|
2014-09-16 16:41:12 +00:00
|
|
|
bool nosharepages;
|
|
|
|
bool locked;
|
|
|
|
int dump_core; /* enum virTristateSwitch */
|
2014-10-30 19:42:44 +00:00
|
|
|
unsigned long long hard_limit; /* in kibibytes, limit at off_t bytes */
|
|
|
|
unsigned long long soft_limit; /* in kibibytes, limit at off_t bytes */
|
|
|
|
unsigned long long min_guarantee; /* in kibibytes, limit at off_t bytes */
|
|
|
|
unsigned long long swap_hard_limit; /* in kibibytes, limit at off_t bytes */
|
2017-02-02 13:27:32 +00:00
|
|
|
|
|
|
|
int source; /* enum virDomainMemorySource */
|
|
|
|
int access; /* enum virDomainMemoryAccess */
|
|
|
|
int allocation; /* enum virDomainMemoryAllocation */
|
2018-05-11 13:08:53 +00:00
|
|
|
|
|
|
|
virTristateBool discard;
|
2014-09-16 16:41:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _virDomainPowerManagement {
|
|
|
|
/* These options are of type enum virTristateBool */
|
|
|
|
int s3;
|
|
|
|
int s4;
|
|
|
|
};
|
|
|
|
|
2016-03-28 13:30:30 +00:00
|
|
|
struct _virDomainPerfDef {
|
|
|
|
/* These options are of type enum virTristateBool */
|
|
|
|
int events[VIR_PERF_EVENT_LAST];
|
|
|
|
};
|
|
|
|
|
2015-04-27 21:57:27 +00:00
|
|
|
struct _virDomainKeyWrapDef {
|
|
|
|
int aes; /* enum virTristateSwitch */
|
|
|
|
int dea; /* enum virTristateSwitch */
|
|
|
|
};
|
|
|
|
|
2018-06-08 14:40:56 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_LAUNCH_SECURITY_NONE,
|
|
|
|
VIR_DOMAIN_LAUNCH_SECURITY_SEV,
|
|
|
|
|
|
|
|
VIR_DOMAIN_LAUNCH_SECURITY_LAST,
|
|
|
|
} virDomainLaunchSecurity;
|
|
|
|
|
|
|
|
|
2018-06-12 11:27:16 +00:00
|
|
|
struct _virDomainSEVDef {
|
2018-06-08 14:40:56 +00:00
|
|
|
int sectype; /* enum virDomainLaunchSecurity */
|
|
|
|
char *dh_cert;
|
|
|
|
char *session;
|
|
|
|
unsigned int policy;
|
2020-10-08 12:11:45 +00:00
|
|
|
bool haveCbitpos;
|
2018-06-08 14:40:56 +00:00
|
|
|
unsigned int cbitpos;
|
2020-10-08 12:11:45 +00:00
|
|
|
bool haveReducedPhysBits;
|
2018-06-08 14:40:56 +00:00
|
|
|
unsigned int reduced_phys_bits;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2016-06-22 14:28:22 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_IOMMU_MODEL_INTEL,
|
2019-05-17 11:23:16 +00:00
|
|
|
VIR_DOMAIN_IOMMU_MODEL_SMMUV3,
|
2016-06-22 14:28:22 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_IOMMU_MODEL_LAST
|
|
|
|
} virDomainIOMMUModel;
|
|
|
|
|
|
|
|
struct _virDomainIOMMUDef {
|
|
|
|
virDomainIOMMUModel model;
|
2017-03-17 07:35:22 +00:00
|
|
|
virTristateSwitch intremap;
|
2017-03-17 07:27:49 +00:00
|
|
|
virTristateSwitch caching_mode;
|
2017-05-17 15:22:30 +00:00
|
|
|
virTristateSwitch eim;
|
2017-05-03 15:07:55 +00:00
|
|
|
virTristateSwitch iotlb;
|
2020-06-04 07:42:42 +00:00
|
|
|
unsigned int aw_bits;
|
2016-06-22 14:28:22 +00:00
|
|
|
};
|
2017-05-24 14:44:44 +00:00
|
|
|
|
2018-05-22 09:21:15 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_VSOCK_MODEL_DEFAULT,
|
|
|
|
VIR_DOMAIN_VSOCK_MODEL_VIRTIO,
|
2019-01-17 17:52:40 +00:00
|
|
|
VIR_DOMAIN_VSOCK_MODEL_VIRTIO_TRANSITIONAL,
|
|
|
|
VIR_DOMAIN_VSOCK_MODEL_VIRTIO_NON_TRANSITIONAL,
|
2018-05-22 09:21:15 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_VSOCK_MODEL_LAST
|
|
|
|
} virDomainVsockModel;
|
|
|
|
|
2018-05-22 08:37:50 +00:00
|
|
|
struct _virDomainVsockDef {
|
2018-05-17 14:58:24 +00:00
|
|
|
virObjectPtr privateData;
|
2018-05-22 09:21:15 +00:00
|
|
|
|
|
|
|
virDomainVsockModel model;
|
|
|
|
unsigned int guest_cid;
|
|
|
|
virTristateBool auto_cid;
|
|
|
|
|
|
|
|
virDomainDeviceInfo info;
|
2021-01-27 18:46:59 +00:00
|
|
|
virDomainVirtioOptionsPtr virtio;
|
2018-05-22 08:37:50 +00:00
|
|
|
};
|
|
|
|
|
2017-05-24 14:44:44 +00:00
|
|
|
struct _virDomainVirtioOptions {
|
|
|
|
virTristateSwitch iommu;
|
|
|
|
virTristateSwitch ats;
|
2020-04-06 13:13:25 +00:00
|
|
|
virTristateSwitch packed;
|
2017-05-24 14:44:44 +00:00
|
|
|
};
|
|
|
|
|
2011-05-27 09:47:30 +00:00
|
|
|
/*
|
|
|
|
* Guest VM main configuration
|
|
|
|
*
|
|
|
|
* NB: if adding to this struct, virDomainDefCheckABIStability
|
|
|
|
* may well need an update
|
|
|
|
*/
|
2008-07-11 16:23:36 +00:00
|
|
|
struct _virDomainDef {
|
2018-07-26 14:47:23 +00:00
|
|
|
int virtType; /* enum virDomainVirtType */
|
2008-07-11 16:23:36 +00:00
|
|
|
int id;
|
|
|
|
unsigned char uuid[VIR_UUID_BUFLEN];
|
2018-04-09 16:10:02 +00:00
|
|
|
|
|
|
|
unsigned char genid[VIR_UUID_BUFLEN];
|
|
|
|
bool genidRequested;
|
|
|
|
bool genidGenerated;
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
char *name;
|
2012-02-01 13:03:49 +00:00
|
|
|
char *title;
|
2009-09-30 14:07:24 +00:00
|
|
|
char *description;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2014-09-16 16:41:12 +00:00
|
|
|
virDomainBlkiotune blkio;
|
|
|
|
virDomainMemtune mem;
|
2011-02-08 06:59:38 +00:00
|
|
|
|
2016-06-29 12:08:33 +00:00
|
|
|
virDomainVcpuDefPtr *vcpus;
|
2015-10-26 14:16:58 +00:00
|
|
|
size_t maxvcpus;
|
2016-08-02 15:58:43 +00:00
|
|
|
/* set if the vcpu definition was specified individually */
|
|
|
|
bool individualvcpus;
|
2012-03-08 13:36:26 +00:00
|
|
|
int placement_mode;
|
2012-09-14 07:47:01 +00:00
|
|
|
virBitmapPtr cpumask;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2015-04-02 23:59:25 +00:00
|
|
|
size_t niothreadids;
|
|
|
|
virDomainIOThreadIDDefPtr *iothreadids;
|
2014-08-22 14:15:51 +00:00
|
|
|
|
2014-09-16 16:41:12 +00:00
|
|
|
virDomainCputune cputune;
|
2011-03-29 13:33:36 +00:00
|
|
|
|
2018-07-30 03:12:35 +00:00
|
|
|
virDomainResctrlDefPtr *resctrls;
|
|
|
|
size_t nresctrls;
|
2017-11-10 13:47:05 +00:00
|
|
|
|
2015-02-11 13:54:59 +00:00
|
|
|
virDomainNumaPtr numa;
|
2013-03-21 11:28:10 +00:00
|
|
|
virDomainResourceDefPtr resource;
|
2013-06-07 07:12:18 +00:00
|
|
|
virDomainIdMapDef idmap;
|
2011-06-20 07:15:44 +00:00
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
/* These 3 are based on virDomainLifeCycleAction enum flags */
|
|
|
|
int onReboot;
|
|
|
|
int onPoweroff;
|
|
|
|
int onCrash;
|
|
|
|
|
2012-09-06 20:17:01 +00:00
|
|
|
int onLockFailure; /* enum virDomainLockFailureAction */
|
|
|
|
|
2014-09-16 16:41:12 +00:00
|
|
|
virDomainPowerManagement pm;
|
2012-08-02 10:12:50 +00:00
|
|
|
|
2016-06-28 12:37:29 +00:00
|
|
|
virDomainPerfDef perf;
|
2016-03-28 13:30:30 +00:00
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
virDomainOSDef os;
|
|
|
|
char *emulator;
|
2018-02-06 13:30:40 +00:00
|
|
|
/* Most {caps_,hyperv_,kvm_,}feature options utilize a virTristateSwitch
|
|
|
|
* to handle support. A few assign specific data values to the option.
|
|
|
|
* See virDomainDefFeaturesCheckABIStability() for details. */
|
2013-09-23 13:02:38 +00:00
|
|
|
int features[VIR_DOMAIN_FEATURE_LAST];
|
2019-10-25 12:50:15 +00:00
|
|
|
int caps_features[VIR_DOMAIN_PROCES_CAPS_FEATURE_LAST];
|
2012-10-16 16:25:56 +00:00
|
|
|
int hyperv_features[VIR_DOMAIN_HYPERV_LAST];
|
2014-08-21 17:04:45 +00:00
|
|
|
int kvm_features[VIR_DOMAIN_KVM_LAST];
|
2019-01-24 03:23:31 +00:00
|
|
|
int msrs_features[VIR_DOMAIN_MSRS_LAST];
|
2020-04-14 02:37:04 +00:00
|
|
|
int xen_features[VIR_DOMAIN_XEN_LAST];
|
2020-04-15 22:34:54 +00:00
|
|
|
int xen_passthrough_mode;
|
2013-06-21 10:20:12 +00:00
|
|
|
unsigned int hyperv_spinlocks;
|
2019-08-09 14:31:39 +00:00
|
|
|
int hyperv_stimer_direct;
|
2016-02-03 13:33:28 +00:00
|
|
|
virGICVersion gic_version;
|
2018-05-23 16:17:57 +00:00
|
|
|
virDomainHPTResizing hpt_resizing;
|
2018-05-23 16:18:01 +00:00
|
|
|
unsigned long long hpt_maxpagesize; /* Stored in KiB */
|
2016-03-10 12:43:49 +00:00
|
|
|
char *hyperv_vendor_id;
|
2018-02-06 13:30:40 +00:00
|
|
|
int apic_eoi;
|
2014-07-18 08:02:29 +00:00
|
|
|
|
2018-05-10 19:32:26 +00:00
|
|
|
bool tseg_specified;
|
|
|
|
unsigned long long tseg_size;
|
|
|
|
|
2010-02-02 17:22:03 +00:00
|
|
|
virDomainClockDef clock;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t ngraphics;
|
2009-05-07 07:27:49 +00:00
|
|
|
virDomainGraphicsDefPtr *graphics;
|
2008-10-10 16:08:01 +00:00
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t ndisks;
|
2008-10-10 16:08:01 +00:00
|
|
|
virDomainDiskDefPtr *disks;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t ncontrollers;
|
2009-12-02 19:15:38 +00:00
|
|
|
virDomainControllerDefPtr *controllers;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nfss;
|
2008-10-10 16:08:01 +00:00
|
|
|
virDomainFSDefPtr *fss;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nnets;
|
2008-10-10 16:08:01 +00:00
|
|
|
virDomainNetDefPtr *nets;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t ninputs;
|
2008-10-10 16:08:01 +00:00
|
|
|
virDomainInputDefPtr *inputs;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nsounds;
|
2008-10-10 16:08:01 +00:00
|
|
|
virDomainSoundDefPtr *sounds;
|
|
|
|
|
2020-07-18 06:23:57 +00:00
|
|
|
size_t naudios;
|
|
|
|
virDomainAudioDefPtr *audios;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nvideos;
|
2009-07-06 13:54:44 +00:00
|
|
|
virDomainVideoDefPtr *videos;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nhostdevs;
|
2008-10-10 16:08:01 +00:00
|
|
|
virDomainHostdevDefPtr *hostdevs;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nredirdevs;
|
2011-09-02 15:09:14 +00:00
|
|
|
virDomainRedirdevDefPtr *redirdevs;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nsmartcards;
|
2011-01-10 16:41:33 +00:00
|
|
|
virDomainSmartcardDefPtr *smartcards;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nserials;
|
2008-10-10 16:08:01 +00:00
|
|
|
virDomainChrDefPtr *serials;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nparallels;
|
2008-10-10 16:08:01 +00:00
|
|
|
virDomainChrDefPtr *parallels;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nchannels;
|
2009-11-05 14:31:03 +00:00
|
|
|
virDomainChrDefPtr *channels;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nconsoles;
|
Allow multiple consoles per virtual guest
While Xen only has a single paravirt console, UML, and
QEMU both support multiple paravirt consoles. The LXC
driver can also be trivially made to support multiple
consoles. This patch extends the XML to allow multiple
<console> elements in the XML. It also makes the UML
and QEMU drivers support this config.
* src/conf/domain_conf.c, src/conf/domain_conf.h: Allow
multiple <console> devices
* src/lxc/lxc_driver.c, src/xen/xen_driver.c,
src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c: Update for
internal API changes
* src/security/security_selinux.c, src/security/virt-aa-helper.c:
Only label consoles that aren't a copy of the serial device
* src/qemu/qemu_command.c, src/qemu/qemu_driver.c,
src/qemu/qemu_process.c, src/uml/uml_conf.c,
src/uml/uml_driver.c: Support multiple console devices
* tests/qemuxml2xmltest.c, tests/qemuxml2argvtest.c: Extra
tests for multiple virtio consoles. Set QEMU_CAPS_CHARDEV
for all console /channel tests
* tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-auto.args,
tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.args
tests/qemuxml2argvdata/qemuxml2argv-console-virtio.args: Update
for correct chardev syntax
* tests/qemuxml2argvdata/qemuxml2argv-console-virtio-many.args,
tests/qemuxml2argvdata/qemuxml2argv-console-virtio-many.xml: New
test file
2011-02-23 18:27:23 +00:00
|
|
|
virDomainChrDefPtr *consoles;
|
|
|
|
|
2011-05-18 16:20:53 +00:00
|
|
|
size_t nleases;
|
2010-12-09 18:25:11 +00:00
|
|
|
virDomainLeaseDefPtr *leases;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nhubs;
|
2011-09-02 14:20:40 +00:00
|
|
|
virDomainHubDefPtr *hubs;
|
|
|
|
|
2012-08-15 22:10:35 +00:00
|
|
|
size_t nseclabels;
|
|
|
|
virSecurityLabelDefPtr *seclabels;
|
|
|
|
|
2013-02-25 22:31:11 +00:00
|
|
|
size_t nrngs;
|
|
|
|
virDomainRNGDefPtr *rngs;
|
|
|
|
|
2014-09-22 08:49:39 +00:00
|
|
|
size_t nshmems;
|
|
|
|
virDomainShmemDefPtr *shmems;
|
|
|
|
|
2014-09-29 17:02:04 +00:00
|
|
|
size_t nmems;
|
|
|
|
virDomainMemoryDefPtr *mems;
|
|
|
|
|
2015-11-24 12:26:36 +00:00
|
|
|
size_t npanics;
|
|
|
|
virDomainPanicDefPtr *panics;
|
|
|
|
|
2020-06-04 12:15:40 +00:00
|
|
|
size_t nsysinfo;
|
|
|
|
virSysinfoDefPtr *sysinfo;
|
|
|
|
|
2020-06-10 18:11:47 +00:00
|
|
|
/* At maximum 2 TPMs on the domain if a TPM Proxy is present. */
|
|
|
|
size_t ntpms;
|
|
|
|
virDomainTPMDefPtr *tpms;
|
|
|
|
|
2008-10-10 16:08:01 +00:00
|
|
|
/* Only 1 */
|
2009-10-21 12:26:38 +00:00
|
|
|
virDomainWatchdogDefPtr watchdog;
|
2010-07-15 13:02:42 +00:00
|
|
|
virDomainMemballoonDefPtr memballoon;
|
2013-04-19 08:37:51 +00:00
|
|
|
virDomainNVRAMDefPtr nvram;
|
2009-12-18 13:44:55 +00:00
|
|
|
virCPUDefPtr cpu;
|
2012-09-13 07:25:45 +00:00
|
|
|
virDomainRedirFilterDefPtr redirfilter;
|
2016-06-22 14:28:22 +00:00
|
|
|
virDomainIOMMUDefPtr iommu;
|
2018-05-22 09:21:15 +00:00
|
|
|
virDomainVsockDefPtr vsock;
|
2010-04-17 03:08:29 +00:00
|
|
|
|
|
|
|
void *namespaceData;
|
2019-08-20 21:39:24 +00:00
|
|
|
virXMLNamespace ns;
|
2012-01-24 02:26:18 +00:00
|
|
|
|
2015-04-27 21:57:27 +00:00
|
|
|
virDomainKeyWrapDefPtr keywrap;
|
|
|
|
|
2018-06-08 14:40:56 +00:00
|
|
|
/* SEV-specific domain */
|
2018-06-12 11:27:16 +00:00
|
|
|
virDomainSEVDefPtr sev;
|
2018-06-08 14:40:56 +00:00
|
|
|
|
2012-01-24 02:26:18 +00:00
|
|
|
/* Application-specific custom metadata */
|
|
|
|
xmlNodePtr metadata;
|
2017-08-15 16:41:59 +00:00
|
|
|
|
|
|
|
/* internal fields */
|
|
|
|
bool postParseFailed; /* set to true if one of the custom post parse
|
|
|
|
callbacks failed for a non-critical reason
|
|
|
|
(was not able to fill in some data) and thus
|
|
|
|
should be re-run before starting */
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
2015-10-16 14:10:27 +00:00
|
|
|
|
2015-10-08 04:44:30 +00:00
|
|
|
unsigned long long virDomainDefGetMemoryInitial(const virDomainDef *def);
|
2015-09-16 12:25:42 +00:00
|
|
|
void virDomainDefSetMemoryTotal(virDomainDefPtr def, unsigned long long size);
|
2016-06-15 13:34:04 +00:00
|
|
|
unsigned long long virDomainDefGetMemoryTotal(const virDomainDef *def);
|
2015-09-14 14:42:46 +00:00
|
|
|
bool virDomainDefHasMemoryHotplug(const virDomainDef *def);
|
2015-02-17 17:01:09 +00:00
|
|
|
|
2015-04-27 21:57:27 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_KEY_WRAP_CIPHER_NAME_AES,
|
|
|
|
VIR_DOMAIN_KEY_WRAP_CIPHER_NAME_DEA,
|
|
|
|
|
|
|
|
VIR_DOMAIN_KEY_WRAP_CIPHER_NAME_LAST
|
|
|
|
} virDomainKeyWrapCipherName;
|
|
|
|
|
2014-06-01 00:22:30 +00:00
|
|
|
typedef enum {
|
2011-05-04 10:40:59 +00:00
|
|
|
VIR_DOMAIN_TAINT_CUSTOM_ARGV, /* Custom ARGV passthrough from XML */
|
|
|
|
VIR_DOMAIN_TAINT_CUSTOM_MONITOR, /* Custom monitor commands issued */
|
|
|
|
VIR_DOMAIN_TAINT_HIGH_PRIVILEGES, /* Running with undesirably high privileges */
|
|
|
|
VIR_DOMAIN_TAINT_SHELL_SCRIPTS, /* Network configuration using opaque shell scripts */
|
|
|
|
VIR_DOMAIN_TAINT_DISK_PROBING, /* Relying on potentially unsafe disk format probing */
|
2011-05-05 16:32:21 +00:00
|
|
|
VIR_DOMAIN_TAINT_EXTERNAL_LAUNCH, /* Externally launched guest domain */
|
2020-10-04 17:51:27 +00:00
|
|
|
VIR_DOMAIN_TAINT_HOST_CPU, /* Host CPU passthrough in use after migration */
|
2014-02-04 15:36:37 +00:00
|
|
|
VIR_DOMAIN_TAINT_HOOK, /* Domain (possibly) changed via hook script */
|
2015-05-12 19:58:31 +00:00
|
|
|
VIR_DOMAIN_TAINT_CDROM_PASSTHROUGH,/* CDROM passthrough */
|
2016-03-07 13:24:51 +00:00
|
|
|
VIR_DOMAIN_TAINT_CUSTOM_DTB, /* Custom device tree blob was specified */
|
2017-11-14 16:28:48 +00:00
|
|
|
VIR_DOMAIN_TAINT_CUSTOM_GA_COMMAND, /* Custom guest agent command */
|
2019-06-17 15:31:45 +00:00
|
|
|
VIR_DOMAIN_TAINT_CUSTOM_HYPERVISOR_FEATURE, /* custom hypervisor feature control */
|
2011-05-04 10:40:59 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_TAINT_LAST
|
2014-06-01 00:22:30 +00:00
|
|
|
} virDomainTaintFlags;
|
2011-05-04 10:40:59 +00:00
|
|
|
|
2020-12-10 18:58:44 +00:00
|
|
|
typedef enum {
|
|
|
|
DOMAIN_DEVICE_ITERATE_ALL_CONSOLES = 1 << 0,
|
|
|
|
DOMAIN_DEVICE_ITERATE_MISSING_INFO = 1 << 1,
|
|
|
|
} virDomainDeviceIterateFlags;
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
/* Guest VM runtime state */
|
2011-05-04 09:07:01 +00:00
|
|
|
typedef struct _virDomainStateReason virDomainStateReason;
|
|
|
|
struct _virDomainStateReason {
|
|
|
|
int state;
|
|
|
|
int reason;
|
|
|
|
};
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
struct _virDomainObj {
|
2013-01-09 21:00:32 +00:00
|
|
|
virObjectLockable parent;
|
2015-05-26 14:43:58 +00:00
|
|
|
virCond cond;
|
2008-12-04 22:00:14 +00:00
|
|
|
|
build: use correct type for pid and similar types
No thanks to 64-bit windows, with 64-bit pid_t, we have to avoid
constructs like 'int pid'. Our API in libvirt-qemu cannot be
changed without breaking ABI; but then again, libvirt-qemu can
only be used on systems that support UNIX sockets, which rules
out Windows (even if qemu could be compiled there) - so for all
points on the call chain that interact with this API decision,
we require a different variable name to make it clear that we
audited the use for safety.
Adding a syntax-check rule only solves half the battle; anywhere
that uses printf on a pid_t still needs to be converted, but that
will be a separate patch.
* cfg.mk (sc_correct_id_types): New syntax check.
* src/libvirt-qemu.c (virDomainQemuAttach): Document why we didn't
use pid_t for pid, and validate for overflow.
* include/libvirt/libvirt-qemu.h (virDomainQemuAttach): Tweak name
for syntax check.
* src/vmware/vmware_conf.c (vmwareExtractPid): Likewise.
* src/driver.h (virDrvDomainQemuAttach): Likewise.
* tools/virsh.c (cmdQemuAttach): Likewise.
* src/remote/qemu_protocol.x (qemu_domain_attach_args): Likewise.
* src/qemu_protocol-structs (qemu_domain_attach_args): Likewise.
* src/util/cgroup.c (virCgroupPidCode, virCgroupKillInternal):
Likewise.
* src/qemu/qemu_command.c(qemuParseProcFileStrings): Likewise.
(qemuParseCommandLinePid): Use pid_t for pid.
* daemon/libvirtd.c (daemonForkIntoBackground): Likewise.
* src/conf/domain_conf.h (_virDomainObj): Likewise.
* src/probes.d (rpc_socket_new): Likewise.
* src/qemu/qemu_command.h (qemuParseCommandLinePid): Likewise.
* src/qemu/qemu_driver.c (qemudGetProcessInfo, qemuDomainAttach):
Likewise.
* src/qemu/qemu_process.c (qemuProcessAttach): Likewise.
* src/qemu/qemu_process.h (qemuProcessAttach): Likewise.
* src/uml/uml_driver.c (umlGetProcessInfo): Likewise.
* src/util/virnetdev.h (virNetDevSetNamespace): Likewise.
* src/util/virnetdev.c (virNetDevSetNamespace): Likewise.
* tests/testutils.c (virtTestCaptureProgramOutput): Likewise.
* src/conf/storage_conf.h (_virStoragePerms): Use mode_t, uid_t,
and gid_t rather than int.
* src/security/security_dac.c (virSecurityDACSetOwnership): Likewise.
* src/conf/storage_conf.c (virStorageDefParsePerms): Avoid
compiler warning.
2012-02-10 23:08:11 +00:00
|
|
|
pid_t pid;
|
2011-05-04 09:07:01 +00:00
|
|
|
virDomainStateReason state;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
|
|
|
unsigned int autostart : 1;
|
|
|
|
unsigned int persistent : 1;
|
2010-11-15 03:23:32 +00:00
|
|
|
unsigned int updated : 1;
|
2014-12-11 10:14:08 +00:00
|
|
|
unsigned int removing : 1;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
|
|
|
virDomainDefPtr def; /* The current definition */
|
|
|
|
virDomainDefPtr newDef; /* New definition to activate at shutdown */
|
2009-10-06 11:50:58 +00:00
|
|
|
|
snapshot: make virDomainSnapshotObjList opaque
We were failing to react to allocation failure when initializing
a snapshot object list. Changing things to store a pointer
instead of a complete object adds one more possible point of
allocation failure, but at the same time, will make it easier to
react to failure now, as well as making it easier for a future
patch to split all virDomainSnapshotPtr handling into a separate
file, as I continue to add even more snapshot code.
Luckily, there was only one client outside of domain_conf.c that
was actually peeking inside the object, and a new wrapper function
was easy.
* src/conf/domain_conf.h (_virDomainObj): Use a pointer.
(virDomainSnapshotObjListInit): Rename.
(virDomainSnapshotObjListFree, virDomainSnapshotForEach): New
declarations.
(_virDomainSnapshotObjList): Move definitions...
* src/conf/domain_conf.c: ...here.
(virDomainSnapshotObjListInit, virDomainSnapshotObjListDeinit):
Rename...
(virDomainSnapshotObjListNew, virDomainSnapshotObjListFree): ...to
these.
(virDomainSnapshotForEach): New function.
(virDomainObjDispose, virDomainListPopulate): Adjust callers.
* src/qemu/qemu_domain.c (qemuDomainSnapshotDiscard)
(qemuDomainSnapshotDiscardAllMetadata): Likewise.
* src/qemu/qemu_migration.c (qemuMigrationIsAllowed): Likewise.
* src/qemu/qemu_driver.c (qemuDomainSnapshotLoad)
(qemuDomainUndefineFlags, qemuDomainSnapshotCreateXML)
(qemuDomainSnapshotListNames, qemuDomainSnapshotNum)
(qemuDomainListAllSnapshots)
(qemuDomainSnapshotListChildrenNames)
(qemuDomainSnapshotNumChildren)
(qemuDomainSnapshotListAllChildren)
(qemuDomainSnapshotLookupByName, qemuDomainSnapshotGetParent)
(qemuDomainSnapshotGetXMLDesc, qemuDomainSnapshotIsCurrent)
(qemuDomainSnapshotHasMetadata, qemuDomainRevertToSnapshot)
(qemuDomainSnapshotDelete): Likewise.
* src/libvirt_private.syms (domain_conf.h): Export new function.
2012-08-14 06:22:39 +00:00
|
|
|
virDomainSnapshotObjListPtr snapshots;
|
2010-04-02 14:41:30 +00:00
|
|
|
|
2012-06-11 09:03:27 +00:00
|
|
|
bool hasManagedSave;
|
|
|
|
|
2019-07-26 19:28:44 +00:00
|
|
|
virDomainCheckpointObjListPtr checkpoints;
|
|
|
|
|
2009-10-06 11:50:58 +00:00
|
|
|
void *privateData;
|
|
|
|
void (*privateDataFreeFunc)(void *);
|
2011-05-04 10:40:59 +00:00
|
|
|
|
|
|
|
int taint;
|
2015-12-10 18:13:58 +00:00
|
|
|
|
|
|
|
unsigned long long original_memlock; /* Original RLIMIT_MEMLOCK, zero if no
|
|
|
|
* restore will be required later */
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
2019-10-04 16:14:10 +00:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainObj, virObjectUnref);
|
|
|
|
|
|
|
|
|
2015-04-29 13:25:34 +00:00
|
|
|
typedef bool (*virDomainObjListACLFilter)(virConnectPtr conn,
|
|
|
|
virDomainDefPtr def);
|
2013-06-24 16:49:47 +00:00
|
|
|
|
2013-03-05 15:17:24 +00:00
|
|
|
|
2018-02-06 13:08:14 +00:00
|
|
|
/* NB: Any new flag to this list be considered to be set in
|
|
|
|
* virt-aa-helper code if the flag prevents parsing. */
|
2016-02-23 09:32:19 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_DEF_FEATURE_WIDE_SCSI = (1 << 0),
|
2016-02-23 09:58:10 +00:00
|
|
|
VIR_DOMAIN_DEF_FEATURE_MEMORY_HOTPLUG = (1 << 1),
|
2016-02-23 11:35:40 +00:00
|
|
|
VIR_DOMAIN_DEF_FEATURE_OFFLINE_VCPUPIN = (1 << 2),
|
2016-04-26 15:23:12 +00:00
|
|
|
VIR_DOMAIN_DEF_FEATURE_NAME_SLASH = (1 << 3),
|
2016-08-02 15:58:43 +00:00
|
|
|
VIR_DOMAIN_DEF_FEATURE_INDIVIDUAL_VCPUS = (1 << 4),
|
2017-10-18 12:59:01 +00:00
|
|
|
VIR_DOMAIN_DEF_FEATURE_USER_ALIAS = (1 << 5),
|
2018-05-28 13:16:16 +00:00
|
|
|
VIR_DOMAIN_DEF_FEATURE_NO_BOOT_ORDER = (1 << 6),
|
2019-02-22 14:25:17 +00:00
|
|
|
VIR_DOMAIN_DEF_FEATURE_FW_AUTOSELECT = (1 << 7),
|
2019-01-18 20:57:32 +00:00
|
|
|
VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING = (1 << 8),
|
2016-02-23 09:32:19 +00:00
|
|
|
} virDomainDefFeatures;
|
|
|
|
|
|
|
|
|
2017-08-15 13:11:45 +00:00
|
|
|
/* Called after everything else has been parsed, for adjusting basics.
|
|
|
|
* This has similar semantics to virDomainDefPostParseCallback, but no
|
|
|
|
* parseOpaque is used. This callback is run prior to
|
|
|
|
* virDomainDefPostParseCallback. */
|
|
|
|
typedef int (*virDomainDefPostParseBasicCallback)(virDomainDefPtr def,
|
|
|
|
void *opaque);
|
|
|
|
|
maint: avoid 'const fooPtr' in domain_conf
'const fooPtr' is the same as 'foo * const' (the pointer won't
change, but it's contents can). But in general, if an interface
is trying to be const-correct, it should be using 'const foo *'
(the pointer is to data that can't be changed).
Fix up offenders in src/conf/domain_conf, and their fallout.
Several things to note: virObjectLock() requires a non-const
argument; if this were C++, we could treat the locking field
as 'mutable' and allow locking an otherwise 'const' object, but
that is a more invasive change, so I instead dropped attempts
to be const-correct on domain lookup. virXMLPropString and
friends require a non-const xmlNodePtr - this is because libxml2
is not a const-correct library. We could make the src/util/virxml
wrappers cast away const, but I figured it was easier to not
try to mark xmlNodePtr as const. Finally, virDomainDeviceDefCopy
was a rather hard conversion - it calls virDomainDeviceDefPostParse,
which in turn in the xen driver was actually modifying the domain
outside of the current device being visited. We should not be
adding a device on the first per-device callback, but waiting until
after all per-device callbacks are complete.
* src/conf/domain_conf.h (virDomainObjListFindByID)
(virDomainObjListFindByUUID, virDomainObjListFindByName)
(virDomainObjAssignDef, virDomainObjListAdd): Drop attempt at
const.
(virDomainDeviceDefCopy): Use intended type.
(virDomainDeviceDefParse, virDomainDeviceDefPostParseCallback)
(virDomainVideoDefaultType, virDomainVideoDefaultRAM)
(virDomainChrGetDomainPtrs): Make const-correct.
* src/conf/domain_conf.c (virDomainObjListFindByID)
(virDomainObjListFindByUUID, virDomainObjListFindByName)
(virDomainDeviceDefCopy, virDomainObjListAdd)
(virDomainObjAssignDef, virDomainHostdevSubsysUsbDefParseXML)
(virDomainHostdevSubsysPciOrigStatesDefParseXML)
(virDomainHostdevSubsysPciDefParseXML)
(virDomainHostdevSubsysScsiDefParseXML)
(virDomainControllerModelTypeFromString)
(virDomainTPMDefParseXML, virDomainTimerDefParseXML)
(virDomainSoundCodecDefParseXML, virDomainSoundDefParseXML)
(virDomainWatchdogDefParseXML, virDomainRNGDefParseXML)
(virDomainMemballoonDefParseXML, virDomainNVRAMDefParseXML)
(virSysinfoParseXML, virDomainVideoAccelDefParseXML)
(virDomainVideoDefParseXML, virDomainHostdevDefParseXML)
(virDomainRedirdevDefParseXML)
(virDomainRedirFilterUsbDevDefParseXML)
(virDomainRedirFilterDefParseXML, virDomainIdMapEntrySort)
(virDomainIdmapDefParseXML, virDomainVcpuPinDefParseXML)
(virDiskNameToBusDeviceIndex, virDomainDeviceDefCopy)
(virDomainVideoDefaultType, virDomainHostdevAssignAddress)
(virDomainDeviceDefPostParseInternal, virDomainDeviceDefPostParse)
(virDomainChrGetDomainPtrs, virDomainControllerSCSINextUnit)
(virDomainSCSIDriveAddressIsUsed)
(virDomainDriveAddressIsUsedByDisk)
(virDomainDriveAddressIsUsedByHostdev): Fix fallout.
* src/openvz/openvz_driver.c (openvzDomainDeviceDefPostParse):
Likewise.
* src/libxl/libxl_domain.c (libxlDomainDeviceDefPostParse):
Likewise.
* src/qemu/qemu_domain.c (qemuDomainDeviceDefPostParse)
(qemuDomainDefaultNetModel): Likewise.
* src/lxc/lxc_domain.c (virLXCDomainDeviceDefPostParse):
Likewise.
* src/uml/uml_driver.c (umlDomainDeviceDefPostParse): Likewise.
* src/xen/xen_driver.c (xenDomainDeviceDefPostParse): Split...
(xenDomainDefPostParse): ...since per-device callback is not the
time to be adding a device.
Signed-off-by: Eric Blake <eblake@redhat.com>
2013-10-08 15:08:25 +00:00
|
|
|
/* Called once after everything else has been parsed, for adjusting
|
2016-09-22 14:41:33 +00:00
|
|
|
* overall domain defaults.
|
|
|
|
* @parseOpaque is opaque data passed by virDomainDefParse* caller,
|
|
|
|
* @opaque is opaque data set by driver (usually pointer to driver
|
2017-08-15 16:41:59 +00:00
|
|
|
* private data). Non-fatal failures should be reported by returning 1. In
|
|
|
|
* cases when that is allowed, such failure is translated to a success return
|
|
|
|
* value and the failure is noted in def->postParseFailed. Drivers should then
|
|
|
|
* re-run the post parse callback when attempting to use such definition. */
|
2013-02-19 16:29:39 +00:00
|
|
|
typedef int (*virDomainDefPostParseCallback)(virDomainDefPtr def,
|
2016-01-08 13:00:56 +00:00
|
|
|
unsigned int parseFlags,
|
2016-09-22 14:41:33 +00:00
|
|
|
void *opaque,
|
|
|
|
void *parseOpaque);
|
maint: avoid 'const fooPtr' in domain_conf
'const fooPtr' is the same as 'foo * const' (the pointer won't
change, but it's contents can). But in general, if an interface
is trying to be const-correct, it should be using 'const foo *'
(the pointer is to data that can't be changed).
Fix up offenders in src/conf/domain_conf, and their fallout.
Several things to note: virObjectLock() requires a non-const
argument; if this were C++, we could treat the locking field
as 'mutable' and allow locking an otherwise 'const' object, but
that is a more invasive change, so I instead dropped attempts
to be const-correct on domain lookup. virXMLPropString and
friends require a non-const xmlNodePtr - this is because libxml2
is not a const-correct library. We could make the src/util/virxml
wrappers cast away const, but I figured it was easier to not
try to mark xmlNodePtr as const. Finally, virDomainDeviceDefCopy
was a rather hard conversion - it calls virDomainDeviceDefPostParse,
which in turn in the xen driver was actually modifying the domain
outside of the current device being visited. We should not be
adding a device on the first per-device callback, but waiting until
after all per-device callbacks are complete.
* src/conf/domain_conf.h (virDomainObjListFindByID)
(virDomainObjListFindByUUID, virDomainObjListFindByName)
(virDomainObjAssignDef, virDomainObjListAdd): Drop attempt at
const.
(virDomainDeviceDefCopy): Use intended type.
(virDomainDeviceDefParse, virDomainDeviceDefPostParseCallback)
(virDomainVideoDefaultType, virDomainVideoDefaultRAM)
(virDomainChrGetDomainPtrs): Make const-correct.
* src/conf/domain_conf.c (virDomainObjListFindByID)
(virDomainObjListFindByUUID, virDomainObjListFindByName)
(virDomainDeviceDefCopy, virDomainObjListAdd)
(virDomainObjAssignDef, virDomainHostdevSubsysUsbDefParseXML)
(virDomainHostdevSubsysPciOrigStatesDefParseXML)
(virDomainHostdevSubsysPciDefParseXML)
(virDomainHostdevSubsysScsiDefParseXML)
(virDomainControllerModelTypeFromString)
(virDomainTPMDefParseXML, virDomainTimerDefParseXML)
(virDomainSoundCodecDefParseXML, virDomainSoundDefParseXML)
(virDomainWatchdogDefParseXML, virDomainRNGDefParseXML)
(virDomainMemballoonDefParseXML, virDomainNVRAMDefParseXML)
(virSysinfoParseXML, virDomainVideoAccelDefParseXML)
(virDomainVideoDefParseXML, virDomainHostdevDefParseXML)
(virDomainRedirdevDefParseXML)
(virDomainRedirFilterUsbDevDefParseXML)
(virDomainRedirFilterDefParseXML, virDomainIdMapEntrySort)
(virDomainIdmapDefParseXML, virDomainVcpuPinDefParseXML)
(virDiskNameToBusDeviceIndex, virDomainDeviceDefCopy)
(virDomainVideoDefaultType, virDomainHostdevAssignAddress)
(virDomainDeviceDefPostParseInternal, virDomainDeviceDefPostParse)
(virDomainChrGetDomainPtrs, virDomainControllerSCSINextUnit)
(virDomainSCSIDriveAddressIsUsed)
(virDomainDriveAddressIsUsedByDisk)
(virDomainDriveAddressIsUsedByHostdev): Fix fallout.
* src/openvz/openvz_driver.c (openvzDomainDeviceDefPostParse):
Likewise.
* src/libxl/libxl_domain.c (libxlDomainDeviceDefPostParse):
Likewise.
* src/qemu/qemu_domain.c (qemuDomainDeviceDefPostParse)
(qemuDomainDefaultNetModel): Likewise.
* src/lxc/lxc_domain.c (virLXCDomainDeviceDefPostParse):
Likewise.
* src/uml/uml_driver.c (umlDomainDeviceDefPostParse): Likewise.
* src/xen/xen_driver.c (xenDomainDeviceDefPostParse): Split...
(xenDomainDefPostParse): ...since per-device callback is not the
time to be adding a device.
Signed-off-by: Eric Blake <eblake@redhat.com>
2013-10-08 15:08:25 +00:00
|
|
|
/* Called once per device, for adjusting per-device settings while
|
2016-09-23 08:53:38 +00:00
|
|
|
* leaving the overall domain otherwise unchanged.
|
|
|
|
* @parseOpaque is opaque data passed by virDomainDefParse* caller,
|
|
|
|
* @opaque is opaque data set by driver (usually pointer to driver
|
|
|
|
* private data). */
|
2013-02-19 16:29:39 +00:00
|
|
|
typedef int (*virDomainDeviceDefPostParseCallback)(virDomainDeviceDefPtr dev,
|
maint: avoid 'const fooPtr' in domain_conf
'const fooPtr' is the same as 'foo * const' (the pointer won't
change, but it's contents can). But in general, if an interface
is trying to be const-correct, it should be using 'const foo *'
(the pointer is to data that can't be changed).
Fix up offenders in src/conf/domain_conf, and their fallout.
Several things to note: virObjectLock() requires a non-const
argument; if this were C++, we could treat the locking field
as 'mutable' and allow locking an otherwise 'const' object, but
that is a more invasive change, so I instead dropped attempts
to be const-correct on domain lookup. virXMLPropString and
friends require a non-const xmlNodePtr - this is because libxml2
is not a const-correct library. We could make the src/util/virxml
wrappers cast away const, but I figured it was easier to not
try to mark xmlNodePtr as const. Finally, virDomainDeviceDefCopy
was a rather hard conversion - it calls virDomainDeviceDefPostParse,
which in turn in the xen driver was actually modifying the domain
outside of the current device being visited. We should not be
adding a device on the first per-device callback, but waiting until
after all per-device callbacks are complete.
* src/conf/domain_conf.h (virDomainObjListFindByID)
(virDomainObjListFindByUUID, virDomainObjListFindByName)
(virDomainObjAssignDef, virDomainObjListAdd): Drop attempt at
const.
(virDomainDeviceDefCopy): Use intended type.
(virDomainDeviceDefParse, virDomainDeviceDefPostParseCallback)
(virDomainVideoDefaultType, virDomainVideoDefaultRAM)
(virDomainChrGetDomainPtrs): Make const-correct.
* src/conf/domain_conf.c (virDomainObjListFindByID)
(virDomainObjListFindByUUID, virDomainObjListFindByName)
(virDomainDeviceDefCopy, virDomainObjListAdd)
(virDomainObjAssignDef, virDomainHostdevSubsysUsbDefParseXML)
(virDomainHostdevSubsysPciOrigStatesDefParseXML)
(virDomainHostdevSubsysPciDefParseXML)
(virDomainHostdevSubsysScsiDefParseXML)
(virDomainControllerModelTypeFromString)
(virDomainTPMDefParseXML, virDomainTimerDefParseXML)
(virDomainSoundCodecDefParseXML, virDomainSoundDefParseXML)
(virDomainWatchdogDefParseXML, virDomainRNGDefParseXML)
(virDomainMemballoonDefParseXML, virDomainNVRAMDefParseXML)
(virSysinfoParseXML, virDomainVideoAccelDefParseXML)
(virDomainVideoDefParseXML, virDomainHostdevDefParseXML)
(virDomainRedirdevDefParseXML)
(virDomainRedirFilterUsbDevDefParseXML)
(virDomainRedirFilterDefParseXML, virDomainIdMapEntrySort)
(virDomainIdmapDefParseXML, virDomainVcpuPinDefParseXML)
(virDiskNameToBusDeviceIndex, virDomainDeviceDefCopy)
(virDomainVideoDefaultType, virDomainHostdevAssignAddress)
(virDomainDeviceDefPostParseInternal, virDomainDeviceDefPostParse)
(virDomainChrGetDomainPtrs, virDomainControllerSCSINextUnit)
(virDomainSCSIDriveAddressIsUsed)
(virDomainDriveAddressIsUsedByDisk)
(virDomainDriveAddressIsUsedByHostdev): Fix fallout.
* src/openvz/openvz_driver.c (openvzDomainDeviceDefPostParse):
Likewise.
* src/libxl/libxl_domain.c (libxlDomainDeviceDefPostParse):
Likewise.
* src/qemu/qemu_domain.c (qemuDomainDeviceDefPostParse)
(qemuDomainDefaultNetModel): Likewise.
* src/lxc/lxc_domain.c (virLXCDomainDeviceDefPostParse):
Likewise.
* src/uml/uml_driver.c (umlDomainDeviceDefPostParse): Likewise.
* src/xen/xen_driver.c (xenDomainDeviceDefPostParse): Split...
(xenDomainDefPostParse): ...since per-device callback is not the
time to be adding a device.
Signed-off-by: Eric Blake <eblake@redhat.com>
2013-10-08 15:08:25 +00:00
|
|
|
const virDomainDef *def,
|
2016-01-08 13:00:56 +00:00
|
|
|
unsigned int parseFlags,
|
2016-09-23 08:53:38 +00:00
|
|
|
void *opaque,
|
|
|
|
void *parseOpaque);
|
2016-05-14 18:47:23 +00:00
|
|
|
/* Drive callback for assigning device addresses, called at the end
|
2016-09-23 09:04:39 +00:00
|
|
|
* of parsing, after all defaults and implicit devices have been added.
|
|
|
|
* @parseOpaque is opaque data passed by virDomainDefParse* caller,
|
|
|
|
* @opaque is opaque data set by driver (usually pointer to driver
|
|
|
|
* private data). */
|
2016-05-14 18:47:23 +00:00
|
|
|
typedef int (*virDomainDefAssignAddressesCallback)(virDomainDef *def,
|
|
|
|
unsigned int parseFlags,
|
2016-09-23 09:04:39 +00:00
|
|
|
void *opaque,
|
|
|
|
void *parseOpaque);
|
2016-05-14 18:47:23 +00:00
|
|
|
|
2017-08-15 13:18:51 +00:00
|
|
|
typedef int (*virDomainDefPostParseDataAlloc)(const virDomainDef *def,
|
|
|
|
unsigned int parseFlags,
|
|
|
|
void *opaque,
|
|
|
|
void **parseOpaque);
|
|
|
|
typedef void (*virDomainDefPostParseDataFree)(void *parseOpaque);
|
|
|
|
|
2016-05-26 13:58:53 +00:00
|
|
|
/* Called in appropriate places where the domain conf parser can return failure
|
|
|
|
* for configurations that were previously accepted. This shall not modify the
|
|
|
|
* config. */
|
|
|
|
typedef int (*virDomainDefValidateCallback)(const virDomainDef *def,
|
2020-12-08 13:11:13 +00:00
|
|
|
void *opaque,
|
|
|
|
void *parseOpaque);
|
2013-02-19 16:29:39 +00:00
|
|
|
|
2016-05-27 08:56:56 +00:00
|
|
|
/* Called once per device, for adjusting per-device settings while
|
|
|
|
* leaving the overall domain otherwise unchanged. */
|
|
|
|
typedef int (*virDomainDeviceDefValidateCallback)(const virDomainDeviceDef *dev,
|
|
|
|
const virDomainDef *def,
|
2020-12-08 13:11:13 +00:00
|
|
|
void *opaque,
|
|
|
|
void *parseOpaque);
|
2016-05-27 08:56:56 +00:00
|
|
|
|
2013-02-19 16:29:39 +00:00
|
|
|
struct _virDomainDefParserConfig {
|
2013-03-15 10:40:17 +00:00
|
|
|
/* driver domain definition callbacks */
|
2017-08-15 13:11:45 +00:00
|
|
|
virDomainDefPostParseBasicCallback domainPostParseBasicCallback;
|
2017-08-15 13:18:51 +00:00
|
|
|
virDomainDefPostParseDataAlloc domainPostParseDataAlloc;
|
2013-02-19 16:29:39 +00:00
|
|
|
virDomainDefPostParseCallback domainPostParseCallback;
|
|
|
|
virDomainDeviceDefPostParseCallback devicesPostParseCallback;
|
2016-05-14 18:47:23 +00:00
|
|
|
virDomainDefAssignAddressesCallback assignAddressesCallback;
|
2017-08-15 13:18:51 +00:00
|
|
|
virDomainDefPostParseDataFree domainPostParseDataFree;
|
2013-02-19 16:29:39 +00:00
|
|
|
|
2016-05-26 13:58:53 +00:00
|
|
|
/* validation callbacks */
|
|
|
|
virDomainDefValidateCallback domainValidateCallback;
|
2016-05-27 08:56:56 +00:00
|
|
|
virDomainDeviceDefValidateCallback deviceValidateCallback;
|
2016-05-26 13:58:53 +00:00
|
|
|
|
2013-03-15 10:40:17 +00:00
|
|
|
/* private data for the callbacks */
|
2013-02-19 16:29:39 +00:00
|
|
|
void *priv;
|
|
|
|
virFreeCallback privFree;
|
2013-03-15 10:40:17 +00:00
|
|
|
|
|
|
|
/* data */
|
2016-02-23 09:32:19 +00:00
|
|
|
unsigned int features; /* virDomainDefFeatures */
|
2013-03-15 14:44:12 +00:00
|
|
|
unsigned char macPrefix[VIR_MAC_PREFIX_BUFLEN];
|
2019-11-27 15:22:45 +00:00
|
|
|
virArch defArch;
|
2019-11-26 16:44:40 +00:00
|
|
|
const char *netPrefix;
|
2019-11-26 18:57:30 +00:00
|
|
|
const char *defSecModel;
|
2013-02-19 16:29:39 +00:00
|
|
|
};
|
|
|
|
|
2017-07-21 13:29:00 +00:00
|
|
|
typedef void *(*virDomainXMLPrivateDataAllocFunc)(void *);
|
2015-07-24 17:35:00 +00:00
|
|
|
typedef void (*virDomainXMLPrivateDataFreeFunc)(void *);
|
|
|
|
typedef virObjectPtr (*virDomainXMLPrivateDataNewFunc)(void);
|
|
|
|
typedef int (*virDomainXMLPrivateDataFormatFunc)(virBufferPtr,
|
|
|
|
virDomainObjPtr);
|
|
|
|
typedef int (*virDomainXMLPrivateDataParseFunc)(xmlXPathContextPtr,
|
|
|
|
virDomainObjPtr,
|
|
|
|
virDomainDefParserConfigPtr);
|
|
|
|
|
2018-05-28 09:36:46 +00:00
|
|
|
typedef void *(*virDomainXMLPrivateDataGetParseOpaqueFunc)(virDomainObjPtr vm);
|
|
|
|
|
2018-06-11 15:34:34 +00:00
|
|
|
typedef int (*virDomainXMLPrivateDataDiskParseFunc)(xmlXPathContextPtr ctxt,
|
|
|
|
virDomainDiskDefPtr disk);
|
|
|
|
typedef int (*virDomainXMLPrivateDataDiskFormatFunc)(virDomainDiskDefPtr disk,
|
|
|
|
virBufferPtr buf);
|
|
|
|
|
2017-12-12 16:55:03 +00:00
|
|
|
typedef int (*virDomainXMLPrivateDataStorageSourceParseFunc)(xmlXPathContextPtr ctxt,
|
|
|
|
virStorageSourcePtr src);
|
|
|
|
typedef int (*virDomainXMLPrivateDataStorageSourceFormatFunc)(virStorageSourcePtr src,
|
|
|
|
virBufferPtr buf);
|
|
|
|
|
|
|
|
|
2013-03-05 15:17:24 +00:00
|
|
|
struct _virDomainXMLPrivateDataCallbacks {
|
|
|
|
virDomainXMLPrivateDataAllocFunc alloc;
|
|
|
|
virDomainXMLPrivateDataFreeFunc free;
|
2016-07-01 14:38:31 +00:00
|
|
|
/* note that private data for devices are not copied when using
|
|
|
|
* virDomainDefCopy and similar functions */
|
2015-05-13 07:00:02 +00:00
|
|
|
virDomainXMLPrivateDataNewFunc diskNew;
|
2018-06-11 15:34:34 +00:00
|
|
|
virDomainXMLPrivateDataDiskParseFunc diskParse;
|
|
|
|
virDomainXMLPrivateDataDiskFormatFunc diskFormat;
|
2016-06-29 12:55:24 +00:00
|
|
|
virDomainXMLPrivateDataNewFunc vcpuNew;
|
2016-10-21 12:31:37 +00:00
|
|
|
virDomainXMLPrivateDataNewFunc chrSourceNew;
|
2018-05-17 14:58:24 +00:00
|
|
|
virDomainXMLPrivateDataNewFunc vsockNew;
|
2019-01-10 15:34:00 +00:00
|
|
|
virDomainXMLPrivateDataNewFunc graphicsNew;
|
2019-08-08 14:55:01 +00:00
|
|
|
virDomainXMLPrivateDataNewFunc networkNew;
|
2019-09-23 10:44:35 +00:00
|
|
|
virDomainXMLPrivateDataNewFunc videoNew;
|
2019-12-10 12:52:52 +00:00
|
|
|
virDomainXMLPrivateDataNewFunc fsNew;
|
2013-03-05 15:17:24 +00:00
|
|
|
virDomainXMLPrivateDataFormatFunc format;
|
|
|
|
virDomainXMLPrivateDataParseFunc parse;
|
2018-05-28 09:36:46 +00:00
|
|
|
/* following function shall return a pointer which will be used as the
|
|
|
|
* 'parseOpaque' argument for virDomainDefPostParse */
|
|
|
|
virDomainXMLPrivateDataGetParseOpaqueFunc getParseOpaque;
|
2017-12-12 16:55:03 +00:00
|
|
|
virDomainXMLPrivateDataStorageSourceParseFunc storageParse;
|
|
|
|
virDomainXMLPrivateDataStorageSourceFormatFunc storageFormat;
|
2013-03-05 15:17:24 +00:00
|
|
|
};
|
|
|
|
|
2017-05-19 13:07:15 +00:00
|
|
|
typedef bool (*virDomainABIStabilityDomain)(const virDomainDef *src,
|
|
|
|
const virDomainDef *dst);
|
|
|
|
|
|
|
|
struct _virDomainABIStability {
|
|
|
|
virDomainABIStabilityDomain domain;
|
|
|
|
};
|
|
|
|
|
2013-02-19 16:29:39 +00:00
|
|
|
virDomainXMLOptionPtr virDomainXMLOptionNew(virDomainDefParserConfigPtr config,
|
|
|
|
virDomainXMLPrivateDataCallbacksPtr priv,
|
2019-08-20 21:39:24 +00:00
|
|
|
virXMLNamespacePtr xmlns,
|
2017-06-01 22:44:46 +00:00
|
|
|
virDomainABIStabilityPtr abi,
|
|
|
|
virSaveCookieCallbacksPtr saveCookie);
|
|
|
|
|
|
|
|
virSaveCookieCallbacksPtr
|
|
|
|
virDomainXMLOptionGetSaveCookie(virDomainXMLOptionPtr xmlopt);
|
2013-03-05 15:17:24 +00:00
|
|
|
|
2019-04-16 02:59:44 +00:00
|
|
|
typedef int (*virDomainMomentPostParseCallback)(virDomainMomentDefPtr def);
|
|
|
|
|
|
|
|
void virDomainXMLOptionSetMomentPostParse(virDomainXMLOptionPtr xmlopt,
|
|
|
|
virDomainMomentPostParseCallback cb);
|
|
|
|
int virDomainXMLOptionRunMomentPostParse(virDomainXMLOptionPtr xmlopt,
|
|
|
|
virDomainMomentDefPtr def);
|
|
|
|
|
2013-03-15 14:44:12 +00:00
|
|
|
void virDomainNetGenerateMAC(virDomainXMLOptionPtr xmlopt, virMacAddrPtr mac);
|
|
|
|
|
2019-08-20 21:39:24 +00:00
|
|
|
virXMLNamespacePtr
|
2013-03-31 18:03:42 +00:00
|
|
|
virDomainXMLOptionGetNamespace(virDomainXMLOptionPtr xmlopt)
|
2013-03-05 15:17:24 +00:00
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
|
2020-12-10 20:36:27 +00:00
|
|
|
/* This structure holds various callbacks and data needed
|
|
|
|
* while parsing and creating domain XMLs */
|
|
|
|
struct _virDomainXMLOption {
|
|
|
|
virObject parent;
|
|
|
|
|
|
|
|
/* XML parser callbacks and defaults */
|
|
|
|
virDomainDefParserConfig config;
|
|
|
|
|
|
|
|
/* domain private data management callbacks */
|
|
|
|
virDomainXMLPrivateDataCallbacks privateData;
|
|
|
|
|
|
|
|
/* XML namespace callbacks */
|
|
|
|
virXMLNamespace ns;
|
|
|
|
|
|
|
|
/* ABI stability callbacks */
|
|
|
|
virDomainABIStability abi;
|
|
|
|
|
|
|
|
/* Private data for save image stored in snapshot XML */
|
|
|
|
virSaveCookieCallbacks saveCookie;
|
|
|
|
|
|
|
|
/* Snapshot postparse callbacks */
|
|
|
|
virDomainMomentPostParseCallback momentPostParse;
|
|
|
|
};
|
|
|
|
|
2020-12-10 22:12:30 +00:00
|
|
|
struct virDomainDefPostParseDeviceIteratorData {
|
|
|
|
virDomainXMLOptionPtr xmlopt;
|
|
|
|
void *parseOpaque;
|
|
|
|
unsigned int parseFlags;
|
|
|
|
};
|
|
|
|
|
2019-04-11 13:44:14 +00:00
|
|
|
bool
|
|
|
|
virDomainSCSIDriveAddressIsUsed(const virDomainDef *def,
|
|
|
|
const virDomainDeviceDriveAddress *addr);
|
|
|
|
|
2016-09-22 14:41:33 +00:00
|
|
|
int virDomainDefPostParse(virDomainDefPtr def,
|
|
|
|
unsigned int parseFlags,
|
|
|
|
virDomainXMLOptionPtr xmlopt,
|
|
|
|
void *parseOpaque);
|
2018-03-13 09:27:01 +00:00
|
|
|
bool virDomainDefHasUSB(const virDomainDef *def);
|
2013-04-22 11:41:52 +00:00
|
|
|
|
2017-11-29 13:02:51 +00:00
|
|
|
bool virDomainDeviceAliasIsUserAlias(const char *aliasStr);
|
|
|
|
|
2011-03-23 05:48:24 +00:00
|
|
|
static inline bool
|
Rename internal APis
Rename virDomainIsActive to virDomainObjIsActive, and
virInterfaceIsActive to virInterfaceObjIsActive and finally
virNetworkIsActive to virNetworkObjIsActive.
* src/conf/domain_conf.c, src/conf/domain_conf.h,
src/conf/interface_conf.h, src/conf/network_conf.c,
src/conf/network_conf.h, src/lxc/lxc_driver.c,
src/network/bridge_driver.c, src/opennebula/one_driver.c,
src/openvz/openvz_driver.c, src/qemu/qemu_driver.c,
src/test/test_driver.c, src/uml/uml_driver.c: Update for
renamed APIs.
2009-10-20 14:51:03 +00:00
|
|
|
virDomainObjIsActive(virDomainObjPtr dom)
|
2008-07-11 16:23:36 +00:00
|
|
|
{
|
|
|
|
return dom->def->id != -1;
|
|
|
|
}
|
|
|
|
|
2018-04-17 22:13:26 +00:00
|
|
|
int virDomainObjCheckActive(virDomainObjPtr dom);
|
|
|
|
|
2016-06-29 12:55:24 +00:00
|
|
|
int virDomainDefSetVcpusMax(virDomainDefPtr def,
|
|
|
|
unsigned int vcpus,
|
|
|
|
virDomainXMLOptionPtr xmlopt);
|
|
|
|
bool virDomainDefHasVcpusOffline(const virDomainDef *def);
|
|
|
|
unsigned int virDomainDefGetVcpusMax(const virDomainDef *def);
|
|
|
|
int virDomainDefSetVcpus(virDomainDefPtr def, unsigned int vcpus);
|
|
|
|
unsigned int virDomainDefGetVcpus(const virDomainDef *def);
|
|
|
|
virBitmapPtr virDomainDefGetOnlineVcpumap(const virDomainDef *def);
|
|
|
|
virDomainVcpuDefPtr virDomainDefGetVcpu(virDomainDefPtr def, unsigned int vcpu)
|
2019-10-14 12:25:14 +00:00
|
|
|
G_GNUC_WARN_UNUSED_RESULT;
|
2016-09-21 05:59:57 +00:00
|
|
|
void virDomainDefVcpuOrderClear(virDomainDefPtr def);
|
2016-10-10 13:46:25 +00:00
|
|
|
int virDomainDefGetVcpusTopology(const virDomainDef *def,
|
|
|
|
unsigned int *maxvcpus);
|
2016-06-29 12:55:24 +00:00
|
|
|
|
2013-03-31 18:03:42 +00:00
|
|
|
virDomainObjPtr virDomainObjNew(virDomainXMLOptionPtr caps)
|
2013-03-05 15:17:24 +00:00
|
|
|
ATTRIBUTE_NONNULL(1);
|
2009-11-30 18:35:58 +00:00
|
|
|
|
2015-04-23 15:27:58 +00:00
|
|
|
void virDomainObjEndAPI(virDomainObjPtr *vm);
|
|
|
|
|
2011-05-04 10:40:59 +00:00
|
|
|
bool virDomainObjTaint(virDomainObjPtr obj,
|
2014-06-01 00:22:30 +00:00
|
|
|
virDomainTaintFlags taint);
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2015-05-26 14:43:58 +00:00
|
|
|
void virDomainObjBroadcast(virDomainObjPtr vm);
|
|
|
|
int virDomainObjWait(virDomainObjPtr vm);
|
|
|
|
int virDomainObjWaitUntil(virDomainObjPtr vm,
|
|
|
|
unsigned long long whenms);
|
2014-08-11 15:40:32 +00:00
|
|
|
|
2013-12-09 09:11:14 +00:00
|
|
|
void virDomainPanicDefFree(virDomainPanicDefPtr panic);
|
2013-03-21 11:28:10 +00:00
|
|
|
void virDomainResourceDefFree(virDomainResourceDefPtr resource);
|
2008-07-11 16:23:36 +00:00
|
|
|
void virDomainGraphicsDefFree(virDomainGraphicsDefPtr def);
|
2017-11-21 12:28:28 +00:00
|
|
|
const char *virDomainInputDefGetPath(virDomainInputDefPtr input);
|
2008-07-11 16:23:36 +00:00
|
|
|
void virDomainInputDefFree(virDomainInputDefPtr def);
|
2015-05-13 07:00:02 +00:00
|
|
|
virDomainDiskDefPtr virDomainDiskDefNew(virDomainXMLOptionPtr xmlopt);
|
2008-07-11 16:23:36 +00:00
|
|
|
void virDomainDiskDefFree(virDomainDiskDefPtr def);
|
2020-11-19 21:05:21 +00:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainDiskDef, virDomainDiskDefFree);
|
2012-03-07 02:06:30 +00:00
|
|
|
void virDomainLeaseDefFree(virDomainLeaseDefPtr def);
|
conf: accessors for common source information
A future patch will split virDomainDiskDef, in order to track
multiple host resources per guest <disk>. To reduce the size
of that patch, I've factored out the four most common accesses
into functions, so that I can incrementally upgrade the code
base to use the accessors, and so that code that doesn't care
about the distinction of per-file details won't have to be
changed when the struct changes.
* src/conf/domain_conf.h (virDomainDiskGetType)
(virDomainDiskSetType, virDomainDiskGetSource)
(virDomainDiskSetSource, virDomainDiskGetDriver)
(virDomainDiskSetDriver, virDomainDiskGetFormat)
(virDomainDiskSetFormat): New prototypes.
* src/conf/domain_conf.c (virDomainDiskGetType)
(virDomainDiskSetType, virDomainDiskGetSource)
(virDomainDiskSetSource, virDomainDiskGetDriver)
(virDomainDiskSetDriver, virDomainDiskGetFormat)
(virDomainDiskSetFormat): Implement them.
* src/libvirt_private.syms (domain_conf.h): Export them.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-03-17 17:39:57 +00:00
|
|
|
int virDomainDiskGetType(virDomainDiskDefPtr def);
|
|
|
|
void virDomainDiskSetType(virDomainDiskDefPtr def, int type);
|
2015-06-15 22:42:03 +00:00
|
|
|
const char *virDomainDiskGetSource(virDomainDiskDef const *def);
|
2020-11-05 06:23:41 +00:00
|
|
|
void virDomainDiskSetSource(virDomainDiskDefPtr def, const char *src);
|
2017-03-31 13:59:54 +00:00
|
|
|
void virDomainDiskEmptySource(virDomainDiskDefPtr def);
|
2018-04-10 14:41:54 +00:00
|
|
|
const char *virDomainDiskGetDriver(const virDomainDiskDef *def);
|
2020-11-06 03:32:37 +00:00
|
|
|
void virDomainDiskSetDriver(virDomainDiskDefPtr def, const char *name);
|
conf: accessors for common source information
A future patch will split virDomainDiskDef, in order to track
multiple host resources per guest <disk>. To reduce the size
of that patch, I've factored out the four most common accesses
into functions, so that I can incrementally upgrade the code
base to use the accessors, and so that code that doesn't care
about the distinction of per-file details won't have to be
changed when the struct changes.
* src/conf/domain_conf.h (virDomainDiskGetType)
(virDomainDiskSetType, virDomainDiskGetSource)
(virDomainDiskSetSource, virDomainDiskGetDriver)
(virDomainDiskSetDriver, virDomainDiskGetFormat)
(virDomainDiskSetFormat): New prototypes.
* src/conf/domain_conf.c (virDomainDiskGetType)
(virDomainDiskSetType, virDomainDiskGetSource)
(virDomainDiskSetSource, virDomainDiskGetDriver)
(virDomainDiskSetDriver, virDomainDiskGetFormat)
(virDomainDiskSetFormat): Implement them.
* src/libvirt_private.syms (domain_conf.h): Export them.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-03-17 17:39:57 +00:00
|
|
|
int virDomainDiskGetFormat(virDomainDiskDefPtr def);
|
|
|
|
void virDomainDiskSetFormat(virDomainDiskDefPtr def, int format);
|
2018-01-30 15:04:03 +00:00
|
|
|
virDomainControllerDefPtr
|
|
|
|
virDomainDeviceFindSCSIController(const virDomainDef *def,
|
2019-09-10 14:45:47 +00:00
|
|
|
const virDomainDeviceDriveAddress *addr);
|
|
|
|
virDomainDiskDefPtr virDomainDiskFindByBusAndDst(virDomainDefPtr def,
|
|
|
|
int bus,
|
|
|
|
char *dst);
|
2017-02-28 13:58:33 +00:00
|
|
|
|
|
|
|
virDomainControllerDefPtr virDomainControllerDefNew(virDomainControllerType type);
|
2009-12-02 19:15:38 +00:00
|
|
|
void virDomainControllerDefFree(virDomainControllerDefPtr def);
|
2020-11-24 14:12:51 +00:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainControllerDef, virDomainControllerDefFree);
|
2017-07-24 11:26:57 +00:00
|
|
|
bool virDomainControllerIsPSeriesPHB(const virDomainControllerDef *cont);
|
2017-02-28 13:58:33 +00:00
|
|
|
|
2019-12-10 12:51:54 +00:00
|
|
|
virDomainFSDefPtr virDomainFSDefNew(virDomainXMLOptionPtr xmlopt);
|
2008-08-01 13:31:37 +00:00
|
|
|
void virDomainFSDefFree(virDomainFSDefPtr def);
|
2011-06-26 08:09:00 +00:00
|
|
|
void virDomainActualNetDefFree(virDomainActualNetDefPtr def);
|
2018-05-22 08:37:50 +00:00
|
|
|
virDomainVsockDefPtr virDomainVsockDefNew(virDomainXMLOptionPtr xmlopt);
|
|
|
|
void virDomainVsockDefFree(virDomainVsockDefPtr vsock);
|
2020-02-05 00:11:53 +00:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainVsockDef, virDomainVsockDefFree);
|
2008-07-11 16:23:36 +00:00
|
|
|
void virDomainNetDefFree(virDomainNetDefPtr def);
|
2011-01-10 16:41:33 +00:00
|
|
|
void virDomainSmartcardDefFree(virDomainSmartcardDefPtr def);
|
2020-11-20 19:09:13 +00:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainSmartcardDef, virDomainSmartcardDefFree);
|
2008-07-11 16:23:36 +00:00
|
|
|
void virDomainChrDefFree(virDomainChrDefPtr def);
|
2018-09-06 11:10:20 +00:00
|
|
|
int virDomainChrSourceDefCopy(virDomainChrSourceDefPtr dest,
|
|
|
|
virDomainChrSourceDefPtr src);
|
2012-05-15 22:55:09 +00:00
|
|
|
void virDomainSoundCodecDefFree(virDomainSoundCodecDefPtr def);
|
2019-11-29 09:40:46 +00:00
|
|
|
ssize_t virDomainSoundDefFind(const virDomainDef *def,
|
|
|
|
const virDomainSoundDef *sound);
|
2008-07-11 16:23:36 +00:00
|
|
|
void virDomainSoundDefFree(virDomainSoundDefPtr def);
|
2019-11-29 09:40:46 +00:00
|
|
|
virDomainSoundDefPtr virDomainSoundDefRemove(virDomainDefPtr def, size_t idx);
|
2020-07-18 06:23:57 +00:00
|
|
|
void virDomainAudioDefFree(virDomainAudioDefPtr def);
|
2010-07-15 13:02:42 +00:00
|
|
|
void virDomainMemballoonDefFree(virDomainMemballoonDefPtr def);
|
2013-04-19 08:37:51 +00:00
|
|
|
void virDomainNVRAMDefFree(virDomainNVRAMDefPtr def);
|
2009-10-21 12:26:38 +00:00
|
|
|
void virDomainWatchdogDefFree(virDomainWatchdogDefPtr def);
|
2019-09-23 10:44:35 +00:00
|
|
|
virDomainVideoDefPtr virDomainVideoDefNew(virDomainXMLOptionPtr xmlopt);
|
2009-07-06 13:54:44 +00:00
|
|
|
void virDomainVideoDefFree(virDomainVideoDefPtr def);
|
2020-11-19 16:57:43 +00:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainVideoDef, virDomainVideoDefFree);
|
2018-06-28 07:36:26 +00:00
|
|
|
void virDomainVideoDefClear(virDomainVideoDefPtr def);
|
2017-09-23 11:03:50 +00:00
|
|
|
virDomainHostdevDefPtr virDomainHostdevDefNew(void);
|
2012-01-31 09:16:54 +00:00
|
|
|
void virDomainHostdevDefClear(virDomainHostdevDefPtr def);
|
2008-08-08 14:27:05 +00:00
|
|
|
void virDomainHostdevDefFree(virDomainHostdevDefPtr def);
|
2011-09-02 14:20:40 +00:00
|
|
|
void virDomainHubDefFree(virDomainHubDefPtr def);
|
2011-09-02 15:09:14 +00:00
|
|
|
void virDomainRedirdevDefFree(virDomainRedirdevDefPtr def);
|
2012-09-13 07:25:45 +00:00
|
|
|
void virDomainRedirFilterDefFree(virDomainRedirFilterDefPtr def);
|
2014-09-22 08:49:39 +00:00
|
|
|
void virDomainShmemDefFree(virDomainShmemDefPtr def);
|
2008-07-11 16:23:36 +00:00
|
|
|
void virDomainDeviceDefFree(virDomainDeviceDefPtr def);
|
2020-12-11 12:27:17 +00:00
|
|
|
|
2020-02-04 23:58:52 +00:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainDeviceDef, virDomainDeviceDefFree);
|
2013-03-28 13:55:55 +00:00
|
|
|
virDomainDeviceDefPtr virDomainDeviceDefCopy(virDomainDeviceDefPtr src,
|
maint: avoid 'const fooPtr' in domain_conf
'const fooPtr' is the same as 'foo * const' (the pointer won't
change, but it's contents can). But in general, if an interface
is trying to be const-correct, it should be using 'const foo *'
(the pointer is to data that can't be changed).
Fix up offenders in src/conf/domain_conf, and their fallout.
Several things to note: virObjectLock() requires a non-const
argument; if this were C++, we could treat the locking field
as 'mutable' and allow locking an otherwise 'const' object, but
that is a more invasive change, so I instead dropped attempts
to be const-correct on domain lookup. virXMLPropString and
friends require a non-const xmlNodePtr - this is because libxml2
is not a const-correct library. We could make the src/util/virxml
wrappers cast away const, but I figured it was easier to not
try to mark xmlNodePtr as const. Finally, virDomainDeviceDefCopy
was a rather hard conversion - it calls virDomainDeviceDefPostParse,
which in turn in the xen driver was actually modifying the domain
outside of the current device being visited. We should not be
adding a device on the first per-device callback, but waiting until
after all per-device callbacks are complete.
* src/conf/domain_conf.h (virDomainObjListFindByID)
(virDomainObjListFindByUUID, virDomainObjListFindByName)
(virDomainObjAssignDef, virDomainObjListAdd): Drop attempt at
const.
(virDomainDeviceDefCopy): Use intended type.
(virDomainDeviceDefParse, virDomainDeviceDefPostParseCallback)
(virDomainVideoDefaultType, virDomainVideoDefaultRAM)
(virDomainChrGetDomainPtrs): Make const-correct.
* src/conf/domain_conf.c (virDomainObjListFindByID)
(virDomainObjListFindByUUID, virDomainObjListFindByName)
(virDomainDeviceDefCopy, virDomainObjListAdd)
(virDomainObjAssignDef, virDomainHostdevSubsysUsbDefParseXML)
(virDomainHostdevSubsysPciOrigStatesDefParseXML)
(virDomainHostdevSubsysPciDefParseXML)
(virDomainHostdevSubsysScsiDefParseXML)
(virDomainControllerModelTypeFromString)
(virDomainTPMDefParseXML, virDomainTimerDefParseXML)
(virDomainSoundCodecDefParseXML, virDomainSoundDefParseXML)
(virDomainWatchdogDefParseXML, virDomainRNGDefParseXML)
(virDomainMemballoonDefParseXML, virDomainNVRAMDefParseXML)
(virSysinfoParseXML, virDomainVideoAccelDefParseXML)
(virDomainVideoDefParseXML, virDomainHostdevDefParseXML)
(virDomainRedirdevDefParseXML)
(virDomainRedirFilterUsbDevDefParseXML)
(virDomainRedirFilterDefParseXML, virDomainIdMapEntrySort)
(virDomainIdmapDefParseXML, virDomainVcpuPinDefParseXML)
(virDiskNameToBusDeviceIndex, virDomainDeviceDefCopy)
(virDomainVideoDefaultType, virDomainHostdevAssignAddress)
(virDomainDeviceDefPostParseInternal, virDomainDeviceDefPostParse)
(virDomainChrGetDomainPtrs, virDomainControllerSCSINextUnit)
(virDomainSCSIDriveAddressIsUsed)
(virDomainDriveAddressIsUsedByDisk)
(virDomainDriveAddressIsUsedByHostdev): Fix fallout.
* src/openvz/openvz_driver.c (openvzDomainDeviceDefPostParse):
Likewise.
* src/libxl/libxl_domain.c (libxlDomainDeviceDefPostParse):
Likewise.
* src/qemu/qemu_domain.c (qemuDomainDeviceDefPostParse)
(qemuDomainDefaultNetModel): Likewise.
* src/lxc/lxc_domain.c (virLXCDomainDeviceDefPostParse):
Likewise.
* src/uml/uml_driver.c (umlDomainDeviceDefPostParse): Likewise.
* src/xen/xen_driver.c (xenDomainDeviceDefPostParse): Split...
(xenDomainDefPostParse): ...since per-device callback is not the
time to be adding a device.
Signed-off-by: Eric Blake <eblake@redhat.com>
2013-10-08 15:08:25 +00:00
|
|
|
const virDomainDef *def,
|
2019-08-08 13:36:00 +00:00
|
|
|
virDomainXMLOptionPtr xmlopt,
|
|
|
|
void *parseOpaque);
|
2014-03-20 21:34:00 +00:00
|
|
|
virDomainDeviceInfoPtr virDomainDeviceGetInfo(virDomainDeviceDefPtr device);
|
2019-01-22 20:19:29 +00:00
|
|
|
void virDomainDeviceSetData(virDomainDeviceDefPtr device,
|
|
|
|
void *devicedata);
|
2013-04-12 20:55:45 +00:00
|
|
|
void virDomainTPMDefFree(virDomainTPMDefPtr def);
|
2010-01-06 10:35:30 +00:00
|
|
|
|
2010-01-27 15:10:34 +00:00
|
|
|
typedef int (*virDomainDeviceInfoCallback)(virDomainDefPtr def,
|
2012-02-22 21:06:10 +00:00
|
|
|
virDomainDeviceDefPtr dev,
|
|
|
|
virDomainDeviceInfoPtr info,
|
2010-01-27 15:10:34 +00:00
|
|
|
void *opaque);
|
|
|
|
|
|
|
|
int virDomainDeviceInfoIterate(virDomainDefPtr def,
|
|
|
|
virDomainDeviceInfoCallback cb,
|
|
|
|
void *opaque);
|
|
|
|
|
2015-01-21 14:41:44 +00:00
|
|
|
bool virDomainDefHasDeviceAddress(virDomainDefPtr def,
|
|
|
|
virDomainDeviceInfoPtr info)
|
2019-10-14 12:25:14 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT;
|
2015-01-21 14:41:44 +00:00
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
void virDomainDefFree(virDomainDefPtr vm);
|
2019-10-15 12:47:50 +00:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainDef, virDomainDefFree);
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2018-04-06 15:49:01 +00:00
|
|
|
virDomainChrSourceDefPtr
|
|
|
|
virDomainChrSourceDefNew(virDomainXMLOptionPtr xmlopt);
|
|
|
|
|
2016-06-17 10:36:11 +00:00
|
|
|
virDomainChrDefPtr virDomainChrDefNew(virDomainXMLOptionPtr xmlopt);
|
2011-04-14 16:05:14 +00:00
|
|
|
|
2020-12-10 18:58:44 +00:00
|
|
|
int virDomainDeviceInfoIterateFlags(virDomainDefPtr def,
|
|
|
|
virDomainDeviceInfoCallback cb,
|
|
|
|
unsigned int iteratorFlags,
|
|
|
|
void *opaque);
|
|
|
|
|
2019-01-10 14:34:06 +00:00
|
|
|
virDomainGraphicsDefPtr
|
|
|
|
virDomainGraphicsDefNew(virDomainXMLOptionPtr xmlopt);
|
2019-08-08 14:55:01 +00:00
|
|
|
|
|
|
|
virDomainNetDefPtr
|
|
|
|
virDomainNetDefNew(virDomainXMLOptionPtr xmlopt);
|
|
|
|
|
2015-02-16 14:58:13 +00:00
|
|
|
virDomainDefPtr virDomainDefNew(void);
|
2013-05-01 09:31:23 +00:00
|
|
|
|
2010-05-20 09:36:24 +00:00
|
|
|
void virDomainObjAssignDef(virDomainObjPtr domain,
|
maint: avoid 'const fooPtr' in domain_conf
'const fooPtr' is the same as 'foo * const' (the pointer won't
change, but it's contents can). But in general, if an interface
is trying to be const-correct, it should be using 'const foo *'
(the pointer is to data that can't be changed).
Fix up offenders in src/conf/domain_conf, and their fallout.
Several things to note: virObjectLock() requires a non-const
argument; if this were C++, we could treat the locking field
as 'mutable' and allow locking an otherwise 'const' object, but
that is a more invasive change, so I instead dropped attempts
to be const-correct on domain lookup. virXMLPropString and
friends require a non-const xmlNodePtr - this is because libxml2
is not a const-correct library. We could make the src/util/virxml
wrappers cast away const, but I figured it was easier to not
try to mark xmlNodePtr as const. Finally, virDomainDeviceDefCopy
was a rather hard conversion - it calls virDomainDeviceDefPostParse,
which in turn in the xen driver was actually modifying the domain
outside of the current device being visited. We should not be
adding a device on the first per-device callback, but waiting until
after all per-device callbacks are complete.
* src/conf/domain_conf.h (virDomainObjListFindByID)
(virDomainObjListFindByUUID, virDomainObjListFindByName)
(virDomainObjAssignDef, virDomainObjListAdd): Drop attempt at
const.
(virDomainDeviceDefCopy): Use intended type.
(virDomainDeviceDefParse, virDomainDeviceDefPostParseCallback)
(virDomainVideoDefaultType, virDomainVideoDefaultRAM)
(virDomainChrGetDomainPtrs): Make const-correct.
* src/conf/domain_conf.c (virDomainObjListFindByID)
(virDomainObjListFindByUUID, virDomainObjListFindByName)
(virDomainDeviceDefCopy, virDomainObjListAdd)
(virDomainObjAssignDef, virDomainHostdevSubsysUsbDefParseXML)
(virDomainHostdevSubsysPciOrigStatesDefParseXML)
(virDomainHostdevSubsysPciDefParseXML)
(virDomainHostdevSubsysScsiDefParseXML)
(virDomainControllerModelTypeFromString)
(virDomainTPMDefParseXML, virDomainTimerDefParseXML)
(virDomainSoundCodecDefParseXML, virDomainSoundDefParseXML)
(virDomainWatchdogDefParseXML, virDomainRNGDefParseXML)
(virDomainMemballoonDefParseXML, virDomainNVRAMDefParseXML)
(virSysinfoParseXML, virDomainVideoAccelDefParseXML)
(virDomainVideoDefParseXML, virDomainHostdevDefParseXML)
(virDomainRedirdevDefParseXML)
(virDomainRedirFilterUsbDevDefParseXML)
(virDomainRedirFilterDefParseXML, virDomainIdMapEntrySort)
(virDomainIdmapDefParseXML, virDomainVcpuPinDefParseXML)
(virDiskNameToBusDeviceIndex, virDomainDeviceDefCopy)
(virDomainVideoDefaultType, virDomainHostdevAssignAddress)
(virDomainDeviceDefPostParseInternal, virDomainDeviceDefPostParse)
(virDomainChrGetDomainPtrs, virDomainControllerSCSINextUnit)
(virDomainSCSIDriveAddressIsUsed)
(virDomainDriveAddressIsUsedByDisk)
(virDomainDriveAddressIsUsedByHostdev): Fix fallout.
* src/openvz/openvz_driver.c (openvzDomainDeviceDefPostParse):
Likewise.
* src/libxl/libxl_domain.c (libxlDomainDeviceDefPostParse):
Likewise.
* src/qemu/qemu_domain.c (qemuDomainDeviceDefPostParse)
(qemuDomainDefaultNetModel): Likewise.
* src/lxc/lxc_domain.c (virLXCDomainDeviceDefPostParse):
Likewise.
* src/uml/uml_driver.c (umlDomainDeviceDefPostParse): Likewise.
* src/xen/xen_driver.c (xenDomainDeviceDefPostParse): Split...
(xenDomainDefPostParse): ...since per-device callback is not the
time to be adding a device.
Signed-off-by: Eric Blake <eblake@redhat.com>
2013-10-08 15:08:25 +00:00
|
|
|
virDomainDefPtr def,
|
Merge virDomainObjListIsDuplicate into virDomainObjListAdd
The duplicate VM checking should be done atomically with
virDomainObjListAdd, so shoud not be a separate function.
Instead just use flags to indicate what kind of checks are
required.
This pair, used in virDomainCreateXML:
if (virDomainObjListIsDuplicate(privconn->domains, def, 1) < 0)
goto cleanup;
if (!(dom = virDomainObjListAdd(privconn->domains,
privconn->caps,
def, false)))
goto cleanup;
Changes to
if (!(dom = virDomainObjListAdd(privconn->domains,
privconn->caps,
def,
VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
NULL)))
goto cleanup;
This pair, used in virDomainRestoreFlags:
if (virDomainObjListIsDuplicate(privconn->domains, def, 1) < 0)
goto cleanup;
if (!(dom = virDomainObjListAdd(privconn->domains,
privconn->caps,
def, true)))
goto cleanup;
Changes to
if (!(dom = virDomainObjListAdd(privconn->domains,
privconn->caps,
def,
VIR_DOMAIN_OBJ_LIST_ADD_LIVE |
VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
NULL)))
goto cleanup;
This pair, used in virDomainDefineXML:
if (virDomainObjListIsDuplicate(privconn->domains, def, 0) < 0)
goto cleanup;
if (!(dom = virDomainObjListAdd(privconn->domains,
privconn->caps,
def, false)))
goto cleanup;
Changes to
if (!(dom = virDomainObjListAdd(privconn->domains,
privconn->caps,
def,
0, NULL)))
goto cleanup;
2013-01-14 14:46:58 +00:00
|
|
|
bool live,
|
|
|
|
virDomainDefPtr *oldDef);
|
2019-11-27 12:41:59 +00:00
|
|
|
int virDomainObjSetDefTransient(virDomainXMLOptionPtr xmlopt,
|
2019-08-06 11:41:42 +00:00
|
|
|
virDomainObjPtr domain,
|
|
|
|
void *parseOpaque);
|
2016-09-08 13:16:58 +00:00
|
|
|
void virDomainObjRemoveTransientDef(virDomainObjPtr domain);
|
2010-11-19 19:51:46 +00:00
|
|
|
virDomainDefPtr
|
2019-11-27 12:41:59 +00:00
|
|
|
virDomainObjGetPersistentDef(virDomainXMLOptionPtr xmlopt,
|
2019-08-06 11:41:42 +00:00
|
|
|
virDomainObjPtr domain,
|
|
|
|
void *parseOpaque);
|
2015-05-29 12:37:20 +00:00
|
|
|
|
|
|
|
int virDomainObjUpdateModificationImpact(virDomainObjPtr vm,
|
|
|
|
unsigned int *flags);
|
|
|
|
|
|
|
|
int virDomainObjGetDefs(virDomainObjPtr vm,
|
|
|
|
unsigned int flags,
|
|
|
|
virDomainDefPtr *liveDef,
|
|
|
|
virDomainDefPtr *persDef);
|
2016-09-14 05:22:40 +00:00
|
|
|
virDomainDefPtr virDomainObjGetOneDefState(virDomainObjPtr vm,
|
|
|
|
unsigned int flags,
|
|
|
|
bool *state);
|
2015-06-15 17:04:41 +00:00
|
|
|
virDomainDefPtr virDomainObjGetOneDef(virDomainObjPtr vm, unsigned int flags);
|
2011-12-12 05:16:49 +00:00
|
|
|
|
2013-03-28 13:55:55 +00:00
|
|
|
virDomainDefPtr virDomainDefCopy(virDomainDefPtr src,
|
|
|
|
virDomainXMLOptionPtr xmlopt,
|
2016-09-22 15:23:03 +00:00
|
|
|
void *parseOpaque,
|
2013-03-28 13:55:55 +00:00
|
|
|
bool migratable);
|
|
|
|
virDomainDefPtr virDomainObjCopyPersistentDef(virDomainObjPtr dom,
|
2019-08-06 11:41:42 +00:00
|
|
|
virDomainXMLOptionPtr xmlopt,
|
|
|
|
void *parseOpaque);
|
2011-04-22 03:07:56 +00:00
|
|
|
|
2014-11-18 16:44:00 +00:00
|
|
|
typedef enum {
|
|
|
|
/* parse internal domain status information */
|
|
|
|
VIR_DOMAIN_DEF_PARSE_STATUS = 1 << 0,
|
2015-09-15 13:23:53 +00:00
|
|
|
/* Parse only parts of the XML that would be present in an inactive libvirt
|
|
|
|
* XML. Note that the flag does not imply that ABI incompatible
|
|
|
|
* transformations can be used, since it's used to strip runtime info when
|
|
|
|
* restoring save images/migration. */
|
2014-11-18 16:44:00 +00:00
|
|
|
VIR_DOMAIN_DEF_PARSE_INACTIVE = 1 << 1,
|
|
|
|
/* parse <actual> element */
|
|
|
|
VIR_DOMAIN_DEF_PARSE_ACTUAL_NET = 1 << 2,
|
|
|
|
/* parse original states of host PCI device */
|
|
|
|
VIR_DOMAIN_DEF_PARSE_PCI_ORIG_STATES = 1 << 3,
|
2015-09-15 13:23:53 +00:00
|
|
|
/* internal flag passed to device info sub-parser to allow using <rom> */
|
2014-11-18 16:44:00 +00:00
|
|
|
VIR_DOMAIN_DEF_PARSE_ALLOW_ROM = 1 << 4,
|
2015-09-15 13:23:53 +00:00
|
|
|
/* internal flag passed to device info sub-parser to allow specifying boot order */
|
2014-11-18 16:44:00 +00:00
|
|
|
VIR_DOMAIN_DEF_PARSE_ALLOW_BOOT = 1 << 5,
|
|
|
|
/* parse only source half of <disk> */
|
2015-09-15 12:08:52 +00:00
|
|
|
VIR_DOMAIN_DEF_PARSE_DISK_SOURCE = 1 << 6,
|
2015-09-15 13:23:53 +00:00
|
|
|
/* perform RNG schema validation on the passed XML document */
|
2016-05-24 15:20:20 +00:00
|
|
|
VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA = 1 << 7,
|
2015-09-15 15:04:55 +00:00
|
|
|
/* allow updates in post parse callback that would break ABI otherwise */
|
2018-07-24 21:00:56 +00:00
|
|
|
VIR_DOMAIN_DEF_PARSE_ABI_UPDATE = 1 << 8,
|
2016-05-26 13:58:53 +00:00
|
|
|
/* skip definition validation checks meant to be executed on define time only */
|
2018-07-24 21:00:56 +00:00
|
|
|
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE = 1 << 9,
|
2016-11-21 14:40:23 +00:00
|
|
|
/* skip parsing of security labels */
|
2018-07-24 21:00:56 +00:00
|
|
|
VIR_DOMAIN_DEF_PARSE_SKIP_SECLABEL = 1 << 10,
|
2017-03-09 12:57:54 +00:00
|
|
|
/* Allows updates in post parse callback for incoming persistent migration
|
|
|
|
* that would break ABI otherwise. This should be used only if it's safe
|
|
|
|
* to do such change. */
|
2018-07-24 21:00:56 +00:00
|
|
|
VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION = 1 << 11,
|
2017-08-15 16:41:59 +00:00
|
|
|
/* Allows to ignore certain failures in the post parse callbacks, which
|
|
|
|
* may happen due to missing packages and can be fixed by re-running the
|
|
|
|
* post parse callbacks before starting. Failure of the post parse callback
|
|
|
|
* is recorded as def->postParseFail */
|
2018-07-24 21:00:56 +00:00
|
|
|
VIR_DOMAIN_DEF_PARSE_ALLOW_POST_PARSE_FAIL = 1 << 12,
|
2014-11-18 16:44:00 +00:00
|
|
|
} virDomainDefParseFlags;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_DEF_FORMAT_SECURE = 1 << 0,
|
|
|
|
VIR_DOMAIN_DEF_FORMAT_INACTIVE = 1 << 1,
|
2017-06-30 14:09:06 +00:00
|
|
|
VIR_DOMAIN_DEF_FORMAT_MIGRATABLE = 1 << 2,
|
2014-11-18 16:44:00 +00:00
|
|
|
/* format internal domain status information */
|
2017-06-30 14:09:06 +00:00
|
|
|
VIR_DOMAIN_DEF_FORMAT_STATUS = 1 << 3,
|
2014-11-18 16:44:00 +00:00
|
|
|
/* format <actual> element */
|
2017-06-30 14:09:06 +00:00
|
|
|
VIR_DOMAIN_DEF_FORMAT_ACTUAL_NET = 1 << 4,
|
2014-11-18 16:44:00 +00:00
|
|
|
/* format original states of host PCI device */
|
2017-06-30 14:09:06 +00:00
|
|
|
VIR_DOMAIN_DEF_FORMAT_PCI_ORIG_STATES = 1 << 5,
|
|
|
|
VIR_DOMAIN_DEF_FORMAT_ALLOW_ROM = 1 << 6,
|
|
|
|
VIR_DOMAIN_DEF_FORMAT_ALLOW_BOOT = 1 << 7,
|
|
|
|
VIR_DOMAIN_DEF_FORMAT_CLOCK_ADJUST = 1 << 8,
|
2014-11-18 16:44:00 +00:00
|
|
|
} virDomainDefFormatFlags;
|
|
|
|
|
2016-06-09 14:32:32 +00:00
|
|
|
/* Use these flags to skip specific domain ABI consistency checks done
|
|
|
|
* in virDomainDefCheckABIStabilityFlags.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
/* Set when domain lock must be released and there exists the possibility
|
|
|
|
* that some external action could alter the value, such as cur_balloon. */
|
|
|
|
VIR_DOMAIN_DEF_ABI_CHECK_SKIP_VOLATILE = 1 << 0,
|
|
|
|
} virDomainDefABICheckFlags;
|
|
|
|
|
2013-03-28 13:55:55 +00:00
|
|
|
virDomainDeviceDefPtr virDomainDeviceDefParse(const char *xmlStr,
|
maint: avoid 'const fooPtr' in domain_conf
'const fooPtr' is the same as 'foo * const' (the pointer won't
change, but it's contents can). But in general, if an interface
is trying to be const-correct, it should be using 'const foo *'
(the pointer is to data that can't be changed).
Fix up offenders in src/conf/domain_conf, and their fallout.
Several things to note: virObjectLock() requires a non-const
argument; if this were C++, we could treat the locking field
as 'mutable' and allow locking an otherwise 'const' object, but
that is a more invasive change, so I instead dropped attempts
to be const-correct on domain lookup. virXMLPropString and
friends require a non-const xmlNodePtr - this is because libxml2
is not a const-correct library. We could make the src/util/virxml
wrappers cast away const, but I figured it was easier to not
try to mark xmlNodePtr as const. Finally, virDomainDeviceDefCopy
was a rather hard conversion - it calls virDomainDeviceDefPostParse,
which in turn in the xen driver was actually modifying the domain
outside of the current device being visited. We should not be
adding a device on the first per-device callback, but waiting until
after all per-device callbacks are complete.
* src/conf/domain_conf.h (virDomainObjListFindByID)
(virDomainObjListFindByUUID, virDomainObjListFindByName)
(virDomainObjAssignDef, virDomainObjListAdd): Drop attempt at
const.
(virDomainDeviceDefCopy): Use intended type.
(virDomainDeviceDefParse, virDomainDeviceDefPostParseCallback)
(virDomainVideoDefaultType, virDomainVideoDefaultRAM)
(virDomainChrGetDomainPtrs): Make const-correct.
* src/conf/domain_conf.c (virDomainObjListFindByID)
(virDomainObjListFindByUUID, virDomainObjListFindByName)
(virDomainDeviceDefCopy, virDomainObjListAdd)
(virDomainObjAssignDef, virDomainHostdevSubsysUsbDefParseXML)
(virDomainHostdevSubsysPciOrigStatesDefParseXML)
(virDomainHostdevSubsysPciDefParseXML)
(virDomainHostdevSubsysScsiDefParseXML)
(virDomainControllerModelTypeFromString)
(virDomainTPMDefParseXML, virDomainTimerDefParseXML)
(virDomainSoundCodecDefParseXML, virDomainSoundDefParseXML)
(virDomainWatchdogDefParseXML, virDomainRNGDefParseXML)
(virDomainMemballoonDefParseXML, virDomainNVRAMDefParseXML)
(virSysinfoParseXML, virDomainVideoAccelDefParseXML)
(virDomainVideoDefParseXML, virDomainHostdevDefParseXML)
(virDomainRedirdevDefParseXML)
(virDomainRedirFilterUsbDevDefParseXML)
(virDomainRedirFilterDefParseXML, virDomainIdMapEntrySort)
(virDomainIdmapDefParseXML, virDomainVcpuPinDefParseXML)
(virDiskNameToBusDeviceIndex, virDomainDeviceDefCopy)
(virDomainVideoDefaultType, virDomainHostdevAssignAddress)
(virDomainDeviceDefPostParseInternal, virDomainDeviceDefPostParse)
(virDomainChrGetDomainPtrs, virDomainControllerSCSINextUnit)
(virDomainSCSIDriveAddressIsUsed)
(virDomainDriveAddressIsUsedByDisk)
(virDomainDriveAddressIsUsedByHostdev): Fix fallout.
* src/openvz/openvz_driver.c (openvzDomainDeviceDefPostParse):
Likewise.
* src/libxl/libxl_domain.c (libxlDomainDeviceDefPostParse):
Likewise.
* src/qemu/qemu_domain.c (qemuDomainDeviceDefPostParse)
(qemuDomainDefaultNetModel): Likewise.
* src/lxc/lxc_domain.c (virLXCDomainDeviceDefPostParse):
Likewise.
* src/uml/uml_driver.c (umlDomainDeviceDefPostParse): Likewise.
* src/xen/xen_driver.c (xenDomainDeviceDefPostParse): Split...
(xenDomainDefPostParse): ...since per-device callback is not the
time to be adding a device.
Signed-off-by: Eric Blake <eblake@redhat.com>
2013-10-08 15:08:25 +00:00
|
|
|
const virDomainDef *def,
|
2013-03-28 13:55:55 +00:00
|
|
|
virDomainXMLOptionPtr xmlopt,
|
2019-08-08 13:36:00 +00:00
|
|
|
void *parseOpaque,
|
2011-07-04 19:06:07 +00:00
|
|
|
unsigned int flags);
|
2018-03-16 11:43:23 +00:00
|
|
|
virDomainDiskDefPtr virDomainDiskDefParse(const char *xmlStr,
|
|
|
|
virDomainXMLOptionPtr xmlopt,
|
|
|
|
unsigned int flags);
|
2013-03-28 13:55:55 +00:00
|
|
|
virDomainDefPtr virDomainDefParseString(const char *xmlStr,
|
2013-03-31 18:03:42 +00:00
|
|
|
virDomainXMLOptionPtr xmlopt,
|
2016-09-22 15:14:17 +00:00
|
|
|
void *parseOpaque,
|
2011-07-04 19:06:07 +00:00
|
|
|
unsigned int flags);
|
2013-03-28 13:55:55 +00:00
|
|
|
virDomainDefPtr virDomainDefParseFile(const char *filename,
|
2013-03-31 18:03:42 +00:00
|
|
|
virDomainXMLOptionPtr xmlopt,
|
2016-09-22 15:14:17 +00:00
|
|
|
void *parseOpaque,
|
2011-07-04 19:06:07 +00:00
|
|
|
unsigned int flags);
|
2013-03-28 13:55:55 +00:00
|
|
|
virDomainDefPtr virDomainDefParseNode(xmlDocPtr doc,
|
2008-12-04 12:02:59 +00:00
|
|
|
xmlNodePtr root,
|
2013-03-28 13:55:55 +00:00
|
|
|
virDomainXMLOptionPtr xmlopt,
|
2016-09-22 14:56:26 +00:00
|
|
|
void *parseOpaque,
|
2011-07-04 19:06:07 +00:00
|
|
|
unsigned int flags);
|
2015-03-24 12:25:27 +00:00
|
|
|
virDomainObjPtr virDomainObjParseNode(xmlDocPtr xml,
|
|
|
|
xmlNodePtr root,
|
|
|
|
virDomainXMLOptionPtr xmlopt,
|
|
|
|
unsigned int flags);
|
2015-01-16 16:39:57 +00:00
|
|
|
virDomainObjPtr virDomainObjParseFile(const char *filename,
|
|
|
|
virDomainXMLOptionPtr xmlopt,
|
|
|
|
unsigned int flags);
|
2009-06-12 11:38:50 +00:00
|
|
|
|
2011-05-27 09:47:30 +00:00
|
|
|
bool virDomainDefCheckABIStability(virDomainDefPtr src,
|
2017-05-19 13:07:15 +00:00
|
|
|
virDomainDefPtr dst,
|
|
|
|
virDomainXMLOptionPtr xmlopt);
|
2011-05-27 09:47:30 +00:00
|
|
|
|
2016-06-09 14:32:32 +00:00
|
|
|
bool virDomainDefCheckABIStabilityFlags(virDomainDefPtr src,
|
|
|
|
virDomainDefPtr dst,
|
2017-05-19 13:07:15 +00:00
|
|
|
virDomainXMLOptionPtr xmlopt,
|
2016-06-09 14:32:32 +00:00
|
|
|
unsigned int flags);
|
|
|
|
|
2019-09-23 10:44:35 +00:00
|
|
|
int virDomainDefAddImplicitDevices(virDomainDefPtr def,
|
|
|
|
virDomainXMLOptionPtr xmlopt);
|
2010-01-05 13:31:20 +00:00
|
|
|
|
2016-02-18 14:56:10 +00:00
|
|
|
virDomainIOThreadIDDefPtr virDomainIOThreadIDFind(const virDomainDef *def,
|
2015-04-02 23:59:25 +00:00
|
|
|
unsigned int iothread_id);
|
|
|
|
virDomainIOThreadIDDefPtr virDomainIOThreadIDAdd(virDomainDefPtr def,
|
|
|
|
unsigned int iothread_id);
|
|
|
|
void virDomainIOThreadIDDel(virDomainDefPtr def, unsigned int iothread_id);
|
|
|
|
|
2019-02-14 20:25:01 +00:00
|
|
|
/* When extending this list, remember that libvirt 1.2.12-5.0.0 had a
|
|
|
|
* bug that silently ignored unknown flags. A new flag to add
|
|
|
|
* information is okay as long as clients still work when an older
|
|
|
|
* server omits the requested output, but a new flag to suppress
|
|
|
|
* information could result in a security hole when older libvirt
|
|
|
|
* supplies the sensitive information in spite of the flag. */
|
2019-06-07 20:20:16 +00:00
|
|
|
#define VIR_DOMAIN_XML_COMMON_FLAGS \
|
2019-02-14 20:25:01 +00:00
|
|
|
(VIR_DOMAIN_XML_SECURE | VIR_DOMAIN_XML_INACTIVE | \
|
|
|
|
VIR_DOMAIN_XML_MIGRATABLE)
|
2014-11-18 16:44:00 +00:00
|
|
|
unsigned int virDomainDefFormatConvertXMLFlags(unsigned int flags);
|
|
|
|
|
2010-02-09 18:58:01 +00:00
|
|
|
char *virDomainDefFormat(virDomainDefPtr def,
|
2019-11-26 19:40:46 +00:00
|
|
|
virDomainXMLOptionPtr xmlopt,
|
|
|
|
unsigned int flags)
|
2019-12-14 15:37:57 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
2019-11-26 19:40:46 +00:00
|
|
|
char *virDomainObjFormat(virDomainObjPtr obj,
|
|
|
|
virDomainXMLOptionPtr xmlopt,
|
|
|
|
unsigned int flags)
|
2019-12-14 15:37:57 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
2011-09-17 12:57:30 +00:00
|
|
|
int virDomainDefFormatInternal(virDomainDefPtr def,
|
2019-11-26 19:40:46 +00:00
|
|
|
virDomainXMLOptionPtr xmlopt,
|
2017-12-12 16:55:03 +00:00
|
|
|
virBufferPtr buf,
|
2019-11-26 19:40:46 +00:00
|
|
|
unsigned int flags)
|
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
|
2019-12-14 15:37:57 +00:00
|
|
|
ATTRIBUTE_NONNULL(3);
|
2019-08-29 20:55:42 +00:00
|
|
|
int virDomainDefFormatInternalSetRootName(virDomainDefPtr def,
|
2019-11-26 19:40:46 +00:00
|
|
|
virDomainXMLOptionPtr xmlopt,
|
2019-08-29 20:55:42 +00:00
|
|
|
virBufferPtr buf,
|
2019-11-26 19:40:46 +00:00
|
|
|
const char *rootname,
|
|
|
|
unsigned int flags)
|
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
|
2019-12-14 15:37:57 +00:00
|
|
|
ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2014-03-31 18:07:04 +00:00
|
|
|
int virDomainDiskSourceFormat(virBufferPtr buf,
|
|
|
|
virStorageSourcePtr src,
|
2019-04-04 20:32:05 +00:00
|
|
|
const char *element,
|
2014-03-31 18:07:04 +00:00
|
|
|
int policy,
|
2019-03-20 10:46:54 +00:00
|
|
|
bool attrIndex,
|
2017-12-12 16:55:03 +00:00
|
|
|
unsigned int flags,
|
2020-05-07 12:00:28 +00:00
|
|
|
bool skipAuth,
|
|
|
|
bool skipEnc,
|
2017-12-12 16:55:03 +00:00
|
|
|
virDomainXMLOptionPtr xmlopt);
|
2013-11-12 10:32:30 +00:00
|
|
|
|
2019-03-21 09:29:53 +00:00
|
|
|
int
|
|
|
|
virDomainDiskBackingStoreFormat(virBufferPtr buf,
|
|
|
|
virStorageSourcePtr src,
|
|
|
|
virDomainXMLOptionPtr xmlopt,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2014-02-21 10:01:36 +00:00
|
|
|
int virDomainNetDefFormat(virBufferPtr buf,
|
|
|
|
virDomainNetDefPtr def,
|
2019-11-26 16:44:40 +00:00
|
|
|
virDomainXMLOptionPtr xmlopt,
|
2014-02-21 10:01:36 +00:00
|
|
|
unsigned int flags);
|
|
|
|
|
2014-03-20 12:39:20 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_DEVICE_ACTION_ATTACH,
|
|
|
|
VIR_DOMAIN_DEVICE_ACTION_DETACH,
|
|
|
|
VIR_DOMAIN_DEVICE_ACTION_UPDATE,
|
|
|
|
} virDomainDeviceAction;
|
|
|
|
|
2012-07-03 13:30:25 +00:00
|
|
|
int virDomainDefCompatibleDevice(virDomainDefPtr def,
|
2018-02-22 12:30:27 +00:00
|
|
|
virDomainDeviceDefPtr dev,
|
2018-06-26 08:37:27 +00:00
|
|
|
virDomainDeviceDefPtr oldDev,
|
2018-06-12 14:05:10 +00:00
|
|
|
virDomainDeviceAction action,
|
|
|
|
bool live);
|
2012-07-03 13:30:25 +00:00
|
|
|
|
2013-01-11 16:34:37 +00:00
|
|
|
void virDomainRNGDefFree(virDomainRNGDefPtr def);
|
|
|
|
|
2014-11-22 01:27:38 +00:00
|
|
|
int virDomainDiskIndexByAddress(virDomainDefPtr def,
|
2016-04-03 18:16:51 +00:00
|
|
|
virPCIDeviceAddressPtr pci_controller,
|
2020-11-25 11:06:47 +00:00
|
|
|
virDomainDeviceCCWAddressPtr ccw_addr,
|
2014-11-22 01:27:38 +00:00
|
|
|
unsigned int bus, unsigned int target,
|
|
|
|
unsigned int unit);
|
2015-05-21 06:53:40 +00:00
|
|
|
virDomainDiskDefPtr virDomainDiskByAddress(virDomainDefPtr def,
|
2016-04-03 18:16:51 +00:00
|
|
|
virPCIDeviceAddressPtr pci_controller,
|
2020-11-25 11:06:47 +00:00
|
|
|
virDomainDeviceCCWAddressPtr ccw_addr,
|
2015-05-21 06:53:40 +00:00
|
|
|
unsigned int bus,
|
|
|
|
unsigned int target,
|
|
|
|
unsigned int unit);
|
snapshot: also support disks by path
I got confused when 'virsh domblkinfo dom disk' required the
path to a disk (which can be ambiguous, since a single file
can back multiple disks), rather than the unambiguous target
device name that I was using in disk snapshots. So, in true
developer fashion, I went for the best of both worlds - all
interfaces that operate on a disk (aka block) now accept
either the target name or the unambiguous path to the backing
file used by the disk.
* src/conf/domain_conf.h (virDomainDiskIndexByName): Add
parameter.
(virDomainDiskPathByName): New prototype.
* src/libvirt_private.syms (domain_conf.h): Export it.
* src/conf/domain_conf.c (virDomainDiskIndexByName): Also allow
searching by path, and decide whether ambiguity is okay.
(virDomainDiskPathByName): New function.
(virDomainDiskRemoveByName, virDomainSnapshotAlignDisks): Update
callers.
* src/qemu/qemu_driver.c (qemudDomainBlockPeek)
(qemuDomainAttachDeviceConfig, qemuDomainUpdateDeviceConfig)
(qemuDomainGetBlockInfo, qemuDiskPathToAlias): Likewise.
* src/qemu/qemu_process.c (qemuProcessFindDomainDiskByPath):
Likewise.
* src/libxl/libxl_driver.c (libxlDomainAttachDeviceDiskLive)
(libxlDomainDetachDeviceDiskLive, libxlDomainAttachDeviceConfig)
(libxlDomainUpdateDeviceConfig): Likewise.
* src/uml/uml_driver.c (umlDomainBlockPeek): Likewise.
* src/xen/xend_internal.c (xenDaemonDomainBlockPeek): Likewise.
* docs/formatsnapshot.html.in: Update documentation.
* tools/virsh.pod (domblkstat, domblkinfo): Likewise.
* docs/schemas/domaincommon.rng (diskTarget): Tighten pattern on
disk targets.
* docs/schemas/domainsnapshot.rng (disksnapshot): Update to match.
* tests/domainsnapshotxml2xmlin/disk_snapshot.xml: Update test.
2011-08-20 02:38:36 +00:00
|
|
|
int virDomainDiskIndexByName(virDomainDefPtr def, const char *name,
|
|
|
|
bool allow_ambiguous);
|
2015-05-21 06:53:40 +00:00
|
|
|
virDomainDiskDefPtr virDomainDiskByName(virDomainDefPtr def,
|
|
|
|
const char *name,
|
|
|
|
bool allow_ambiguous);
|
2019-10-14 14:54:53 +00:00
|
|
|
virDomainDiskDefPtr
|
|
|
|
virDomainDiskByTarget(virDomainDefPtr def,
|
|
|
|
const char *dst);
|
|
|
|
|
2020-11-06 03:32:57 +00:00
|
|
|
void virDomainDiskInsert(virDomainDefPtr def, virDomainDiskDefPtr disk);
|
2009-08-14 09:31:36 +00:00
|
|
|
void virDomainDiskInsertPreAlloced(virDomainDefPtr def,
|
|
|
|
virDomainDiskDefPtr disk);
|
2018-10-09 20:07:35 +00:00
|
|
|
int virDomainStorageNetworkParseHost(xmlNodePtr hostnode,
|
|
|
|
virStorageNetHostDefPtr host);
|
2013-03-15 10:40:17 +00:00
|
|
|
int virDomainDiskDefAssignAddress(virDomainXMLOptionPtr xmlopt,
|
2015-06-22 19:13:39 +00:00
|
|
|
virDomainDiskDefPtr def,
|
|
|
|
const virDomainDef *vmdef);
|
2008-07-11 16:23:36 +00:00
|
|
|
|
util: eliminate device object leaks related to virDomain*Remove*()
There are several functions in domain_conf.c that remove a device
object from the domain's list of that object type, but don't free the
object or return it to the caller to free. In many cases this isn't a
problem because the caller already had a pointer to the object and
frees it afterward, but in several cases the removed object was just
left floating around with no references to it.
In particular, the function qemuDomainDetachDeviceConfig() calls
functions to locate and remove net (virDomainNetRemoveByMac), disk
(virDomainDiskRemoveByName()), and lease (virDomainLeaseRemove())
devices, but neither it nor its caller qemuDomainModifyDeviceConfig()
ever obtain a pointer to the device being removed, much less free it.
This patch modifies the following "remove" functions to return a
pointer to the device object being removed from the domain device
arrays, to give the caller the option of freeing the device object
using that pointer if needed. In places where the object was
previously leaked, it is now freed:
virDomainDiskRemove
virDomainDiskRemoveByName
virDomainNetRemove
virDomainNetRemoveByMac
virDomainHostdevRemove
virDomainLeaseRemove
virDomainLeaseRemoveAt
The functions that had been leaking:
libxlDomainDetachConfig - leaked a virDomainDiskDef
qemuDomainDetachDeviceConfig - could leak a virDomainDiskDef,
a virDomainNetDef, or a
virDomainLeaseDef
qemuDomainDetachLease - leaked a virDomainLeaseDef
2012-03-06 23:06:14 +00:00
|
|
|
virDomainDiskDefPtr
|
|
|
|
virDomainDiskRemove(virDomainDefPtr def, size_t i);
|
|
|
|
virDomainDiskDefPtr
|
|
|
|
virDomainDiskRemoveByName(virDomainDefPtr def, const char *name);
|
2013-11-12 10:32:30 +00:00
|
|
|
|
qemu: fix attach/detach of netdevs with matching mac addrs
This resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=862515
which describes inconsistencies in dealing with duplicate mac
addresses on network devices in a domain.
(at any rate, it resolves *almost* everything, and prints out an
informative error message for the one problem that isn't solved, but
has a workaround.)
A synopsis of the problems:
1) you can't do a persistent attach-interface of a device with a mac
address that matches an existing device.
2) you *can* do a live attach-interface of such a device.
3) you *can* directly edit a domain and put in two devices with
matching mac addresses.
4) When running virsh detach-device (live or config), only MAC address
is checked when matching the device to remove, so the first device
with the desired mac address will be removed. This isn't always the
one that's wanted.
5) when running virsh detach-interface (live or config), the only two
items that can be specified to match against are mac address and model
type (virtio, etc) - if multiple netdevs match both of those
attributes, it again just finds the first one added and assumes that
is the only match.
Since it is completely valid to have multiple network devices with the
same MAC address (although it can cause problems in many cases, there
*are* valid use cases), what is needed is:
1) remove the restriction that prohibits doing a persistent add of a
netdev with a duplicate mac address.
2) enhance the backend of virDomainDetachDeviceFlags to check for
something that *is* guaranteed unique (but still work with just mac
address, as long as it yields only a single results.
This patch does three things:
1) removes the check for duplicate mac address during a persistent
netdev attach.
2) unifies the searching for both live and config detach of netdevices
in the subordinate functions of qemuDomainModifyDeviceFlags() to use the
new function virDomainNetFindIdx (which matches mac address and PCI
address if available, checking for duplicates if only mac address was
specified). This function returns -2 if multiple matches are found,
allowing the callers to print out an appropriate message.
Steps 1 & 2 are enough to fully fix the problem when using virsh
attach-device and detach-device (which require an XML description of
the device rather than a bunch of commandline args)
3) modifies the virsh detach-interface command to check for multiple
matches of mac address and show an error message suggesting use of the
detach-device command in cases where there are multiple matching mac
addresses.
Later we should decide how we want to input a PCI address on the virsh
commandline, and enhance detach-interface to take a --address option,
eliminating the need to use detach-device
* src/conf/domain_conf.c
* src/conf/domain_conf.h
* src/libvirt_private.syms
* added new virDomainNetFindIdx function
* removed now unused virDomainNetIndexByMac and
virDomainNetRemoveByMac
* src/qemu/qemu_driver.c
* remove check for duplicate max from qemuDomainAttachDeviceConfig
* use virDomainNetFindIdx/virDomainNetRemove instead
of virDomainNetRemoveByMac in qemuDomainDetachDeviceConfig
* use virDomainNetFindIdx instead of virDomainIndexByMac
in qemuDomainUpdateDeviceConfig
* src/qemu/qemu_hotplug.c
* use virDomainNetFindIdx instead of a homespun loop in
qemuDomainDetachNetDevice.
* tools/virsh-domain.c: modified detach-interface command as described
above
2012-10-25 20:03:35 +00:00
|
|
|
int virDomainNetFindIdx(virDomainDefPtr def, virDomainNetDefPtr net);
|
|
|
|
virDomainNetDefPtr virDomainNetFind(virDomainDefPtr def, const char *device);
|
2017-10-02 13:04:14 +00:00
|
|
|
virDomainNetDefPtr virDomainNetFindByName(virDomainDefPtr def, const char *ifname);
|
2015-03-06 14:36:15 +00:00
|
|
|
bool virDomainHasNet(virDomainDefPtr def, virDomainNetDefPtr net);
|
2011-05-27 07:01:47 +00:00
|
|
|
int virDomainNetInsert(virDomainDefPtr def, virDomainNetDefPtr net);
|
2019-09-25 16:42:51 +00:00
|
|
|
int virDomainNetUpdate(virDomainDefPtr def, size_t netidx, virDomainNetDefPtr newnet);
|
2020-01-21 03:37:10 +00:00
|
|
|
int virDomainNetDHCPInterfaces(virDomainDefPtr def, virDomainInterfacePtr **ifaces);
|
|
|
|
int virDomainNetARPInterfaces(virDomainDefPtr def, virDomainInterfacePtr **ifaces);
|
qemu: fix attach/detach of netdevs with matching mac addrs
This resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=862515
which describes inconsistencies in dealing with duplicate mac
addresses on network devices in a domain.
(at any rate, it resolves *almost* everything, and prints out an
informative error message for the one problem that isn't solved, but
has a workaround.)
A synopsis of the problems:
1) you can't do a persistent attach-interface of a device with a mac
address that matches an existing device.
2) you *can* do a live attach-interface of such a device.
3) you *can* directly edit a domain and put in two devices with
matching mac addresses.
4) When running virsh detach-device (live or config), only MAC address
is checked when matching the device to remove, so the first device
with the desired mac address will be removed. This isn't always the
one that's wanted.
5) when running virsh detach-interface (live or config), the only two
items that can be specified to match against are mac address and model
type (virtio, etc) - if multiple netdevs match both of those
attributes, it again just finds the first one added and assumes that
is the only match.
Since it is completely valid to have multiple network devices with the
same MAC address (although it can cause problems in many cases, there
*are* valid use cases), what is needed is:
1) remove the restriction that prohibits doing a persistent add of a
netdev with a duplicate mac address.
2) enhance the backend of virDomainDetachDeviceFlags to check for
something that *is* guaranteed unique (but still work with just mac
address, as long as it yields only a single results.
This patch does three things:
1) removes the check for duplicate mac address during a persistent
netdev attach.
2) unifies the searching for both live and config detach of netdevices
in the subordinate functions of qemuDomainModifyDeviceFlags() to use the
new function virDomainNetFindIdx (which matches mac address and PCI
address if available, checking for duplicates if only mac address was
specified). This function returns -2 if multiple matches are found,
allowing the callers to print out an appropriate message.
Steps 1 & 2 are enough to fully fix the problem when using virsh
attach-device and detach-device (which require an XML description of
the device rather than a bunch of commandline args)
3) modifies the virsh detach-interface command to check for multiple
matches of mac address and show an error message suggesting use of the
detach-device command in cases where there are multiple matching mac
addresses.
Later we should decide how we want to input a PCI address on the virsh
commandline, and enhance detach-interface to take a --address option,
eliminating the need to use detach-device
* src/conf/domain_conf.c
* src/conf/domain_conf.h
* src/libvirt_private.syms
* added new virDomainNetFindIdx function
* removed now unused virDomainNetIndexByMac and
virDomainNetRemoveByMac
* src/qemu/qemu_driver.c
* remove check for duplicate max from qemuDomainAttachDeviceConfig
* use virDomainNetFindIdx/virDomainNetRemove instead
of virDomainNetRemoveByMac in qemuDomainDetachDeviceConfig
* use virDomainNetFindIdx instead of virDomainIndexByMac
in qemuDomainUpdateDeviceConfig
* src/qemu/qemu_hotplug.c
* use virDomainNetFindIdx instead of a homespun loop in
qemuDomainDetachNetDevice.
* tools/virsh-domain.c: modified detach-interface command as described
above
2012-10-25 20:03:35 +00:00
|
|
|
virDomainNetDefPtr virDomainNetRemove(virDomainDefPtr def, size_t i);
|
2013-08-27 17:06:18 +00:00
|
|
|
void virDomainNetRemoveHostdev(virDomainDefPtr def, virDomainNetDefPtr net);
|
2011-05-27 07:01:47 +00:00
|
|
|
|
2012-02-27 06:46:47 +00:00
|
|
|
int virDomainHostdevInsert(virDomainDefPtr def, virDomainHostdevDefPtr hostdev);
|
util: eliminate device object leaks related to virDomain*Remove*()
There are several functions in domain_conf.c that remove a device
object from the domain's list of that object type, but don't free the
object or return it to the caller to free. In many cases this isn't a
problem because the caller already had a pointer to the object and
frees it afterward, but in several cases the removed object was just
left floating around with no references to it.
In particular, the function qemuDomainDetachDeviceConfig() calls
functions to locate and remove net (virDomainNetRemoveByMac), disk
(virDomainDiskRemoveByName()), and lease (virDomainLeaseRemove())
devices, but neither it nor its caller qemuDomainModifyDeviceConfig()
ever obtain a pointer to the device being removed, much less free it.
This patch modifies the following "remove" functions to return a
pointer to the device object being removed from the domain device
arrays, to give the caller the option of freeing the device object
using that pointer if needed. In places where the object was
previously leaked, it is now freed:
virDomainDiskRemove
virDomainDiskRemoveByName
virDomainNetRemove
virDomainNetRemoveByMac
virDomainHostdevRemove
virDomainLeaseRemove
virDomainLeaseRemoveAt
The functions that had been leaking:
libxlDomainDetachConfig - leaked a virDomainDiskDef
qemuDomainDetachDeviceConfig - could leak a virDomainDiskDef,
a virDomainNetDef, or a
virDomainLeaseDef
qemuDomainDetachLease - leaked a virDomainLeaseDef
2012-03-06 23:06:14 +00:00
|
|
|
virDomainHostdevDefPtr
|
|
|
|
virDomainHostdevRemove(virDomainDefPtr def, size_t i);
|
2012-02-27 06:46:47 +00:00
|
|
|
int virDomainHostdevFind(virDomainDefPtr def, virDomainHostdevDefPtr match,
|
|
|
|
virDomainHostdevDefPtr *found);
|
|
|
|
|
2016-04-10 16:57:12 +00:00
|
|
|
virDomainGraphicsListenDefPtr
|
|
|
|
virDomainGraphicsGetListen(virDomainGraphicsDefPtr def, size_t i);
|
2016-03-23 07:55:46 +00:00
|
|
|
int virDomainGraphicsListenAppendAddress(virDomainGraphicsDefPtr def,
|
|
|
|
const char *address)
|
conf: add <listen> subelement to domain <graphics> element
Once it's plugged in, the <listen> element will be an optional
replacement for the "listen" attribute that graphics elements already
have. If the <listen> element is type='address', it will have an
attribute called 'address' which will contain an IP address or dns
name that the guest's display server should listen on. If, however,
type='network', the <listen> element should have an attribute called
'network' that will be set to the name of a network configuration to
get the IP address from.
* docs/schemas/domain.rng: updated to allow the <listen> element
* docs/formatdomain.html.in: document the <listen> element and its
attributes.
* src/conf/domain_conf.[hc]:
1) The domain parser, formatter, and data structure are modified to
support 0 or more <listen> subelements to each <graphics>
element. The old style "legacy" listen attribute is also still
accepted, and will be stored internally just as if it were a
separate <listen> element. On output (i.e. format), the address
attribute of the first <listen> element of type 'address' will be
duplicated in the legacy "listen" attribute of the <graphic>
element.
2) The "listenAddr" attribute has been removed from the unions in
virDomainGRaphicsDef for graphics types vnc, rdp, and spice.
This attribute is now in the <listen> subelement (aka
virDomainGraphicsListenDef)
3) Helper functions were written to provide simple access
(both Get and Set) to the listen elements and their attributes.
* src/libvirt_private.syms: export the listen helper functions
* src/qemu/qemu_command.c, src/qemu/qemu_hotplug.c,
src/qemu/qemu_migration.c, src/vbox/vbox_tmpl.c,
src/vmx/vmx.c, src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c
Modify all these files to use the listen helper functions rather
than directly referencing the (now missing) listenAddr
attribute. There can be multiple <listen> elements to a single
<graphics>, but the drivers all currently only support one, so all
replacements of direct access with a helper function indicate index
"0".
* tests/* - only 3 of these are new files added explicitly to test the
new <listen> element. All the others have been modified to reflect
the fact that any legacy "listen" attributes passed in to the domain
parse will be saved in a <listen> element (i.e. one of the
virDomainGraphicsListenDefs), and during the domain format function,
both the <listen> element as well as the legacy attributes will be
output.
2011-07-07 04:20:28 +00:00
|
|
|
ATTRIBUTE_NONNULL(1);
|
2016-06-08 08:35:37 +00:00
|
|
|
int virDomainGraphicsListenAppendSocket(virDomainGraphicsDefPtr def,
|
|
|
|
const char *socket)
|
|
|
|
ATTRIBUTE_NONNULL(1);
|
conf: add <listen> subelement to domain <graphics> element
Once it's plugged in, the <listen> element will be an optional
replacement for the "listen" attribute that graphics elements already
have. If the <listen> element is type='address', it will have an
attribute called 'address' which will contain an IP address or dns
name that the guest's display server should listen on. If, however,
type='network', the <listen> element should have an attribute called
'network' that will be set to the name of a network configuration to
get the IP address from.
* docs/schemas/domain.rng: updated to allow the <listen> element
* docs/formatdomain.html.in: document the <listen> element and its
attributes.
* src/conf/domain_conf.[hc]:
1) The domain parser, formatter, and data structure are modified to
support 0 or more <listen> subelements to each <graphics>
element. The old style "legacy" listen attribute is also still
accepted, and will be stored internally just as if it were a
separate <listen> element. On output (i.e. format), the address
attribute of the first <listen> element of type 'address' will be
duplicated in the legacy "listen" attribute of the <graphic>
element.
2) The "listenAddr" attribute has been removed from the unions in
virDomainGRaphicsDef for graphics types vnc, rdp, and spice.
This attribute is now in the <listen> subelement (aka
virDomainGraphicsListenDef)
3) Helper functions were written to provide simple access
(both Get and Set) to the listen elements and their attributes.
* src/libvirt_private.syms: export the listen helper functions
* src/qemu/qemu_command.c, src/qemu/qemu_hotplug.c,
src/qemu/qemu_migration.c, src/vbox/vbox_tmpl.c,
src/vmx/vmx.c, src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c
Modify all these files to use the listen helper functions rather
than directly referencing the (now missing) listenAddr
attribute. There can be multiple <listen> elements to a single
<graphics>, but the drivers all currently only support one, so all
replacements of direct access with a helper function indicate index
"0".
* tests/* - only 3 of these are new files added explicitly to test the
new <listen> element. All the others have been modified to reflect
the fact that any legacy "listen" attributes passed in to the domain
parse will be saved in a <listen> element (i.e. one of the
virDomainGraphicsListenDefs), and during the domain format function,
both the <listen> element as well as the legacy attributes will be
output.
2011-07-07 04:20:28 +00:00
|
|
|
|
2017-10-02 11:36:56 +00:00
|
|
|
virDomainNetType virDomainNetGetActualType(const virDomainNetDef *iface);
|
2019-10-01 17:06:24 +00:00
|
|
|
const char *virDomainNetGetActualBridgeName(const virDomainNetDef *iface);
|
|
|
|
int virDomainNetGetActualBridgeMACTableManager(const virDomainNetDef *iface);
|
|
|
|
const char *virDomainNetGetActualDirectDev(const virDomainNetDef *iface);
|
|
|
|
int virDomainNetGetActualDirectMode(const virDomainNetDef *iface);
|
2012-02-15 17:37:15 +00:00
|
|
|
virDomainHostdevDefPtr virDomainNetGetActualHostdev(virDomainNetDefPtr iface);
|
2019-10-01 17:56:35 +00:00
|
|
|
const virNetDevVPortProfile *
|
2019-09-12 18:56:41 +00:00
|
|
|
virDomainNetGetActualVirtPortProfile(const virDomainNetDef *iface);
|
2019-10-01 16:52:03 +00:00
|
|
|
const virNetDevBandwidth *
|
|
|
|
virDomainNetGetActualBandwidth(const virDomainNetDef *iface);
|
2019-10-01 16:25:47 +00:00
|
|
|
const virNetDevVlan *virDomainNetGetActualVlan(const virDomainNetDef *iface);
|
2019-10-01 17:06:24 +00:00
|
|
|
bool virDomainNetGetActualTrustGuestRxFilters(const virDomainNetDef *iface);
|
2020-01-29 15:29:21 +00:00
|
|
|
virTristateBool
|
|
|
|
virDomainNetGetActualPortOptionsIsolated(const virDomainNetDef *iface);
|
2019-01-17 22:06:28 +00:00
|
|
|
const char *virDomainNetGetModelString(const virDomainNetDef *net);
|
|
|
|
int virDomainNetSetModelString(virDomainNetDefPtr et,
|
|
|
|
const char *model);
|
2019-01-21 22:59:02 +00:00
|
|
|
bool virDomainNetIsVirtioModel(const virDomainNetDef *net);
|
2016-06-08 16:48:50 +00:00
|
|
|
int virDomainNetAppendIPAddress(virDomainNetDefPtr def,
|
2014-07-22 09:09:48 +00:00
|
|
|
const char *address,
|
|
|
|
int family,
|
|
|
|
unsigned int prefix);
|
2011-06-26 08:09:00 +00:00
|
|
|
|
2020-11-06 03:32:58 +00:00
|
|
|
void virDomainControllerInsert(virDomainDefPtr def, virDomainControllerDefPtr controller);
|
2009-12-02 19:15:38 +00:00
|
|
|
void virDomainControllerInsertPreAlloced(virDomainDefPtr def,
|
|
|
|
virDomainControllerDefPtr controller);
|
2016-02-18 13:33:39 +00:00
|
|
|
int virDomainControllerFind(const virDomainDef *def, int type, int idx);
|
2015-03-02 09:58:48 +00:00
|
|
|
int virDomainControllerFindByType(virDomainDefPtr def, int type);
|
2020-11-25 11:06:48 +00:00
|
|
|
int virDomainControllerFindByCCWAddress(virDomainDefPtr def,
|
|
|
|
virDomainDeviceCCWAddressPtr addr);
|
2014-11-22 01:27:38 +00:00
|
|
|
int virDomainControllerFindByPCIAddress(virDomainDefPtr def,
|
2016-04-03 18:16:51 +00:00
|
|
|
virPCIDeviceAddressPtr addr);
|
2016-05-08 20:28:40 +00:00
|
|
|
int virDomainControllerFindUnusedIndex(virDomainDef const *def, int type);
|
2012-07-23 08:18:57 +00:00
|
|
|
virDomainControllerDefPtr virDomainControllerRemove(virDomainDefPtr def, size_t i);
|
2016-02-18 13:33:39 +00:00
|
|
|
const char *virDomainControllerAliasFind(const virDomainDef *def,
|
2015-04-29 19:37:20 +00:00
|
|
|
int type, int idx)
|
|
|
|
ATTRIBUTE_NONNULL(1);
|
2011-05-18 16:20:53 +00:00
|
|
|
|
|
|
|
int virDomainLeaseIndex(virDomainDefPtr def,
|
|
|
|
virDomainLeaseDefPtr lease);
|
2020-11-06 03:33:01 +00:00
|
|
|
void virDomainLeaseInsert(virDomainDefPtr def, virDomainLeaseDefPtr lease);
|
2020-11-06 03:33:00 +00:00
|
|
|
void virDomainLeaseInsertPreAlloc(virDomainDefPtr def);
|
2011-05-18 16:20:53 +00:00
|
|
|
void virDomainLeaseInsertPreAlloced(virDomainDefPtr def,
|
|
|
|
virDomainLeaseDefPtr lease);
|
util: eliminate device object leaks related to virDomain*Remove*()
There are several functions in domain_conf.c that remove a device
object from the domain's list of that object type, but don't free the
object or return it to the caller to free. In many cases this isn't a
problem because the caller already had a pointer to the object and
frees it afterward, but in several cases the removed object was just
left floating around with no references to it.
In particular, the function qemuDomainDetachDeviceConfig() calls
functions to locate and remove net (virDomainNetRemoveByMac), disk
(virDomainDiskRemoveByName()), and lease (virDomainLeaseRemove())
devices, but neither it nor its caller qemuDomainModifyDeviceConfig()
ever obtain a pointer to the device being removed, much less free it.
This patch modifies the following "remove" functions to return a
pointer to the device object being removed from the domain device
arrays, to give the caller the option of freeing the device object
using that pointer if needed. In places where the object was
previously leaked, it is now freed:
virDomainDiskRemove
virDomainDiskRemoveByName
virDomainNetRemove
virDomainNetRemoveByMac
virDomainHostdevRemove
virDomainLeaseRemove
virDomainLeaseRemoveAt
The functions that had been leaking:
libxlDomainDetachConfig - leaked a virDomainDiskDef
qemuDomainDetachDeviceConfig - could leak a virDomainDiskDef,
a virDomainNetDef, or a
virDomainLeaseDef
qemuDomainDetachLease - leaked a virDomainLeaseDef
2012-03-06 23:06:14 +00:00
|
|
|
virDomainLeaseDefPtr
|
|
|
|
virDomainLeaseRemoveAt(virDomainDefPtr def, size_t i);
|
|
|
|
virDomainLeaseDefPtr
|
|
|
|
virDomainLeaseRemove(virDomainDefPtr def,
|
|
|
|
virDomainLeaseDefPtr lease);
|
2011-05-18 16:20:53 +00:00
|
|
|
|
2013-03-12 14:55:07 +00:00
|
|
|
void
|
2013-10-07 23:45:55 +00:00
|
|
|
virDomainChrGetDomainPtrs(const virDomainDef *vmdef,
|
2014-06-01 00:22:30 +00:00
|
|
|
virDomainChrDeviceType type,
|
2013-10-07 23:45:55 +00:00
|
|
|
const virDomainChrDef ***arrPtr,
|
|
|
|
size_t *cntPtr)
|
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
|
2013-03-12 14:55:07 +00:00
|
|
|
virDomainChrDefPtr
|
|
|
|
virDomainChrFind(virDomainDefPtr def,
|
|
|
|
virDomainChrDefPtr target);
|
2013-03-12 14:59:25 +00:00
|
|
|
bool
|
|
|
|
virDomainChrEquals(virDomainChrDefPtr src,
|
|
|
|
virDomainChrDefPtr tgt);
|
2013-03-12 14:55:07 +00:00
|
|
|
int
|
2015-01-27 17:30:15 +00:00
|
|
|
virDomainChrPreAlloc(virDomainDefPtr vmdef,
|
|
|
|
virDomainChrDefPtr chr);
|
|
|
|
void
|
|
|
|
virDomainChrInsertPreAlloced(virDomainDefPtr vmdef,
|
|
|
|
virDomainChrDefPtr chr);
|
2013-03-12 14:55:07 +00:00
|
|
|
virDomainChrDefPtr
|
|
|
|
virDomainChrRemove(virDomainDefPtr vmdef,
|
|
|
|
virDomainChrDefPtr chr);
|
|
|
|
|
2015-01-17 05:09:32 +00:00
|
|
|
ssize_t virDomainRNGFind(virDomainDefPtr def, virDomainRNGDefPtr rng);
|
|
|
|
virDomainRNGDefPtr virDomainRNGRemove(virDomainDefPtr def, size_t idx);
|
|
|
|
|
2016-06-09 09:17:01 +00:00
|
|
|
ssize_t virDomainRedirdevDefFind(virDomainDefPtr def,
|
|
|
|
virDomainRedirdevDefPtr redirdev);
|
|
|
|
virDomainRedirdevDefPtr virDomainRedirdevDefRemove(virDomainDefPtr def, size_t idx);
|
|
|
|
|
2019-11-26 19:40:46 +00:00
|
|
|
int virDomainDefSave(virDomainDefPtr def,
|
|
|
|
virDomainXMLOptionPtr xmlopt,
|
|
|
|
const char *configDir)
|
|
|
|
G_GNUC_WARN_UNUSED_RESULT
|
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
|
2019-12-14 15:37:57 +00:00
|
|
|
ATTRIBUTE_NONNULL(3);
|
2019-11-26 19:40:46 +00:00
|
|
|
|
|
|
|
int virDomainObjSave(virDomainObjPtr obj,
|
|
|
|
virDomainXMLOptionPtr xmlopt,
|
|
|
|
const char *statusDir)
|
|
|
|
G_GNUC_WARN_UNUSED_RESULT
|
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
|
2019-12-14 15:37:57 +00:00
|
|
|
ATTRIBUTE_NONNULL(3);
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2008-11-17 16:52:32 +00:00
|
|
|
typedef void (*virDomainLoadConfigNotify)(virDomainObjPtr dom,
|
|
|
|
int newDomain,
|
|
|
|
void *opaque);
|
|
|
|
|
2010-02-09 18:58:01 +00:00
|
|
|
int virDomainDeleteConfig(const char *configDir,
|
2008-08-20 19:42:36 +00:00
|
|
|
const char *autostartDir,
|
2008-07-11 16:23:36 +00:00
|
|
|
virDomainObjPtr dom);
|
|
|
|
|
2010-02-09 18:58:01 +00:00
|
|
|
char *virDomainConfigFile(const char *dir,
|
2008-08-20 19:42:36 +00:00
|
|
|
const char *name);
|
|
|
|
|
2008-09-03 16:05:25 +00:00
|
|
|
int virDiskNameToBusDeviceIndex(virDomainDiskDefPtr disk,
|
|
|
|
int *busIdx,
|
|
|
|
int *devIdx);
|
|
|
|
|
2013-11-12 11:57:56 +00:00
|
|
|
virDomainFSDefPtr virDomainGetFilesystemForTarget(virDomainDefPtr def,
|
2014-08-07 13:01:16 +00:00
|
|
|
const char *target);
|
2014-02-06 14:30:07 +00:00
|
|
|
int virDomainFSInsert(virDomainDefPtr def, virDomainFSDefPtr fs);
|
2012-05-29 18:46:38 +00:00
|
|
|
int virDomainFSIndexByName(virDomainDefPtr def, const char *name);
|
2014-02-06 14:30:07 +00:00
|
|
|
virDomainFSDefPtr virDomainFSRemove(virDomainDefPtr def, size_t i);
|
|
|
|
|
2014-11-24 10:58:53 +00:00
|
|
|
unsigned int virDomainVideoDefaultRAM(const virDomainDef *def,
|
|
|
|
const virDomainVideoType type);
|
2009-04-22 14:26:50 +00:00
|
|
|
|
2011-01-10 16:41:33 +00:00
|
|
|
typedef int (*virDomainSmartcardDefIterator)(virDomainDefPtr def,
|
|
|
|
virDomainSmartcardDefPtr dev,
|
|
|
|
void *opaque);
|
|
|
|
|
|
|
|
int virDomainSmartcardDefForeach(virDomainDefPtr def,
|
|
|
|
bool abortOnError,
|
|
|
|
virDomainSmartcardDefIterator iter,
|
|
|
|
void *opaque);
|
|
|
|
|
2010-06-24 14:06:43 +00:00
|
|
|
typedef int (*virDomainChrDefIterator)(virDomainDefPtr def,
|
|
|
|
virDomainChrDefPtr dev,
|
|
|
|
void *opaque);
|
|
|
|
|
|
|
|
int virDomainChrDefForeach(virDomainDefPtr def,
|
|
|
|
bool abortOnError,
|
|
|
|
virDomainChrDefIterator iter,
|
|
|
|
void *opaque);
|
|
|
|
|
2016-06-23 03:04:48 +00:00
|
|
|
typedef int (*virDomainUSBDeviceDefIterator)(virDomainDeviceInfoPtr info,
|
|
|
|
void *opaque);
|
|
|
|
int virDomainUSBDeviceDefForeach(virDomainDefPtr def,
|
|
|
|
virDomainUSBDeviceDefIterator iter,
|
|
|
|
void *opaque,
|
|
|
|
bool skipHubs);
|
|
|
|
|
2011-05-04 09:07:01 +00:00
|
|
|
void
|
|
|
|
virDomainObjSetState(virDomainObjPtr obj, virDomainState state, int reason)
|
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
virDomainState
|
|
|
|
virDomainObjGetState(virDomainObjPtr obj, int *reason)
|
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
|
2012-08-15 22:10:36 +00:00
|
|
|
virSecurityLabelDefPtr
|
|
|
|
virDomainDefGetSecurityLabelDef(virDomainDefPtr def, const char *model);
|
|
|
|
|
2012-09-20 13:16:17 +00:00
|
|
|
virSecurityDeviceLabelDefPtr
|
2017-05-26 15:53:09 +00:00
|
|
|
virDomainChrSourceDefGetSecurityLabelDef(virDomainChrSourceDefPtr def,
|
|
|
|
const char *model);
|
2012-09-20 13:16:17 +00:00
|
|
|
|
2012-09-06 19:56:49 +00:00
|
|
|
typedef const char* (*virEventActionToStringFunc)(int type);
|
|
|
|
typedef int (*virEventActionFromStringFunc)(const char *type);
|
2010-08-12 17:15:44 +00:00
|
|
|
|
2015-01-21 14:49:44 +00:00
|
|
|
int virDomainMemoryInsert(virDomainDefPtr def, virDomainMemoryDefPtr mem)
|
2019-10-14 12:25:14 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT;
|
2015-01-21 14:49:44 +00:00
|
|
|
virDomainMemoryDefPtr virDomainMemoryRemove(virDomainDefPtr def, int idx)
|
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
int virDomainMemoryFindByDef(virDomainDefPtr def, virDomainMemoryDefPtr mem)
|
2019-10-14 12:25:14 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT;
|
2015-01-21 14:49:44 +00:00
|
|
|
int virDomainMemoryFindInactiveByDef(virDomainDefPtr def,
|
|
|
|
virDomainMemoryDefPtr mem)
|
2019-10-14 12:25:14 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT;
|
2015-01-21 14:49:44 +00:00
|
|
|
|
2016-09-12 11:41:07 +00:00
|
|
|
int virDomainShmemDefInsert(virDomainDefPtr def, virDomainShmemDefPtr shmem)
|
2019-10-14 12:25:14 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT;
|
2016-09-12 11:41:07 +00:00
|
|
|
bool virDomainShmemDefEquals(virDomainShmemDefPtr src, virDomainShmemDefPtr dst)
|
2019-10-14 12:25:14 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT;
|
2016-09-12 11:41:07 +00:00
|
|
|
ssize_t virDomainShmemDefFind(virDomainDefPtr def, virDomainShmemDefPtr shmem)
|
2019-10-14 12:25:14 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT;
|
2016-09-12 11:41:07 +00:00
|
|
|
virDomainShmemDefPtr virDomainShmemDefRemove(virDomainDefPtr def, size_t idx)
|
|
|
|
ATTRIBUTE_NONNULL(1);
|
2017-10-03 14:25:13 +00:00
|
|
|
ssize_t virDomainInputDefFind(const virDomainDef *def,
|
|
|
|
const virDomainInputDef *input)
|
2019-10-14 12:25:14 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT;
|
2018-05-30 13:52:28 +00:00
|
|
|
bool virDomainVsockDefEquals(const virDomainVsockDef *a,
|
|
|
|
const virDomainVsockDef *b)
|
2019-10-14 12:25:14 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT;
|
2016-09-12 11:41:07 +00:00
|
|
|
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virDomainTaint);
|
|
|
|
VIR_ENUM_DECL(virDomainVirt);
|
|
|
|
VIR_ENUM_DECL(virDomainBoot);
|
|
|
|
VIR_ENUM_DECL(virDomainFeature);
|
|
|
|
VIR_ENUM_DECL(virDomainCapabilitiesPolicy);
|
2019-10-25 12:50:15 +00:00
|
|
|
VIR_ENUM_DECL(virDomainProcessCapsFeature);
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virDomainLifecycle);
|
|
|
|
VIR_ENUM_DECL(virDomainLifecycleAction);
|
|
|
|
VIR_ENUM_DECL(virDomainDevice);
|
|
|
|
VIR_ENUM_DECL(virDomainDiskDevice);
|
|
|
|
VIR_ENUM_DECL(virDomainDiskGeometryTrans);
|
|
|
|
VIR_ENUM_DECL(virDomainDiskBus);
|
|
|
|
VIR_ENUM_DECL(virDomainDiskCache);
|
|
|
|
VIR_ENUM_DECL(virDomainDiskErrorPolicy);
|
|
|
|
VIR_ENUM_DECL(virDomainDiskIo);
|
|
|
|
VIR_ENUM_DECL(virDomainDeviceSGIO);
|
|
|
|
VIR_ENUM_DECL(virDomainDiskTray);
|
|
|
|
VIR_ENUM_DECL(virDomainDiskDiscard);
|
|
|
|
VIR_ENUM_DECL(virDomainDiskDetectZeroes);
|
2019-01-11 20:06:05 +00:00
|
|
|
VIR_ENUM_DECL(virDomainDiskModel);
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virDomainDiskMirrorState);
|
|
|
|
VIR_ENUM_DECL(virDomainController);
|
|
|
|
VIR_ENUM_DECL(virDomainControllerModelPCI);
|
|
|
|
VIR_ENUM_DECL(virDomainControllerPCIModelName);
|
|
|
|
VIR_ENUM_DECL(virDomainControllerModelSCSI);
|
|
|
|
VIR_ENUM_DECL(virDomainControllerModelUSB);
|
|
|
|
VIR_ENUM_DECL(virDomainControllerModelIDE);
|
2019-01-17 17:52:44 +00:00
|
|
|
VIR_ENUM_DECL(virDomainControllerModelVirtioSerial);
|
2019-02-17 13:04:00 +00:00
|
|
|
VIR_ENUM_DECL(virDomainControllerModelISA);
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virDomainFS);
|
|
|
|
VIR_ENUM_DECL(virDomainFSDriver);
|
|
|
|
VIR_ENUM_DECL(virDomainFSAccessMode);
|
|
|
|
VIR_ENUM_DECL(virDomainFSWrpolicy);
|
2019-01-17 17:52:36 +00:00
|
|
|
VIR_ENUM_DECL(virDomainFSModel);
|
2020-01-21 07:14:46 +00:00
|
|
|
VIR_ENUM_DECL(virDomainFSCacheMode);
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virDomainNet);
|
|
|
|
VIR_ENUM_DECL(virDomainNetBackend);
|
|
|
|
VIR_ENUM_DECL(virDomainNetVirtioTxMode);
|
2020-07-13 14:28:53 +00:00
|
|
|
VIR_ENUM_DECL(virDomainNetMacType);
|
2020-01-22 21:24:10 +00:00
|
|
|
VIR_ENUM_DECL(virDomainNetTeaming);
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virDomainNetInterfaceLinkState);
|
2019-01-18 00:12:27 +00:00
|
|
|
VIR_ENUM_DECL(virDomainNetModel);
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virDomainChrDevice);
|
|
|
|
VIR_ENUM_DECL(virDomainChrChannelTarget);
|
|
|
|
VIR_ENUM_DECL(virDomainChrConsoleTarget);
|
|
|
|
VIR_ENUM_DECL(virDomainChrSerialTarget);
|
|
|
|
VIR_ENUM_DECL(virDomainSmartcard);
|
|
|
|
VIR_ENUM_DECL(virDomainChr);
|
|
|
|
VIR_ENUM_DECL(virDomainChrTcpProtocol);
|
|
|
|
VIR_ENUM_DECL(virDomainChrSpicevmc);
|
|
|
|
VIR_ENUM_DECL(virDomainSoundCodec);
|
|
|
|
VIR_ENUM_DECL(virDomainSoundModel);
|
2020-07-18 06:23:57 +00:00
|
|
|
VIR_ENUM_DECL(virDomainAudioType);
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virDomainKeyWrapCipherName);
|
|
|
|
VIR_ENUM_DECL(virDomainMemballoonModel);
|
|
|
|
VIR_ENUM_DECL(virDomainSmbiosMode);
|
|
|
|
VIR_ENUM_DECL(virDomainWatchdogModel);
|
|
|
|
VIR_ENUM_DECL(virDomainWatchdogAction);
|
|
|
|
VIR_ENUM_DECL(virDomainPanicModel);
|
|
|
|
VIR_ENUM_DECL(virDomainVideo);
|
2019-09-23 10:44:26 +00:00
|
|
|
VIR_ENUM_DECL(virDomainVideoBackend);
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virDomainHostdevMode);
|
|
|
|
VIR_ENUM_DECL(virDomainHostdevSubsys);
|
|
|
|
VIR_ENUM_DECL(virDomainHostdevCaps);
|
|
|
|
VIR_ENUM_DECL(virDomainHub);
|
|
|
|
VIR_ENUM_DECL(virDomainRedirdevBus);
|
|
|
|
VIR_ENUM_DECL(virDomainInput);
|
|
|
|
VIR_ENUM_DECL(virDomainInputBus);
|
2019-01-17 17:52:41 +00:00
|
|
|
VIR_ENUM_DECL(virDomainInputModel);
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virDomainGraphics);
|
|
|
|
VIR_ENUM_DECL(virDomainGraphicsListen);
|
|
|
|
VIR_ENUM_DECL(virDomainGraphicsAuthConnected);
|
|
|
|
VIR_ENUM_DECL(virDomainGraphicsSpiceChannelName);
|
|
|
|
VIR_ENUM_DECL(virDomainGraphicsSpiceChannelMode);
|
|
|
|
VIR_ENUM_DECL(virDomainGraphicsSpiceImageCompression);
|
|
|
|
VIR_ENUM_DECL(virDomainGraphicsSpiceJpegCompression);
|
|
|
|
VIR_ENUM_DECL(virDomainGraphicsSpiceZlibCompression);
|
|
|
|
VIR_ENUM_DECL(virDomainGraphicsSpiceStreamingMode);
|
|
|
|
VIR_ENUM_DECL(virDomainGraphicsSpiceMouseMode);
|
|
|
|
VIR_ENUM_DECL(virDomainGraphicsVNCSharePolicy);
|
|
|
|
VIR_ENUM_DECL(virDomainHyperv);
|
|
|
|
VIR_ENUM_DECL(virDomainKVM);
|
2020-04-14 02:37:04 +00:00
|
|
|
VIR_ENUM_DECL(virDomainXen);
|
2020-04-15 22:34:54 +00:00
|
|
|
VIR_ENUM_DECL(virDomainXenPassthroughMode);
|
2019-01-24 03:23:31 +00:00
|
|
|
VIR_ENUM_DECL(virDomainMsrsUnknown);
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virDomainRNGModel);
|
|
|
|
VIR_ENUM_DECL(virDomainRNGBackend);
|
|
|
|
VIR_ENUM_DECL(virDomainTPMModel);
|
|
|
|
VIR_ENUM_DECL(virDomainTPMBackend);
|
|
|
|
VIR_ENUM_DECL(virDomainTPMVersion);
|
|
|
|
VIR_ENUM_DECL(virDomainMemoryModel);
|
|
|
|
VIR_ENUM_DECL(virDomainMemoryBackingModel);
|
|
|
|
VIR_ENUM_DECL(virDomainMemorySource);
|
|
|
|
VIR_ENUM_DECL(virDomainMemoryAllocation);
|
|
|
|
VIR_ENUM_DECL(virDomainIOMMUModel);
|
|
|
|
VIR_ENUM_DECL(virDomainVsockModel);
|
|
|
|
VIR_ENUM_DECL(virDomainShmemModel);
|
2020-07-24 03:34:11 +00:00
|
|
|
VIR_ENUM_DECL(virDomainShmemRole);
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virDomainLaunchSecurity);
|
2009-01-19 21:06:26 +00:00
|
|
|
/* from libvirt.h */
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virDomainState);
|
|
|
|
VIR_ENUM_DECL(virDomainNostateReason);
|
|
|
|
VIR_ENUM_DECL(virDomainRunningReason);
|
|
|
|
VIR_ENUM_DECL(virDomainBlockedReason);
|
|
|
|
VIR_ENUM_DECL(virDomainPausedReason);
|
|
|
|
VIR_ENUM_DECL(virDomainShutdownReason);
|
|
|
|
VIR_ENUM_DECL(virDomainShutoffReason);
|
|
|
|
VIR_ENUM_DECL(virDomainCrashedReason);
|
|
|
|
VIR_ENUM_DECL(virDomainPMSuspendedReason);
|
2011-05-04 09:07:01 +00:00
|
|
|
|
|
|
|
const char *virDomainStateReasonToString(virDomainState state, int reason);
|
|
|
|
int virDomainStateReasonFromString(virDomainState state, const char *reason);
|
|
|
|
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virDomainSeclabel);
|
|
|
|
VIR_ENUM_DECL(virDomainClockOffset);
|
|
|
|
VIR_ENUM_DECL(virDomainClockBasis);
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virDomainTimerName);
|
|
|
|
VIR_ENUM_DECL(virDomainTimerTrack);
|
|
|
|
VIR_ENUM_DECL(virDomainTimerTickpolicy);
|
|
|
|
VIR_ENUM_DECL(virDomainTimerMode);
|
|
|
|
VIR_ENUM_DECL(virDomainCpuPlacementMode);
|
2010-03-30 11:44:22 +00:00
|
|
|
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virDomainStartupPolicy);
|
2011-12-29 10:27:35 +00:00
|
|
|
|
2016-04-19 19:31:36 +00:00
|
|
|
virDomainControllerDefPtr
|
|
|
|
virDomainDefAddController(virDomainDefPtr def, int type, int idx, int model);
|
2015-11-05 20:16:50 +00:00
|
|
|
int
|
|
|
|
virDomainDefAddUSBController(virDomainDefPtr def, int idx, int model);
|
2013-04-22 12:16:13 +00:00
|
|
|
int
|
|
|
|
virDomainDefMaybeAddController(virDomainDefPtr def,
|
|
|
|
int type,
|
|
|
|
int idx,
|
|
|
|
int model);
|
2014-02-17 10:17:52 +00:00
|
|
|
int
|
|
|
|
virDomainDefMaybeAddInput(virDomainDefPtr def,
|
|
|
|
int type,
|
|
|
|
int bus);
|
2013-04-22 12:16:13 +00:00
|
|
|
|
2013-03-11 11:12:08 +00:00
|
|
|
char *virDomainDefGetDefaultEmulator(virDomainDefPtr def, virCapsPtr caps);
|
|
|
|
|
2013-07-11 14:54:16 +00:00
|
|
|
int virDomainDefFindDevice(virDomainDefPtr def,
|
|
|
|
const char *devAlias,
|
2013-07-19 12:59:36 +00:00
|
|
|
virDomainDeviceDefPtr dev,
|
|
|
|
bool reportError);
|
2013-07-11 14:54:16 +00:00
|
|
|
|
2020-07-18 11:23:28 +00:00
|
|
|
virDomainAudioDefPtr
|
|
|
|
virDomainDefFindAudioForSound(virDomainDefPtr def,
|
|
|
|
virDomainSoundDefPtr sound);
|
|
|
|
|
2017-06-19 14:43:25 +00:00
|
|
|
const char *virDomainChrSourceDefGetPath(virDomainChrSourceDefPtr chr);
|
|
|
|
|
2013-07-22 14:45:32 +00:00
|
|
|
void virDomainChrSourceDefClear(virDomainChrSourceDefPtr def);
|
|
|
|
|
2013-06-11 13:45:05 +00:00
|
|
|
char *virDomainObjGetMetadata(virDomainObjPtr vm,
|
|
|
|
int type,
|
|
|
|
const char *uri,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2013-06-11 13:45:05 +00:00
|
|
|
int virDomainObjSetMetadata(virDomainObjPtr vm,
|
|
|
|
int type,
|
|
|
|
const char *metadata,
|
|
|
|
const char *key,
|
|
|
|
const char *uri,
|
|
|
|
virDomainXMLOptionPtr xmlopt,
|
2014-07-22 15:41:05 +00:00
|
|
|
const char *stateDir,
|
2013-06-11 13:45:05 +00:00
|
|
|
const char *configDir,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2014-11-10 11:52:05 +00:00
|
|
|
int
|
|
|
|
virDomainParseMemory(const char *xpath,
|
|
|
|
const char *units_xpath,
|
|
|
|
xmlXPathContextPtr ctxt,
|
|
|
|
unsigned long long *mem,
|
|
|
|
bool required,
|
|
|
|
bool capped);
|
|
|
|
|
2014-06-09 13:00:22 +00:00
|
|
|
bool virDomainDefNeedsPlacementAdvice(virDomainDefPtr def)
|
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
|
2016-05-27 10:34:14 +00:00
|
|
|
int virDomainDiskDefCheckDuplicateInfo(const virDomainDiskDef *a,
|
|
|
|
const virDomainDiskDef *b)
|
2016-02-04 12:39:15 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
2015-04-07 14:08:32 +00:00
|
|
|
|
2019-03-20 15:12:45 +00:00
|
|
|
virStorageSourcePtr
|
|
|
|
virDomainStorageSourceParseBase(const char *type,
|
|
|
|
const char *format,
|
|
|
|
const char *index)
|
2019-10-14 12:25:14 +00:00
|
|
|
G_GNUC_WARN_UNUSED_RESULT;
|
2018-03-05 14:13:41 +00:00
|
|
|
|
2018-05-09 14:21:55 +00:00
|
|
|
int virDomainStorageSourceParse(xmlNodePtr node,
|
|
|
|
xmlXPathContextPtr ctxt,
|
|
|
|
virStorageSourcePtr src,
|
2019-03-15 15:33:38 +00:00
|
|
|
unsigned int flags,
|
|
|
|
virDomainXMLOptionPtr xmlopt)
|
2018-05-09 14:21:55 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
|
|
|
|
|
2019-03-21 09:16:36 +00:00
|
|
|
int
|
|
|
|
virDomainDiskBackingStoreParse(xmlXPathContextPtr ctxt,
|
|
|
|
virStorageSourcePtr src,
|
|
|
|
unsigned int flags,
|
|
|
|
virDomainXMLOptionPtr xmlopt)
|
2019-10-14 12:25:14 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT;
|
2019-03-21 09:16:36 +00:00
|
|
|
|
2016-02-22 14:29:25 +00:00
|
|
|
int virDomainDefGetVcpuPinInfoHelper(virDomainDefPtr def,
|
|
|
|
int maplen,
|
|
|
|
int ncpumaps,
|
|
|
|
unsigned char *cpumaps,
|
2020-08-07 13:48:27 +00:00
|
|
|
virBitmapPtr hostcpus,
|
2016-02-22 14:29:25 +00:00
|
|
|
virBitmapPtr autoCpuset)
|
2020-08-07 13:48:27 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5) G_GNUC_WARN_UNUSED_RESULT;
|
2016-02-22 14:29:25 +00:00
|
|
|
|
2016-04-06 13:02:31 +00:00
|
|
|
bool virDomainDefHasMemballoon(const virDomainDef *def) ATTRIBUTE_NONNULL(1);
|
|
|
|
|
2017-10-23 13:13:09 +00:00
|
|
|
char *virDomainDefGetShortName(const virDomainDef *def) ATTRIBUTE_NONNULL(1);
|
2016-04-26 06:43:40 +00:00
|
|
|
|
2016-05-30 13:15:23 +00:00
|
|
|
int
|
|
|
|
virDomainGetBlkioParametersAssignFromDef(virDomainDefPtr def,
|
|
|
|
virTypedParameterPtr params,
|
|
|
|
int *nparams,
|
|
|
|
int maxparams);
|
2016-12-06 14:30:12 +00:00
|
|
|
|
2020-11-06 03:32:54 +00:00
|
|
|
void virDomainDiskSetBlockIOTune(virDomainDiskDefPtr disk,
|
|
|
|
virDomainBlockIoTuneInfo *info);
|
2017-01-30 19:37:48 +00:00
|
|
|
|
2017-11-02 18:58:00 +00:00
|
|
|
bool
|
|
|
|
virDomainNetTypeSharesHostView(const virDomainNetDef *net);
|
2017-10-02 11:36:56 +00:00
|
|
|
|
2017-10-11 14:09:49 +00:00
|
|
|
bool
|
|
|
|
virDomainDefLifecycleActionAllowed(virDomainLifecycle type,
|
|
|
|
virDomainLifecycleAction action);
|
|
|
|
|
2018-09-03 15:59:52 +00:00
|
|
|
virNetworkPortDefPtr
|
|
|
|
virDomainNetDefToNetworkPort(virDomainDefPtr dom,
|
|
|
|
virDomainNetDefPtr iface);
|
|
|
|
|
|
|
|
int
|
|
|
|
virDomainNetDefActualFromNetworkPort(virDomainNetDefPtr iface,
|
|
|
|
virNetworkPortDefPtr port);
|
|
|
|
|
|
|
|
virNetworkPortDefPtr
|
|
|
|
virDomainNetDefActualToNetworkPort(virDomainDefPtr dom,
|
|
|
|
virDomainNetDefPtr iface);
|
|
|
|
|
2018-01-25 09:35:47 +00:00
|
|
|
int
|
2018-07-26 14:32:04 +00:00
|
|
|
virDomainNetAllocateActualDevice(virConnectPtr conn,
|
|
|
|
virDomainDefPtr dom,
|
2018-01-25 09:35:47 +00:00
|
|
|
virDomainNetDefPtr iface)
|
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
|
|
|
|
|
|
|
void
|
2018-07-26 14:32:04 +00:00
|
|
|
virDomainNetNotifyActualDevice(virConnectPtr conn,
|
|
|
|
virDomainDefPtr dom,
|
2018-01-25 09:35:47 +00:00
|
|
|
virDomainNetDefPtr iface)
|
2020-10-20 16:35:09 +00:00
|
|
|
ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
|
2018-01-25 09:35:47 +00:00
|
|
|
|
|
|
|
int
|
2018-07-26 14:32:04 +00:00
|
|
|
virDomainNetReleaseActualDevice(virConnectPtr conn,
|
|
|
|
virDomainDefPtr dom,
|
2018-01-25 09:35:47 +00:00
|
|
|
virDomainNetDefPtr iface)
|
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
|
|
|
|
2018-01-25 09:35:48 +00:00
|
|
|
int
|
|
|
|
virDomainNetBandwidthUpdate(virDomainNetDefPtr iface,
|
|
|
|
virNetDevBandwidthPtr newBandwidth)
|
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
2018-01-25 09:35:47 +00:00
|
|
|
|
2018-01-25 09:35:50 +00:00
|
|
|
int
|
|
|
|
virDomainNetResolveActualType(virDomainNetDefPtr iface)
|
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
|
2018-01-25 09:35:47 +00:00
|
|
|
|
2018-02-09 16:06:43 +00:00
|
|
|
int virDomainDiskTranslateSourcePool(virDomainDiskDefPtr def);
|
2018-01-25 09:35:51 +00:00
|
|
|
|
2017-11-29 14:17:10 +00:00
|
|
|
int
|
|
|
|
virDomainDiskGetDetectZeroesMode(virDomainDiskDiscard discard,
|
|
|
|
virDomainDiskDetectZeroes detect_zeroes);
|
2018-01-25 09:35:51 +00:00
|
|
|
|
2018-05-14 05:53:09 +00:00
|
|
|
bool
|
|
|
|
virDomainDefHasManagedPR(const virDomainDef *def);
|
|
|
|
|
2019-06-21 16:00:01 +00:00
|
|
|
bool
|
|
|
|
virDomainDefHasNVMeDisk(const virDomainDef *def);
|
|
|
|
|
2019-06-24 08:01:16 +00:00
|
|
|
bool
|
|
|
|
virDomainDefHasVFIOHostdev(const virDomainDef *def);
|
|
|
|
|
2019-09-17 05:54:32 +00:00
|
|
|
bool
|
|
|
|
virDomainDefHasMdevHostdev(const virDomainDef *def);
|
|
|
|
|
2020-01-07 09:34:03 +00:00
|
|
|
bool
|
|
|
|
virDomainDefHasOldStyleUEFI(const virDomainDef *def);
|
|
|
|
|
|
|
|
bool
|
|
|
|
virDomainDefHasOldStyleROUEFI(const virDomainDef *def);
|
|
|
|
|
2018-06-30 16:20:33 +00:00
|
|
|
bool
|
|
|
|
virDomainGraphicsDefHasOpenGL(const virDomainDef *def);
|
|
|
|
|
2018-11-26 10:07:42 +00:00
|
|
|
bool
|
|
|
|
virDomainGraphicsSupportsRenderNode(const virDomainGraphicsDef *graphics);
|
|
|
|
|
|
|
|
const char *
|
|
|
|
virDomainGraphicsGetRenderNode(const virDomainGraphicsDef *graphics);
|
|
|
|
|
|
|
|
bool
|
|
|
|
virDomainGraphicsNeedsAutoRenderNode(const virDomainGraphicsDef *graphics);
|
2020-01-08 06:49:25 +00:00
|
|
|
|
|
|
|
bool
|
|
|
|
virDomainBlockIoTuneInfoHasBasic(const virDomainBlockIoTuneInfo *iotune);
|
|
|
|
|
|
|
|
bool
|
|
|
|
virDomainBlockIoTuneInfoHasMax(const virDomainBlockIoTuneInfo *iotune);
|
|
|
|
|
|
|
|
bool
|
|
|
|
virDomainBlockIoTuneInfoHasMaxLength(const virDomainBlockIoTuneInfo *iotune);
|
|
|
|
|
|
|
|
bool
|
|
|
|
virDomainBlockIoTuneInfoHasAny(const virDomainBlockIoTuneInfo *iotune);
|
2020-01-08 06:49:26 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
virDomainBlockIoTuneInfoCopy(const virDomainBlockIoTuneInfo *src,
|
|
|
|
virDomainBlockIoTuneInfoPtr dst);
|
2020-01-08 06:49:27 +00:00
|
|
|
|
|
|
|
bool
|
|
|
|
virDomainBlockIoTuneInfoEqual(const virDomainBlockIoTuneInfo *a,
|
|
|
|
const virDomainBlockIoTuneInfo *b);
|
2020-02-16 22:25:26 +00:00
|
|
|
|
2020-12-10 18:32:43 +00:00
|
|
|
bool
|
|
|
|
virDomainDriveAddressIsUsedByDisk(const virDomainDef *def,
|
|
|
|
virDomainDiskBus bus_type,
|
|
|
|
const virDomainDeviceDriveAddress *addr);
|
|
|
|
|
2020-02-16 22:25:26 +00:00
|
|
|
bool
|
|
|
|
virHostdevIsSCSIDevice(const virDomainHostdevDef *hostdev)
|
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
bool
|
|
|
|
virHostdevIsMdevDevice(const virDomainHostdevDef *hostdev)
|
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
bool
|
|
|
|
virHostdevIsVFIODevice(const virDomainHostdevDef *hostdev)
|
|
|
|
ATTRIBUTE_NONNULL(1);
|