qemu_hotplug.h 6.8 KB
Newer Older
1 2 3
/*
 * qemu_hotplug.h: QEMU device hotplug management
 *
4
 * Copyright (C) 2006-2007, 2009-2012 Red Hat, Inc.
5 6 7 8 9 10 11 12 13 14 15 16 17
 * Copyright (C) 2006 Daniel P. Berrange
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
18
 * License along with this library.  If not, see
O
Osier Yang 已提交
19
 * <http://www.gnu.org/licenses/>.
20 21
 */

22 23
#ifndef LIBVIRT_QEMU_HOTPLUG_H
# define LIBVIRT_QEMU_HOTPLUG_H
24 25

# include "qemu_conf.h"
26
# include "qemu_domain.h"
27 28
# include "domain_conf.h"

29 30 31 32 33 34
int qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver,
                                   virDomainObjPtr vm,
                                   virDomainDiskDefPtr disk,
                                   virStorageSourcePtr newsrc,
                                   bool force);

35 36
void qemuDomainDelTLSObjects(virQEMUDriverPtr driver,
                             virDomainObjPtr vm,
37
                             qemuDomainAsyncJob asyncJob,
38 39 40 41 42
                             const char *secAlias,
                             const char *tlsAlias);

int qemuDomainAddTLSObjects(virQEMUDriverPtr driver,
                            virDomainObjPtr vm,
43
                            qemuDomainAsyncJob asyncJob,
44 45 46
                            virJSONValuePtr *secProps,
                            virJSONValuePtr *tlsProps);

47 48 49 50 51
int qemuDomainGetTLSObjects(virQEMUCapsPtr qemuCaps,
                            qemuDomainSecretInfoPtr secinfo,
                            const char *tlsCertdir,
                            bool tlsListen,
                            bool tlsVerify,
52
                            const char *alias,
53
                            virJSONValuePtr *tlsProps,
54
                            virJSONValuePtr *secProps);
55

56 57 58
int qemuDomainAttachControllerDevice(virQEMUDriverPtr driver,
                                     virDomainObjPtr vm,
                                     virDomainControllerDefPtr controller);
59
int qemuDomainAttachDeviceDiskLive(virQEMUDriverPtr driver,
60
                                   virDomainObjPtr vm,
61
                                   virDomainDeviceDefPtr dev);
62
int qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
63
                              virDomainObjPtr vm,
64
                              virDomainNetDefPtr net);
65
int qemuDomainAttachRedirdevDevice(virQEMUDriverPtr driver,
66 67
                                   virDomainObjPtr vm,
                                   virDomainRedirdevDefPtr hostdev);
68
int qemuDomainAttachHostDevice(virQEMUDriverPtr driver,
69
                               virDomainObjPtr vm,
70
                               virDomainHostdevDefPtr hostdev);
71 72 73
int qemuDomainAttachShmemDevice(virQEMUDriverPtr driver,
                                virDomainObjPtr vm,
                                virDomainShmemDefPtr shmem);
M
Michal Privoznik 已提交
74 75 76
int qemuDomainAttachWatchdog(virQEMUDriverPtr driver,
                             virDomainObjPtr vm,
                             virDomainWatchdogDefPtr watchdog);
77 78
int qemuDomainFindGraphicsIndex(virDomainDefPtr def,
                                virDomainGraphicsDefPtr dev);
79 80 81
int qemuDomainAttachMemory(virQEMUDriverPtr driver,
                           virDomainObjPtr vm,
                           virDomainMemoryDefPtr mem);
82
int qemuDomainChangeGraphics(virQEMUDriverPtr driver,
83 84
                             virDomainObjPtr vm,
                             virDomainGraphicsDefPtr dev);
85
int qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
86 87 88
                                      virDomainObjPtr vm,
                                      int type,
                                      virDomainGraphicsAuthDefPtr auth,
89 90
                                      const char *defaultPasswd,
                                      int asyncJob);
91
int qemuDomainChangeNet(virQEMUDriverPtr driver,
92
                        virDomainObjPtr vm,
93
                        virDomainDeviceDefPtr dev);
94
int qemuDomainChangeNetLinkState(virQEMUDriverPtr driver,
95 96 97
                                 virDomainObjPtr vm,
                                 virDomainNetDefPtr dev,
                                 int linkstate);
98

J
Ján Tomko 已提交
99 100 101 102
int qemuDomainAttachInputDevice(virQEMUDriverPtr driver,
                                virDomainObjPtr vm,
                                virDomainInputDefPtr input);

J
Ján Tomko 已提交
103 104 105 106
int qemuDomainAttachVsockDevice(virQEMUDriverPtr driver,
                                virDomainObjPtr vm,
                                virDomainVsockDefPtr vsock);

107
int qemuDomainAttachLease(virQEMUDriverPtr driver,
108 109
                          virDomainObjPtr vm,
                          virDomainLeaseDefPtr lease);
110
int qemuDomainAttachChrDevice(virQEMUDriverPtr driver,
111 112
                              virDomainObjPtr vm,
                              virDomainChrDefPtr chr);
113
int qemuDomainAttachRNGDevice(virQEMUDriverPtr driver,
114 115
                              virDomainObjPtr vm,
                              virDomainRNGDefPtr rng);
116

117 118 119 120 121
int qemuDomainDetachDeviceLive(virDomainObjPtr vm,
                               virDomainDeviceDefPtr dev,
                               virQEMUDriverPtr driver,
                               bool async);

122 123 124 125
void qemuDomainRemoveVcpuAlias(virQEMUDriverPtr driver,
                               virDomainObjPtr vm,
                               const char *alias);

126 127 128 129 130 131 132
int
qemuDomainChrInsert(virDomainDefPtr vmdef,
                    virDomainChrDefPtr chr);
virDomainChrDefPtr
qemuDomainChrRemove(virDomainDefPtr vmdef,
                    virDomainChrDefPtr chr);

133 134 135
int qemuDomainRemoveDevice(virQEMUDriverPtr driver,
                           virDomainObjPtr vm,
                           virDomainDeviceDefPtr dev);
136

137
bool qemuDomainSignalDeviceRemoval(virDomainObjPtr vm,
138 139
                                   const char *devAlias,
                                   qemuDomainUnpluggingDeviceStatus status);
140

141 142 143 144 145 146 147
int qemuDomainSetVcpusInternal(virQEMUDriverPtr driver,
                               virDomainObjPtr vm,
                               virDomainDefPtr def,
                               virDomainDefPtr persistentDef,
                               unsigned int nvcpus,
                               bool hotpluggable);

148 149 150 151 152 153 154
int qemuDomainSetVcpuInternal(virQEMUDriverPtr driver,
                              virDomainObjPtr vm,
                              virDomainDefPtr def,
                              virDomainDefPtr persistentDef,
                              virBitmapPtr vcpus,
                              bool state);

155
#endif /* LIBVIRT_QEMU_HOTPLUG_H */