VirtualBox

source: vbox/trunk/src/VBox/Main/include/NvramStoreImpl.h@ 91326

Last change on this file since 91326 was 91326, checked in by vboxsync, 3 years ago

Main/NvramStore,FE/VBoxManage: Allow multiple NVRAM states (UEFI,TPM,etc.) to exist for a VM and and manage them in a central place. This allows to collect them in a single tar archive and provide a single interface to get access to the individual states (work in progress), bugref:10098

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.3 KB
Line 
1/* $Id: NvramStoreImpl.h 91326 2021-09-22 15:10:38Z vboxsync $ */
2/** @file
3 * VirtualBox COM NVRAM store class implementation
4 */
5
6/*
7 * Copyright (C) 2021 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef MAIN_INCLUDED_NvramStoreImpl_h
19#define MAIN_INCLUDED_NvramStoreImpl_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24#include "NvramStoreWrap.h"
25#include <VBox/vmm/pdmdrv.h>
26
27#ifdef VBOX_COM_INPROC
28class Console;
29#else
30namespace settings
31{
32 struct NvramSettings;
33}
34#endif
35
36class ATL_NO_VTABLE NvramStore :
37 public NvramStoreWrap
38{
39public:
40
41 DECLARE_COMMON_CLASS_METHODS(NvramStore)
42
43 HRESULT FinalConstruct();
44 void FinalRelease();
45
46 // public initializer/uninitializer for internal purposes only
47#ifdef VBOX_COM_INPROC
48 HRESULT init(Console *aParent, const com::Utf8Str &strNonVolatileStorageFile);
49#else
50 HRESULT init(Machine *parent);
51 HRESULT init(Machine *parent, NvramStore *that);
52 HRESULT initCopy(Machine *parent, NvramStore *that);
53#endif
54 void uninit();
55
56 // public methods for internal purposes only
57#ifndef VBOX_COM_INPROC
58 HRESULT i_loadSettings(const settings::NvramSettings &data);
59 HRESULT i_saveSettings(settings::NvramSettings &data);
60#endif
61
62#ifdef VBOX_COM_INPROC
63 static const PDMDRVREG DrvReg;
64#else
65 void i_rollback();
66 void i_commit();
67 void i_copyFrom(NvramStore *aThat);
68#endif
69
70 com::Utf8Str i_getNonVolatileStorageFile();
71 void i_updateNonVolatileStorageFile(const com::Utf8Str &aNonVolatileStorageFile);
72
73 int i_loadStore(void);
74 int i_loadStoreFromTar(RTVFSFSSTREAM hVfsFssTar);
75 int i_saveStore(void);
76 int i_saveStoreAsTar(void);
77
78private:
79
80 // Wrapped NVRAM store properties
81 HRESULT getNonVolatileStorageFile(com::Utf8Str &aNonVolatileStorageFile);
82
83 // Wrapped NVRAM store members
84 /** @todo */
85
86#ifdef VBOX_COM_INPROC
87 static DECLCALLBACK(int) i_nvramStoreQuerySize(PPDMIVFSCONNECTOR pInterface, const char *pszNamespace, const char *pszPath,
88 uint64_t *pcb);
89 static DECLCALLBACK(int) i_nvramStoreReadAll(PPDMIVFSCONNECTOR pInterface, const char *pszNamespace, const char *pszPath,
90 void *pvBuf, size_t cbRead);
91 static DECLCALLBACK(int) i_nvramStoreWriteAll(PPDMIVFSCONNECTOR pInterface, const char *pszNamespace, const char *pszPath,
92 const void *pvBuf, size_t cbWrite);
93 static DECLCALLBACK(void *) i_drvQueryInterface(PPDMIBASE pInterface, const char *pszIID);
94 static DECLCALLBACK(int) i_drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags);
95 static DECLCALLBACK(void) i_drvDestruct(PPDMDRVINS pDrvIns);
96#endif
97
98 struct Data; // opaque data struct, defined in NvramStoreImpl.cpp
99 Data *m;
100};
101
102#endif /* !MAIN_INCLUDED_NvramStoreImpl_h */
103/* vi: set tabstop=4 shiftwidth=4 expandtab: */
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