qemu_hotplug.h 5.2 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
                                  virDomainObjPtr vm,
38
                                  qemuDomainAsyncJob asyncJob);
39 40 41
int qemuDomainAttachControllerDevice(virQEMUDriverPtr driver,
                                     virDomainObjPtr vm,
                                     virDomainControllerDefPtr controller);
42 43 44 45
int qemuDomainAttachDeviceDiskLive(virConnectPtr conn,
                                   virQEMUDriverPtr driver,
                                   virDomainObjPtr vm,
                                   virDomainDeviceDefPtr dev);
46
int qemuDomainAttachNetDevice(virConnectPtr conn,
47
                              virQEMUDriverPtr driver,
48
                              virDomainObjPtr vm,
49
                              virDomainNetDefPtr net);
50
int qemuDomainAttachRedirdevDevice(virQEMUDriverPtr driver,
51 52
                                   virDomainObjPtr vm,
                                   virDomainRedirdevDefPtr hostdev);
53 54
int qemuDomainAttachHostDevice(virConnectPtr conn,
                               virQEMUDriverPtr driver,
55
                               virDomainObjPtr vm,
56
                               virDomainHostdevDefPtr hostdev);
57
int qemuDomainChangeGraphics(virQEMUDriverPtr driver,
58 59
                             virDomainObjPtr vm,
                             virDomainGraphicsDefPtr dev);
60
int qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
61 62 63 64
                                      virDomainObjPtr vm,
                                      int type,
                                      virDomainGraphicsAuthDefPtr auth,
                                      const char *defaultPasswd);
65
int qemuDomainChangeNet(virQEMUDriverPtr driver,
66 67
                        virDomainObjPtr vm,
                        virDomainPtr dom,
68
                        virDomainDeviceDefPtr dev);
69
int qemuDomainChangeNetLinkState(virQEMUDriverPtr driver,
70 71 72
                                 virDomainObjPtr vm,
                                 virDomainNetDefPtr dev,
                                 int linkstate);
73 74 75
int qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
                                   virDomainObjPtr vm,
                                   virDomainDeviceDefPtr dev);
76 77 78
int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
                                     virDomainObjPtr vm,
                                     virDomainDeviceDefPtr dev);
79 80
int qemuDomainDetachNetDevice(virConnectPtr conn,
                              virQEMUDriverPtr driver,
81
                              virDomainObjPtr vm,
82
                              virDomainDeviceDefPtr dev);
83 84
int qemuDomainDetachHostDevice(virConnectPtr conn,
                               virQEMUDriverPtr driver,
85
                               virDomainObjPtr vm,
86
                               virDomainDeviceDefPtr dev);
87
int qemuDomainAttachLease(virQEMUDriverPtr driver,
88 89
                          virDomainObjPtr vm,
                          virDomainLeaseDefPtr lease);
90
int qemuDomainDetachLease(virQEMUDriverPtr driver,
91 92
                          virDomainObjPtr vm,
                          virDomainLeaseDefPtr lease);
93 94 95 96 97 98
int qemuDomainAttachChrDevice(virQEMUDriverPtr driver,
                              virDomainObjPtr vm,
                              virDomainChrDefPtr chr);
int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
                              virDomainObjPtr vm,
                              virDomainChrDefPtr chr);
99 100


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

108 109 110 111
void qemuDomainRemoveDevice(virQEMUDriverPtr driver,
                            virDomainObjPtr vm,
                            virDomainDeviceDefPtr dev);

112
bool qemuDomainSignalDeviceRemoval(virDomainObjPtr vm,
113 114
                                   const char *devAlias);

115
#endif /* __QEMU_HOTPLUG_H__ */