qemu_hostdev.h 5.4 KB
Newer Older
1 2 3
/*
 * qemu_hostdev.h: QEMU hostdev management
 *
4
 * Copyright (C) 2006-2007, 2009-2013 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
#pragma once
23

24 25
#include "qemu_conf.h"
#include "domain_conf.h"
26

27 28
bool qemuHostdevNeedsVFIO(const virDomainHostdevDef *hostdev);

29
bool qemuHostdevHostSupportsPassthroughVFIO(void);
30

M
Michal Privoznik 已提交
31 32
int qemuHostdevUpdateActiveNVMeDisks(virQEMUDriverPtr driver,
                                     virDomainDefPtr def);
33 34
int qemuHostdevUpdateActiveMediatedDevices(virQEMUDriverPtr driver,
                                           virDomainDefPtr def);
35 36 37 38 39 40
int qemuHostdevUpdateActivePCIDevices(virQEMUDriverPtr driver,
                                      virDomainDefPtr def);
int qemuHostdevUpdateActiveUSBDevices(virQEMUDriverPtr driver,
                                      virDomainDefPtr def);
int qemuHostdevUpdateActiveSCSIDevices(virQEMUDriverPtr driver,
                                       virDomainDefPtr def);
41 42
int qemuHostdevUpdateActiveDomainDevices(virQEMUDriverPtr driver,
                                         virDomainDefPtr def);
43

44 45 46
int qemuHostdevPrepareOneNVMeDisk(virQEMUDriverPtr driver,
                                  const char *name,
                                  virStorageSourcePtr src);
M
Michal Privoznik 已提交
47 48 49 50
int qemuHostdevPrepareNVMeDisks(virQEMUDriverPtr driver,
                                const char *name,
                                virDomainDiskDefPtr *disks,
                                size_t ndisks);
51
int qemuHostdevPreparePCIDevices(virQEMUDriverPtr driver,
52
                                 const char *name,
53
                                 const unsigned char *uuid,
54
                                 virDomainHostdevDefPtr *hostdevs,
55
                                 int nhostdevs,
56 57
                                 virQEMUCapsPtr qemuCaps,
                                 unsigned int flags);
58 59 60 61 62 63
int qemuHostdevPrepareUSBDevices(virQEMUDriverPtr driver,
                                 const char *name,
                                 virDomainHostdevDefPtr *hostdevs,
                                 int nhostdevs,
                                 unsigned int flags);
int qemuHostdevPrepareSCSIDevices(virQEMUDriverPtr driver,
64 65 66
                                  const char *name,
                                  virDomainHostdevDefPtr *hostdevs,
                                  int nhostdevs);
67 68 69 70
int qemuHostdevPrepareSCSIVHostDevices(virQEMUDriverPtr driver,
                                       const char *name,
                                       virDomainHostdevDefPtr *hostdevs,
                                       int nhostdevs);
71 72 73 74
int qemuHostdevPrepareMediatedDevices(virQEMUDriverPtr driver,
                                      const char *name,
                                      virDomainHostdevDefPtr *hostdevs,
                                      int nhostdevs);
75 76 77 78
int qemuHostdevPrepareDomainDevices(virQEMUDriverPtr driver,
                                    virDomainDefPtr def,
                                    virQEMUCapsPtr qemuCaps,
                                    unsigned int flags);
79

80 81 82
void qemuHostdevReAttachOneNVMeDisk(virQEMUDriverPtr driver,
                                    const char *name,
                                    virStorageSourcePtr src);
M
Michal Privoznik 已提交
83 84 85 86
void qemuHostdevReAttachNVMeDisks(virQEMUDriverPtr driver,
                                  const char *name,
                                  virDomainDiskDefPtr *disks,
                                  size_t ndisks);
87 88 89 90 91 92 93 94 95 96 97 98
void qemuHostdevReAttachPCIDevices(virQEMUDriverPtr driver,
                                   const char *name,
                                   virDomainHostdevDefPtr *hostdevs,
                                   int nhostdevs);
void qemuHostdevReAttachUSBDevices(virQEMUDriverPtr driver,
                                   const char *name,
                                   virDomainHostdevDefPtr *hostdevs,
                                   int nhostdevs);
void qemuHostdevReAttachSCSIDevices(virQEMUDriverPtr driver,
                                    const char *name,
                                    virDomainHostdevDefPtr *hostdevs,
                                    int nhostdevs);
99 100 101 102
void qemuHostdevReAttachSCSIVHostDevices(virQEMUDriverPtr driver,
                                         const char *name,
                                         virDomainHostdevDefPtr *hostdevs,
                                         int nhostdevs);
103 104 105 106
void qemuHostdevReAttachMediatedDevices(virQEMUDriverPtr driver,
                                        const char *name,
                                        virDomainHostdevDefPtr *hostdevs,
                                        int nhostdevs);
107 108
void qemuHostdevReAttachDomainDevices(virQEMUDriverPtr driver,
                                      virDomainDefPtr def);