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


98 99 100 101 102 103 104
int
qemuDomainChrInsert(virDomainDefPtr vmdef,
                    virDomainChrDefPtr chr);
virDomainChrDefPtr
qemuDomainChrRemove(virDomainDefPtr vmdef,
                    virDomainChrDefPtr chr);

105 106 107 108
void qemuDomainRemoveDevice(virQEMUDriverPtr driver,
                            virDomainObjPtr vm,
                            virDomainDeviceDefPtr dev);

109
bool qemuDomainSignalDeviceRemoval(virDomainObjPtr vm,
110 111
                                   const char *devAlias);

112
#endif /* __QEMU_HOTPLUG_H__ */