qemu_hotplug.h 5.4 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
                        virDomainObjPtr vm,
71
                        virDomainDeviceDefPtr dev);
72
int qemuDomainChangeNetLinkState(virQEMUDriverPtr driver,
73 74 75
                                 virDomainObjPtr vm,
                                 virDomainNetDefPtr dev,
                                 int linkstate);
76 77 78
int qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
                                   virDomainObjPtr vm,
                                   virDomainDeviceDefPtr dev);
79 80 81
int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
                                     virDomainObjPtr vm,
                                     virDomainDeviceDefPtr dev);
82
int qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
83
                              virDomainObjPtr vm,
84
                              virDomainDeviceDefPtr dev);
85
int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
86
                               virDomainObjPtr vm,
87
                               virDomainDeviceDefPtr dev);
88
int qemuDomainAttachLease(virQEMUDriverPtr driver,
89 90
                          virDomainObjPtr vm,
                          virDomainLeaseDefPtr lease);
91
int qemuDomainDetachLease(virQEMUDriverPtr driver,
92 93
                          virDomainObjPtr vm,
                          virDomainLeaseDefPtr lease);
94 95 96 97 98 99
int qemuDomainAttachChrDevice(virQEMUDriverPtr driver,
                              virDomainObjPtr vm,
                              virDomainChrDefPtr chr);
int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
                              virDomainObjPtr vm,
                              virDomainChrDefPtr chr);
100 101 102
int qemuDomainAttachRNGDevice(virQEMUDriverPtr driver,
                              virDomainObjPtr vm,
                              virDomainRNGDefPtr rng);
103 104


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

112 113 114
int qemuDomainRemoveDevice(virQEMUDriverPtr driver,
                           virDomainObjPtr vm,
                           virDomainDeviceDefPtr dev);
115

116
bool qemuDomainSignalDeviceRemoval(virDomainObjPtr vm,
117 118
                                   const char *devAlias);

119
#endif /* __QEMU_HOTPLUG_H__ */