qemu_hotplug.h 6.0 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 33
                                   virDomainObjPtr vm,
                                   virDomainDiskDefPtr disk,
34
                                   virDomainDiskDefPtr orig_disk,
35
                                   bool force);
36
int qemuDomainCheckEjectableMedia(virQEMUDriverPtr driver,
37 38
                                  virDomainObjPtr vm,
                                  enum qemuDomainAsyncJob asyncJob);
39 40 41 42
int qemuDomainAttachVirtioDiskDevice(virConnectPtr conn,
                                     virQEMUDriverPtr driver,
                                     virDomainObjPtr vm,
                                     virDomainDiskDefPtr disk);
43
int qemuDomainAttachPciControllerDevice(virQEMUDriverPtr driver,
44
                                        virDomainObjPtr vm,
45
                                        virDomainControllerDefPtr controller);
46
int qemuDomainAttachSCSIDisk(virConnectPtr conn,
47
                             virQEMUDriverPtr driver,
48
                             virDomainObjPtr vm,
49
                             virDomainDiskDefPtr disk);
50
int qemuDomainAttachUsbMassstorageDevice(virConnectPtr conn,
51
                                         virQEMUDriverPtr driver,
52
                                         virDomainObjPtr vm,
53
                                         virDomainDiskDefPtr disk);
54
int qemuDomainAttachNetDevice(virConnectPtr conn,
55
                              virQEMUDriverPtr driver,
56
                              virDomainObjPtr vm,
57
                              virDomainNetDefPtr net);
58
int qemuDomainAttachHostPciDevice(virQEMUDriverPtr driver,
59
                                  virDomainObjPtr vm,
60
                                  virDomainHostdevDefPtr hostdev);
61
int qemuDomainAttachHostUsbDevice(virQEMUDriverPtr driver,
62
                                  virDomainObjPtr vm,
63
                                  virDomainHostdevDefPtr hostdev);
64
int qemuDomainAttachRedirdevDevice(virQEMUDriverPtr driver,
65 66
                                   virDomainObjPtr vm,
                                   virDomainRedirdevDefPtr hostdev);
67
int qemuDomainAttachHostDevice(virQEMUDriverPtr driver,
68
                               virDomainObjPtr vm,
69
                               virDomainHostdevDefPtr hostdev);
70
int qemuDomainChangeGraphics(virQEMUDriverPtr driver,
71 72
                             virDomainObjPtr vm,
                             virDomainGraphicsDefPtr dev);
73
int qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
74 75 76 77
                                      virDomainObjPtr vm,
                                      int type,
                                      virDomainGraphicsAuthDefPtr auth,
                                      const char *defaultPasswd);
78
int qemuDomainChangeNet(virQEMUDriverPtr driver,
79 80
                        virDomainObjPtr vm,
                        virDomainPtr dom,
81
                        virDomainDeviceDefPtr dev);
82
int qemuDomainChangeNetLinkState(virQEMUDriverPtr driver,
83 84 85
                                 virDomainObjPtr vm,
                                 virDomainNetDefPtr dev,
                                 int linkstate);
86 87
int qemuDomainDetachVirtioDiskDevice(virQEMUDriverPtr driver,
                                     virDomainObjPtr vm,
88
                                     virDomainDiskDefPtr disk);
89
int qemuDomainDetachDiskDevice(virQEMUDriverPtr driver,
90
                               virDomainObjPtr vm,
91
                               virDomainDiskDefPtr disk);
92
int qemuDomainDetachPciControllerDevice(virQEMUDriverPtr driver,
93
                                        virDomainObjPtr vm,
94
                                        virDomainDeviceDefPtr dev);
95
int qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
96
                              virDomainObjPtr vm,
97
                              virDomainDeviceDefPtr dev);
98
int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
99
                               virDomainObjPtr vm,
100
                               virDomainDeviceDefPtr dev);
101
int qemuDomainAttachLease(virQEMUDriverPtr driver,
102 103
                          virDomainObjPtr vm,
                          virDomainLeaseDefPtr lease);
104
int qemuDomainDetachLease(virQEMUDriverPtr driver,
105 106
                          virDomainObjPtr vm,
                          virDomainLeaseDefPtr lease);
107 108 109 110 111 112
int qemuDomainAttachChrDevice(virQEMUDriverPtr driver,
                              virDomainObjPtr vm,
                              virDomainChrDefPtr chr);
int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
                              virDomainObjPtr vm,
                              virDomainChrDefPtr chr);
113 114


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

122 123 124 125 126 127 128
void qemuDomainRemoveDevice(virQEMUDriverPtr driver,
                            virDomainObjPtr vm,
                            virDomainDeviceDefPtr dev);

void qemuDomainSignalDeviceRemoval(virDomainObjPtr vm,
                                   const char *devAlias);

129
#endif /* __QEMU_HOTPLUG_H__ */