aboutsummaryrefslogtreecommitdiff
path: root/bbot/machine-manifest
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-04-10 13:16:11 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-04-10 13:16:11 +0200
commit810df40a0625835ad17a0a5bf3232a8d1a68e680 (patch)
tree1dc320fd821ce30a0a037b7fae151e1f027d0bbd /bbot/machine-manifest
parent36e0c88e7a3912c8a2e6594841172adb9c14525b (diff)
Implement vm startup and shutdown
Diffstat (limited to 'bbot/machine-manifest')
-rw-r--r--bbot/machine-manifest58
1 files changed, 58 insertions, 0 deletions
diff --git a/bbot/machine-manifest b/bbot/machine-manifest
new file mode 100644
index 0000000..0d71bd7
--- /dev/null
+++ b/bbot/machine-manifest
@@ -0,0 +1,58 @@
+// file : bbot/machine-manifest -*- C++ -*-
+// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+// license : MIT; see accompanying LICENSE file
+
+#ifndef BBOT_MACHINE_MANIFEST
+#define BBOT_MACHINE_MANIFEST
+
+#include <map>
+
+#include <butl/manifest-forward>
+
+#include <bbot/types>
+#include <bbot/utility>
+
+#include <bbot/manifest> // machine_header
+
+namespace bbot
+{
+ // Machine type.
+ //
+ enum class machine_type {kvm, nspawn};
+
+ string
+ to_string (machine_type);
+
+ machine_type
+ to_machine_type (const string&); // Throws invalid_argument.
+
+ // Machine.
+ //
+ class machine_manifest: public machine_header_manifest
+ {
+ public:
+ machine_type type;
+ optional<string> mac; // Required in bootstrapped machine manifest.
+
+ machine_manifest (std::string i,
+ std::string n,
+ std::string s,
+ machine_type t)
+ : machine_header_manifest (std::move (i),
+ std::move (n),
+ std::move (s)),
+ type (t) {}
+
+ public:
+ machine_manifest () = default; // VC export.
+ machine_manifest (butl::manifest_parser&, bool ignore_unknown = false);
+ machine_manifest (butl::manifest_parser&,
+ butl::manifest_name_value start,
+ bool ignore_unknown = false);
+
+ void
+ serialize (butl::manifest_serializer&) const;
+ };
+}
+
+#endif // BBOT_MACHINE_MANIFEST