VirtualBox

source: vbox/trunk/src/VBox/Main/include/BusAssignmentManager.h@ 62485

Last change on this file since 62485 was 61009, checked in by vboxsync, 9 years ago

Main: big settings cleanup and writing optimization. Moved constructors/equality/default checks into the .cpp file, and write only settings which aren't at the default value. Greatly reduces the effort needed to write everything out, especially when a lot of snapshots have to be dealt with. Move the storage controllers to the hardware settings, where they always belonged. No change to the XML file (yet). Lots of settings related cleanups in the API code.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.6 KB
Line 
1/* $Id: BusAssignmentManager.h 61009 2016-05-17 17:18:29Z vboxsync $ */
2
3/** @file
4 *
5 * VirtualBox bus slots assignment manager
6 */
7
8/*
9 * Copyright (C) 2010-2016 Oracle Corporation
10 *
11 * This file is part of VirtualBox Open Source Edition (OSE), as
12 * available from http://www.virtualbox.org. This file is free software;
13 * you can redistribute it and/or modify it under the terms of the GNU
14 * General Public License (GPL) as published by the Free Software
15 * Foundation, in version 2 as it comes in the "COPYING" file of the
16 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
17 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
18 */
19#ifndef __BusAssignmentManager_h
20#define __BusAssignmentManager_h
21
22#include "VBox/types.h"
23#include "VBox/pci.h"
24#include "VirtualBoxBase.h"
25#include <vector>
26
27class BusAssignmentManager
28{
29private:
30 struct State;
31 State *pState;
32
33 BusAssignmentManager();
34 virtual ~BusAssignmentManager();
35
36 HRESULT assignPCIDeviceImpl(const char *pszDevName, PCFGMNODE pCfg, PCIBusAddress& GuestAddress,
37 PCIBusAddress HostAddress, bool fGuestAddressRequired = false);
38
39public:
40 struct PCIDeviceInfo
41 {
42 com::Utf8Str strDeviceName;
43 PCIBusAddress guestAddress;
44 PCIBusAddress hostAddress;
45 };
46
47 static BusAssignmentManager *createInstance(ChipsetType_T chipsetType);
48 virtual void AddRef();
49 virtual void Release();
50
51 virtual HRESULT assignHostPCIDevice(const char *pszDevName, PCFGMNODE pCfg, PCIBusAddress HostAddress,
52 PCIBusAddress& GuestAddress, bool fAddressRequired = false)
53 {
54 return assignPCIDeviceImpl(pszDevName, pCfg, GuestAddress, HostAddress, fAddressRequired);
55 }
56
57 virtual HRESULT assignPCIDevice(const char *pszDevName, PCFGMNODE pCfg, PCIBusAddress& Address, bool fAddressRequired = false)
58 {
59 PCIBusAddress HostAddress;
60 return assignPCIDeviceImpl(pszDevName, pCfg, Address, HostAddress, fAddressRequired);
61 }
62
63 virtual HRESULT assignPCIDevice(const char *pszDevName, PCFGMNODE pCfg)
64 {
65 PCIBusAddress GuestAddress;
66 PCIBusAddress HostAddress;
67 return assignPCIDeviceImpl(pszDevName, pCfg, GuestAddress, HostAddress, false);
68 }
69 virtual bool findPCIAddress(const char *pszDevName, int iInstance, PCIBusAddress& Address);
70 virtual bool hasPCIDevice(const char *pszDevName, int iInstance)
71 {
72 PCIBusAddress Address;
73 return findPCIAddress(pszDevName, iInstance, Address);
74 }
75 virtual void listAttachedPCIDevices(std::vector<PCIDeviceInfo> &aAttached);
76};
77
78#endif // __BusAssignmentManager_h
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette