qemu_hostdev.h 5.0 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

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

M
Michal Privoznik 已提交
77 78 79 80
void qemuHostdevReAttachNVMeDisks(virQEMUDriverPtr driver,
                                  const char *name,
                                  virDomainDiskDefPtr *disks,
                                  size_t ndisks);
81 82 83 84 85 86 87 88 89 90 91 92
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);
93 94 95 96
void qemuHostdevReAttachSCSIVHostDevices(virQEMUDriverPtr driver,
                                         const char *name,
                                         virDomainHostdevDefPtr *hostdevs,
                                         int nhostdevs);
97 98 99 100
void qemuHostdevReAttachMediatedDevices(virQEMUDriverPtr driver,
                                        const char *name,
                                        virDomainHostdevDefPtr *hostdevs,
                                        int nhostdevs);
101 102
void qemuHostdevReAttachDomainDevices(virQEMUDriverPtr driver,
                                      virDomainDefPtr def);