qemu_hotplug.h 5.9 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 24 25 26 27
 *
 * Author: Daniel P. Berrange <berrange@redhat.com>
 */

#ifndef __QEMU_HOTPLUG_H__
# define __QEMU_HOTPLUG_H__

# include "qemu_conf.h"
28
# include "qemu_domain.h"
29 30
# include "domain_conf.h"

31
int qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver,
32
                                   virConnectPtr conn,
33 34
                                   virDomainObjPtr vm,
                                   virDomainDiskDefPtr disk,
35
                                   virStorageSourcePtr newsrc,
36
                                   bool force);
37
int qemuDomainCheckEjectableMedia(virQEMUDriverPtr driver,
38
                                  virDomainObjPtr vm,
39
                                  qemuDomainAsyncJob asyncJob);
40 41 42
int qemuDomainAttachControllerDevice(virQEMUDriverPtr driver,
                                     virDomainObjPtr vm,
                                     virDomainControllerDefPtr controller);
43 44 45 46
int qemuDomainAttachDeviceDiskLive(virConnectPtr conn,
                                   virQEMUDriverPtr driver,
                                   virDomainObjPtr vm,
                                   virDomainDeviceDefPtr dev);
47
int qemuDomainAttachNetDevice(virConnectPtr conn,
48
                              virQEMUDriverPtr driver,
49
                              virDomainObjPtr vm,
50
                              virDomainNetDefPtr net);
51
int qemuDomainAttachRedirdevDevice(virQEMUDriverPtr driver,
52 53
                                   virDomainObjPtr vm,
                                   virDomainRedirdevDefPtr hostdev);
54 55
int qemuDomainAttachHostDevice(virConnectPtr conn,
                               virQEMUDriverPtr driver,
56
                               virDomainObjPtr vm,
57
                               virDomainHostdevDefPtr hostdev);
58 59
int qemuDomainFindGraphicsIndex(virDomainDefPtr def,
                                virDomainGraphicsDefPtr dev);
60 61 62
int qemuDomainAttachMemory(virQEMUDriverPtr driver,
                           virDomainObjPtr vm,
                           virDomainMemoryDefPtr mem);
63 64 65
int qemuDomainDetachMemoryDevice(virQEMUDriverPtr driver,
                                 virDomainObjPtr vm,
                                 virDomainMemoryDefPtr memdef);
66
int qemuDomainChangeGraphics(virQEMUDriverPtr driver,
67 68
                             virDomainObjPtr vm,
                             virDomainGraphicsDefPtr dev);
69
int qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
70 71 72
                                      virDomainObjPtr vm,
                                      int type,
                                      virDomainGraphicsAuthDefPtr auth,
73 74
                                      const char *defaultPasswd,
                                      int asyncJob);
75
int qemuDomainChangeNet(virQEMUDriverPtr driver,
76
                        virDomainObjPtr vm,
77
                        virDomainDeviceDefPtr dev);
78
int qemuDomainChangeNetLinkState(virQEMUDriverPtr driver,
79 80 81
                                 virDomainObjPtr vm,
                                 virDomainNetDefPtr dev,
                                 int linkstate);
82 83 84
int qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
                                   virDomainObjPtr vm,
                                   virDomainDeviceDefPtr dev);
85 86 87
int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
                                     virDomainObjPtr vm,
                                     virDomainDeviceDefPtr dev);
88
int qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
89
                              virDomainObjPtr vm,
90
                              virDomainDeviceDefPtr dev);
91
int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
92
                               virDomainObjPtr vm,
93
                               virDomainDeviceDefPtr dev);
94
int qemuDomainAttachLease(virQEMUDriverPtr driver,
95 96
                          virDomainObjPtr vm,
                          virDomainLeaseDefPtr lease);
97
int qemuDomainDetachLease(virQEMUDriverPtr driver,
98 99
                          virDomainObjPtr vm,
                          virDomainLeaseDefPtr lease);
100 101 102 103 104 105
int qemuDomainAttachChrDevice(virQEMUDriverPtr driver,
                              virDomainObjPtr vm,
                              virDomainChrDefPtr chr);
int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
                              virDomainObjPtr vm,
                              virDomainChrDefPtr chr);
106 107 108
int qemuDomainAttachRNGDevice(virQEMUDriverPtr driver,
                              virDomainObjPtr vm,
                              virDomainRNGDefPtr rng);
109 110 111
int qemuDomainDetachRNGDevice(virQEMUDriverPtr driver,
                              virDomainObjPtr vm,
                              virDomainRNGDefPtr rng);
112

113 114 115 116 117 118 119
int
qemuDomainChrInsert(virDomainDefPtr vmdef,
                    virDomainChrDefPtr chr);
virDomainChrDefPtr
qemuDomainChrRemove(virDomainDefPtr vmdef,
                    virDomainChrDefPtr chr);

120 121 122
int qemuDomainRemoveDevice(virQEMUDriverPtr driver,
                           virDomainObjPtr vm,
                           virDomainDeviceDefPtr dev);
123

124
bool qemuDomainSignalDeviceRemoval(virDomainObjPtr vm,
125 126
                                   const char *devAlias);

127
#endif /* __QEMU_HOTPLUG_H__ */