-
Notifications
You must be signed in to change notification settings - Fork 9
/
machine.h
83 lines (68 loc) · 1.96 KB
/
machine.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
* PROJECT: ReactOS System Regression Testing Utility
* LICENSE: GNU GPLv2 or any later version as published by the Free Software Foundation
* PURPOSE: Shared C++ header
* COPYRIGHT: Copyright 2013-2015 Pierre Schweitzer <[email protected]>
*/
#ifndef __MACHINE_H__
#define __MACHINE_H__
#include "sysreg.h"
#include <new>
class Machine
{
public:
Machine() {};
virtual bool IsMachineRunning(const char * name, bool destroy) = 0;
virtual void InitializeDisk() = 0;
virtual bool PrepareSerialPort() = 0;
virtual bool LaunchMachine(const char* XmlFileName, const char* BootDevice) = 0;
virtual const char * GetMachineName() const = 0;
virtual bool GetConsole(char* console) = 0;
virtual void ShutdownMachine() = 0;
virtual void CloseSerialPort() = 0;
virtual bool IsConnected() const = 0;
virtual bool BreakToDebugger() const = 0;
virtual ~Machine() {};
};
class LibVirt : public Machine
{
public:
LibVirt();
virtual ~LibVirt();
virtual bool IsMachineRunning(const char * name, bool destroy);
virtual void InitializeDisk();
virtual bool PrepareSerialPort();
virtual bool LaunchMachine(const char* XmlFileName, const char* BootDevice);
virtual const char * GetMachineName() const;
virtual void ShutdownMachine();
virtual void CloseSerialPort();
virtual bool IsConnected() const;
virtual bool BreakToDebugger() const;
protected:
virConnectPtr vConn;
virDomainPtr vDom;
};
class KVM : public LibVirt
{
public:
KVM();
virtual bool GetConsole(char* console);
};
class VMWarePlayer : public LibVirt
{
public:
VMWarePlayer();
virtual bool GetConsole(char* console);
virtual bool PrepareSerialPort();
virtual void CloseSerialPort();
};
class VirtualBox : public LibVirt
{
public:
VirtualBox();
virtual bool GetConsole(char* console);
virtual void InitializeDisk();
virtual bool PrepareSerialPort();
virtual void CloseSerialPort();
};
#endif