[libvirt] [PATCH] Check if systemd is the init before creating machines
by Ján Tomko
If systemd is installed, but not the init system,
systemd-machined fails with an unhelpful error message:
Launch helper exited with unknown return code 1
Fall back to manual cgroup creation if systemd is installed,
but it's not PID 1.
[1] https://bugs.freedesktop.org/show_bug.cgi?id=69962
---
(Yes, Gentoo.)
src/util/virsystemd.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c
index 8adf209..0404a63 100644
--- a/src/util/virsystemd.c
+++ b/src/util/virsystemd.c
@@ -30,6 +30,7 @@
#include "virstring.h"
#include "viralloc.h"
#include "virutil.h"
+#include "virfile.h"
#include "virlog.h"
#include "virerror.h"
@@ -142,6 +143,28 @@ cleanup:
return machinename;
}
+/*
+ * Returns 0 if systemd is the init, -2 if not
+ * -1 on fatal error
+ */
+static int
+virSystemdIsInit(void)
+{
+ char *buf = NULL;
+ int ret = -2;
+
+ if (virFileReadAll("/proc/1/comm", sizeof("systemd\n "), &buf) < 0)
+ return -1;
+
+ if (STREQ(buf, "systemd\n"))
+ ret = 0;
+ else
+ VIR_DEBUG("systemd is not the init");
+
+ VIR_FREE(buf);
+ return ret;
+}
+
/**
* virSystemdCreateMachine:
* @name: driver unique name of the machine
@@ -173,6 +196,9 @@ int virSystemdCreateMachine(const char *name,
if (ret < 0)
return ret;
+ if ((ret = virSystemdIsInit()) < 0)
+ return ret;
+
if (!(conn = virDBusGetSystemBus()))
return -1;
--
1.8.3.2
10 years, 8 months
[libvirt] [PATCH] Bump version to 1.2.3 for new dev cycle
by Michal Privoznik
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index f30ac76..a9339ce 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,7 +16,7 @@ dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
-AC_INIT([libvirt], [1.2.2], [libvir-list(a)redhat.com], [], [http://libvirt.org])
+AC_INIT([libvirt], [1.2.3], [libvir-list(a)redhat.com], [], [http://libvirt.org])
AC_CONFIG_SRCDIR([src/libvirt.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
--
1.9.0
10 years, 8 months
[libvirt] [PATCH] bhyve: add basic documentation
by Roman Bogorodskiy
---
docs/drivers.html.in | 1 +
docs/drvbhyve.html.in | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++
docs/index.html.in | 3 ++
docs/sitemap.html.in | 4 +++
src/README | 1 +
5 files changed, 92 insertions(+)
create mode 100644 docs/drvbhyve.html.in
diff --git a/docs/drivers.html.in b/docs/drivers.html.in
index 7aa44f3..a1d4240 100644
--- a/docs/drivers.html.in
+++ b/docs/drivers.html.in
@@ -33,6 +33,7 @@
<li><strong><a href="drvhyperv.html">Microsoft Hyper-V</a></strong></li>
<li><strong><a href="drvphyp.html">IBM PowerVM (phyp)</a></strong></li>
<li><strong><a href="drvparallels.html">Parallels</a></strong></li>
+ <li><strong><a href="drvbhyve.html">Bhyve</a></strong> - The BSD Hypervisor</li>
</ul>
<h2><a name="storage">Storage drivers</a></h2>
diff --git a/docs/drvbhyve.html.in b/docs/drvbhyve.html.in
new file mode 100644
index 0000000..5733cc2
--- /dev/null
+++ b/docs/drvbhyve.html.in
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <body>
+ <h1>Bhyve driver</h1>
+
+ <ul id="toc"></ul>
+
+<p>
+Bhyve is a FreeBSD hypervisor. It first appeared in FreeBSD 10.0. However, it's
+recommended to keep tracking FreeBSD 10-STABLE to make sure all new features
+of bhyve are supported.
+
+In order to enable bhyve on your FreeBSD host, you'll need to load <code>vmm</code>
+kernel module. Additionally, <code>if_tap</code> and <code>if_bridge</code> modules
+should be loaded for networking support.
+</p>
+
+<p>
+Additional information on bhyve could be obtained on <a href="http://bhyve.org/">bhyve.org</a>.
+</p>
+
+<h2><a name="uri">Connections to the Bhyve driver</a></h2>
+<p>
+The libvirt bhyve driver is a single-instance privileged driver. Some sample
+connection URIs are:
+</p>
+
+<pre>
+bhyve:///system (local access)
+bhyve+unix:///system (local access)
+bhyve+ssh://root@example.com/system (remote access, SSH tunnelled)
+</pre>
+
+<h2><a name="exconfig">Example guest domain XML configurations</a></h2>
+
+<h3>Example config</h3>
+<p>
+Bhyve driver in libvirt is in its early stage and under active development. So it supports
+only limited number of features bhyve provides. All the supported features could be found
+in this sample domain XML.
+</p>
+
+<p>
+A limitation that is not obvious from this sample domain XML is that currently it's only
+single network and single disk device are supported for each domain (as PCI slot allocation code
+in libvirt bhyve driver yet to be implemented).
+</p>
+
+<pre>
+<domain type='bhyve'>
+ <name>bhyve</name>
+ <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+ <memory>219136</memory>
+ <currentMemory>219136</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type>hvm</type>
+ </os>
+ <features>
+ <apic/>
+ <acpi/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <disk type='file'>
+ <driver name='file' type='raw'/>
+ <source file='/path/to/bhyve_freebsd.img'/>
+ <target dev='hda' bus='sata'/>
+ </disk>
+ <interface type='bridge'>
+ <model type='virtio'/>
+ <source bridge="virbr0"/>
+ </interface>
+ </devices>
+</domain>
+</pre>
+
+ </body>
+</html>
diff --git a/docs/index.html.in b/docs/index.html.in
index 16bd6d5..c94f444 100644
--- a/docs/index.html.in
+++ b/docs/index.html.in
@@ -75,6 +75,9 @@
The <a href="http://libvirt.org/drvparallels.html">Parallels</a> hypervisor
</li>
<li>
+ The <a href="http://libvirt.org/drvbhyve.html">Bhyve</a> hypervisor
+ </li>
+ <li>
Virtual networks using bridging, NAT, VEPA and VN-LINK.
</li>
<li>
diff --git a/docs/sitemap.html.in b/docs/sitemap.html.in
index 7d0610b..78e84e3 100644
--- a/docs/sitemap.html.in
+++ b/docs/sitemap.html.in
@@ -248,6 +248,10 @@
<a href="drvparallels.html">Parallels</a>
<span>Driver for Parallels Cloud Server</span>
</li>
+ <li>
+ <a href="drvbhyve.html">Bhyve</a>
+ <span>Driver for bhyve</span>
+ </li>
</ul>
</li>
<li>
diff --git a/src/README b/src/README
index 00d11d1..bb3cddf 100644
--- a/src/README
+++ b/src/README
@@ -25,6 +25,7 @@ There are two core shared modules to be aware of:
Then there are the hypervisor implementations:
+ * bhyve - bhyve - The BSD Hypervisor
* esx/ - VMware ESX and GSX support using vSphere API over SOAP
* hyperv/ - Microsoft Hyper-V support using WinRM
* lxc/ - Linux Native Containers
--
1.8.4.2
10 years, 8 months
[libvirt] [PATCH] bhyve: defined domains should be persistent
by Roman Bogorodskiy
---
src/bhyve/bhyve_driver.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
index 23fab90..9dbb299 100644
--- a/src/bhyve/bhyve_driver.c
+++ b/src/bhyve/bhyve_driver.c
@@ -335,6 +335,7 @@ bhyveDomainDefineXML(virConnectPtr conn, const char *xml)
0, &oldDef)))
goto cleanup;
def = NULL;
+ vm->persistent = 1;
dom = virGetDomain(conn, vm->def->name, vm->def->uuid);
if (dom)
--
1.8.4.2
10 years, 8 months