qemu_hotplug.h 5.3 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
int qemuDomainChangeGraphics(virQEMUDriverPtr driver,
61 62
                             virDomainObjPtr vm,
                             virDomainGraphicsDefPtr dev);
63
int qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
64 65 66
                                      virDomainObjPtr vm,
                                      int type,
                                      virDomainGraphicsAuthDefPtr auth,
67 68
                                      const char *defaultPasswd,
                                      int asyncJob);
69
int qemuDomainChangeNet(virQEMUDriverPtr driver,
70 71
                        virDomainObjPtr vm,
                        virDomainPtr dom,
72
                        virDomainDeviceDefPtr dev);
73
int qemuDomainChangeNetLinkState(virQEMUDriverPtr driver,
74 75 76
                                 virDomainObjPtr vm,
                                 virDomainNetDefPtr dev,
                                 int linkstate);
77 78 79
int qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
                                   virDomainObjPtr vm,
                                   virDomainDeviceDefPtr dev);
80 81 82
int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
                                     virDomainObjPtr vm,
                                     virDomainDeviceDefPtr dev);
83
int qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
84
                              virDomainObjPtr vm,
85
                              virDomainDeviceDefPtr dev);
86
int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
87
                               virDomainObjPtr vm,
88
                               virDomainDeviceDefPtr dev);
89
int qemuDomainAttachLease(virQEMUDriverPtr driver,
90 91
                          virDomainObjPtr vm,
                          virDomainLeaseDefPtr lease);
92
int qemuDomainDetachLease(virQEMUDriverPtr driver,
93 94
                          virDomainObjPtr vm,
                          virDomainLeaseDefPtr lease);
95 96 97 98 99 100
int qemuDomainAttachChrDevice(virQEMUDriverPtr driver,
                              virDomainObjPtr vm,
                              virDomainChrDefPtr chr);
int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
                              virDomainObjPtr vm,
                              virDomainChrDefPtr chr);
101 102


103 104 105 106 107 108 109
int
qemuDomainChrInsert(virDomainDefPtr vmdef,
                    virDomainChrDefPtr chr);
virDomainChrDefPtr
qemuDomainChrRemove(virDomainDefPtr vmdef,
                    virDomainChrDefPtr chr);

110 111 112 113
void qemuDomainRemoveDevice(virQEMUDriverPtr driver,
                            virDomainObjPtr vm,
                            virDomainDeviceDefPtr dev);

114
bool qemuDomainSignalDeviceRemoval(virDomainObjPtr vm,
115 116
                                   const char *devAlias);

117
#endif /* __QEMU_HOTPLUG_H__ */