]> xenbits.xensource.com Git - libvirt.git/commitdiff
Drop UML driver
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 14 Dec 2018 13:45:07 +0000 (14:45 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 17 Dec 2018 16:52:46 +0000 (17:52 +0100)
The driver is unmaintained, untested and severely broken for
quite some time now. Since nobody even reported any issue with it
let us drop it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
32 files changed:
configure.ac
docs/aclpolkit.html.in
docs/drivers.html.in
docs/drvuml.html.in [deleted file]
docs/formatcaps.html.in
docs/formatdomain.html.in
docs/formatdomaincaps.html.in
docs/formatnwfilter.html.in
docs/news.xml
docs/schemas/capability.rng
docs/schemas/domaincommon.rng
include/libvirt/virterror.h
libvirt.spec.in
m4/virt-driver-uml.m4 [deleted file]
mingw-libvirt.spec.in
po/POTFILES
src/Makefile.am
src/README
src/locking/lock_driver.h
src/remote/Makefile.inc.am
src/remote/libvirtd.uml.logrotate.in [deleted file]
src/remote/remote_daemon.c
src/uml/Makefile.inc.am [deleted file]
src/uml/uml_conf.c [deleted file]
src/uml/uml_conf.h [deleted file]
src/uml/uml_driver.c [deleted file]
src/uml/uml_driver.h [deleted file]
tests/domaincapsschemadata/basic.xml [deleted file]
tests/domaincapstest.c
tests/objectlocking.ml
tests/virdrivermoduletest.c
tools/virsh.c

index 8c89ff365b6baa1862f9f5107b7b31ecfa2f5f04..ac52189dff0f0acb36cb4dcd4717a16e7dee8094 100644 (file)
@@ -225,7 +225,6 @@ if test "$with_libvirtd" = "no" ; then
   with_qemu=no
   with_lxc=no
   with_libxl=no
-  with_uml=no
   with_vbox=no
 fi
 
@@ -445,7 +444,6 @@ LIBVIRT_DRIVER_ARG_VBOX
 LIBVIRT_DRIVER_ARG_LXC
 LIBVIRT_DRIVER_ARG_VZ
 LIBVIRT_DRIVER_ARG_BHYVE
-LIBVIRT_DRIVER_ARG_UML
 LIBVIRT_DRIVER_ARG_ESX
 LIBVIRT_DRIVER_ARG_HYPERV
 LIBVIRT_DRIVER_ARG_TEST
@@ -464,7 +462,6 @@ LIBVIRT_DRIVER_CHECK_VBOX
 LIBVIRT_DRIVER_CHECK_LXC
 LIBVIRT_DRIVER_CHECK_VZ
 LIBVIRT_DRIVER_CHECK_BHYVE
-LIBVIRT_DRIVER_CHECK_UML
 LIBVIRT_DRIVER_CHECK_ESX
 LIBVIRT_DRIVER_CHECK_HYPERV
 LIBVIRT_DRIVER_CHECK_TEST
@@ -947,7 +944,6 @@ AC_MSG_NOTICE([])
 AC_MSG_NOTICE([Drivers])
 AC_MSG_NOTICE([])
 LIBVIRT_DRIVER_RESULT_QEMU
-LIBVIRT_DRIVER_RESULT_UML
 LIBVIRT_DRIVER_RESULT_OPENVZ
 LIBVIRT_DRIVER_RESULT_VMWARE
 LIBVIRT_DRIVER_RESULT_VBOX
index ac54f125dad1cdf4f7f249d8bee6f1959a5510cf..2cf1f9b5a59c0a1a604d9e7b5409938268759430 100644 (file)
           <td>storage</td>
           <td>storage</td>
         </tr>
-        <tr>
-          <td>uml</td>
-          <td>UML</td>
-        </tr>
         <tr>
           <td>vbox</td>
           <td>VBOX</td>
index c94144aa41c35e58836d0e39119f7d10882c04db..a66651df2fda780c9e6f7dfc2ef6c1e6fcb36d69 100644 (file)
@@ -29,7 +29,6 @@
       <li><strong><a href="drvopenvz.html">OpenVZ</a></strong></li>
       <li><strong><a href="drvqemu.html">QEMU</a></strong></li>
       <li><strong><a href="drvtest.html">Test</a></strong> - Used for testing</li>
-      <li><strong><a href="drvuml.html">UML</a></strong> - User Mode Linux</li>
       <li><strong><a href="drvvbox.html">VirtualBox</a></strong></li>
       <li><strong><a href="drvesx.html">VMware ESX</a></strong></li>
       <li><strong><a href="drvvmware.html">VMware Workstation/Player</a></strong></li>
diff --git a/docs/drvuml.html.in b/docs/drvuml.html.in
deleted file mode 100644 (file)
index 0860db7..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml">
-  <body>
-    <h1>User Mode Linux driver</h1>
-
-    <p>
-    The UML driver for libvirt allows use and management of paravirtualized
-    guests built for User Mode Linux. UML requires no special support in
-    the host kernel, so can be used by any user of any linux system, provided
-    they have enough free RAM for their guest's needs, though there are
-    certain restrictions on network connectivity unless the administrator
-    has pre-created TAP devices.
-    </p>
-
-    <h2><a id="project">Project Links</a></h2>
-
-    <ul>
-      <li>
-        The <a href="http://user-mode-linux.sourceforge.net/">User
-        Mode Linux</a> paravirtualized kernel
-      </li>
-    </ul>
-
-    <h2>Connections to UML driver</h2>
-
-    <p>
-    The libvirt UML driver follows the QEMU driver in providing two
-    types of connection. There is one privileged instance per host,
-    which runs as root. This is called the "system" instance, and allows
-    full use of all host resources. Then, there is a per-user unprivileged
-    "session", instance. This has more restricted capabilities, and may
-    require the host administrator to setup certain resources ahead of
-    time to allow full integration with the network. Example connection
-    URIs are
-    </p>
-
-<pre>
-uml:///session                       (local access to per-user instance)
-uml+unix:///session                  (local access to per-user instance)
-
-uml:///system                        (local access to system instance)
-uml+unix:///system                   (local access to system instance)
-uml://example.com/system             (remote access, TLS/x509)
-uml+tcp://example.com/system         (remote access, SASl/Kerberos)
-uml+ssh://root@example.com/system    (remote access, SSH tunnelled)
-</pre>
-
-    <h2>Example XML configuration</h2>
-
-    <p>
-      User mode Linux driver only supports directly kernel boot at
-      this time. A future driver enhancement may allow a paravirt
-      bootloader in a similar style to Xen's pygrub. For now though,
-      the UML kernel must be stored on the host and referenced
-      explicitly in the "os" element. Since UML is a paravirtualized
-      technology, the kernel "type" is set to "uml"
-    </p>
-
-    <p>
-      There is not yet support for networking in the driver, but
-      disks can be specified in the usual libvirt manner. The main
-      variation is the target device naming scheme "ubd0", and
-      bus type of "uml".
-    </p>
-
-    <p>
-      Once booted the primary console is connected to a PTY, and
-      thus accessible with "virsh console" or equivalent tools
-    </p>
-
-<pre>
-&lt;domain type='uml'&gt;
-  &lt;name&gt;demo&lt;/name&gt;
-  &lt;uuid&gt;b4433fc2-a22e-ffb3-0a3d-9c173b395800&lt;/uuid&gt;
-  &lt;memory&gt;500000&lt;/memory&gt;
-  &lt;currentMemory&gt;500000&lt;/currentMemory&gt;
-  &lt;vcpu&gt;1&lt;/vcpu&gt;
-  &lt;os&gt;
-    &lt;type arch='x86_64'&gt;uml&lt;/type&gt;
-    &lt;kernel&gt;/home/berrange/linux-uml-2.6.26-x86_64&lt;/kernel&gt;
-  &lt;/os&gt;
-  &lt;devices&gt;
-    &lt;disk type='file' device='disk'&gt;
-      &lt;source file='/home/berrange/FedoraCore6-AMD64-root_fs'/&gt;
-      &lt;target dev='ubd0' bus='uml'/&gt;
-    &lt;/disk&gt;
-    &lt;console type='pty'/&gt;
-  &lt;/devices&gt;
-&lt;/domain&gt;
-</pre>
-  </body>
-</html>
index 86534b2ed2d6e10d3b4ccb25a67c0244020e9871..2a0aa963bb540d549a7b75aa7ec7fdd14df86bac 100644 (file)
@@ -87,9 +87,6 @@
 
           <dt><code>exe</code></dt>
           <dd>Container based virtualization</dd>
-
-          <dt><code>uml</code></dt>
-          <dd>User Mode Linux</dd>
         </dl>
         </dd>
 
index 428b0e8bb5219a8aa8af8786506fc486c4267795..24632613725e26baaae5104e8ab15648205f2b71 100644 (file)
@@ -7161,9 +7161,9 @@ qemu-kvm -net nic,model=? /dev/null
       Valid values for the <code>type</code> attribute are:
       <code>serial</code> (described below);
       <code>virtio</code> (usable whenever VirtIO support is available);
-      <code>xen</code>, <code>lxc</code>, <code>uml</code> and
-      <code>openvz</code> (available when the corresponding hypervisor is in
-      use). <code>sclp</code> and <code>sclplm</code> (usable for s390 and
+      <code>xen</code>, <code>lxc</code> and <code>openvz</code>
+      (available when the corresponding hypervisor is in use).
+      <code>sclp</code> and <code>sclplm</code> (usable for s390 and
       s390x QEMU guests) are supported for compatibility reasons but should
       not be used for new guests: use the <code>sclpconsole</code> and
       <code>sclplmconsole</code> target models, respectively, with the
index 9920de4dac94a6ec0b9ccb374af62c6597469101..cafd9abbdfc232bb0a5f10931890eaef990ca449 100644 (file)
         &lt;value&gt;virtio&lt;/value&gt;
         &lt;value&gt;xen&lt;/value&gt;
         &lt;value&gt;usb&lt;/value&gt;
-        &lt;value&gt;uml&lt;/value&gt;
         &lt;value&gt;sata&lt;/value&gt;
         &lt;value&gt;sd&lt;/value&gt;
       &lt;/enum&gt;
index b2282b7dee39ddd00fc278bc583b257e3e14028f..796c16549db7875bf787d27405e1676f1e670e38 100644 (file)
@@ -2265,7 +2265,7 @@ echo 3 > /proc/sys/net/netfilter/nf_conntrack_icmp_timeout
      to the incoming and outgoing direction. All this is related to the ftp
      data traffic originating from TCP port 20 of the VM. This then leads to
      the following solution
-     <span class="since">(since 0.8.5 (QEMU, KVM, UML))</span>:
+     <span class="since">(since 0.8.5 (QEMU, KVM))</span>:
     </p>
 <pre>
 &lt;filter name='test-eth0'&gt;
index 5bdbd34a1448b7d7cf96ecc0b0e765a6404978a0..e9b6bb7c65bb069701d6af1dbb6568c3b2cee27c 100644 (file)
         </description>
       </change>
     </section>
+    <section title="Removed features">
+      <change>
+        <summary>
+          Drop UML driver
+        </summary>
+        <description>
+          The UML driver was unmaintained and not tested for
+          quite some time now. Worse, there is a bug that causes
+          it to deadlock on some very basic operations (e.g.
+          dumping domain XML). These facts make us believe no one
+          uses it.
+        </description>
+      </change>
+    </section>
     <section title="Improvements">
       <change>
         <summary>
index fe90a2e4c64aa6e82bcea6e1927239869ad6002e..8f3266b9f1e4b66897dd2091abce435a9573d671 100644 (file)
                                   but is also used by phyp driver -->
         <value>hvm</value> <!-- unmodified OS -->
         <value>exe</value> <!-- For container based virt -->
-        <value>uml</value> <!-- user mode linux -->
+        <value>uml</value> <!-- user mode linux; NOT USED ANYMORE -->
       </choice>
     </element>
   </define>
           <value>kqemu</value>
           <value>kvm</value>
           <value>xen</value>
-          <value>uml</value>
+          <value>uml</value> <!-- NOT USED ANYMORE -->
           <value>lxc</value>
           <value>openvz</value>
           <value>test</value>
index 5a6c48f1aa923a27838431d2a21fb5ea62b23d72..76b49aacc2bfb591f3ebd968c09d9b57ee3459e2 100644 (file)
         <value>kvm</value>
         <value>xen</value>
         <value>lxc</value>
-        <value>uml</value>
+        <value>uml</value> <!-- NOT USED ANYMORE -->
         <value>openvz</value>
         <value>test</value>
         <value>vmware</value>
             <value>virtio</value>
             <value>xen</value>
             <value>usb</value>
-            <value>uml</value>
+            <value>uml</value> <!-- NOT USED ANYMORE -->
             <value>sata</value>
             <value>sd</value>
           </choice>
       <choice>
         <value>xen</value>
         <value>serial</value>
-        <value>uml</value>
+        <value>uml</value> <!-- NOT USED ANYMORE -->
         <value>virtio</value>
         <value>lxc</value>
         <value>openvz</value>
index f41afcd0a799e6b865206f58d8b6730529aae7e3..fbbe2d562484ff2ddeb7db05dea4928773d2b360 100644 (file)
@@ -74,7 +74,7 @@ typedef enum {
     VIR_FROM_NETWORK = 19,      /* Error from network config */
 
     VIR_FROM_DOMAIN = 20,       /* Error from domain config */
-    VIR_FROM_UML = 21,          /* Error at the UML driver */
+    VIR_FROM_UML = 21,          /* Error at the UML driver; unused since 5.0.0 */
     VIR_FROM_NODEDEV = 22,      /* Error from node device monitor */
     VIR_FROM_XEN_INOTIFY = 23,  /* Error from xen inotify layer */
     VIR_FROM_SECURITY = 24,     /* Error from security framework */
index 71cd45c60382129d2377384410489bfda2ca7036..b04cf53eb8ec699a344b2b6a29cb5dd4fc9f3581 100644 (file)
@@ -20,7 +20,6 @@
 # The hypervisor drivers that run in libvirtd
 %define with_qemu          0%{!?_without_qemu:1}
 %define with_lxc           0%{!?_without_lxc:1}
-%define with_uml           0%{!?_without_uml:1}
 %define with_libxl         0%{!?_without_libxl:1}
 %define with_vbox          0%{!?_without_vbox:1}
 
 %endif
 
 
-# RHEL doesn't ship OpenVZ, VBox, UML, PowerHypervisor,
+# RHEL doesn't ship OpenVZ, VBox, PowerHypervisor,
 # VMware, libxenserver (xenapi), libxenlight (Xen 4.1 and newer),
 # or HyperV.
 %if 0%{?rhel}
     %define with_openvz 0
     %define with_vbox 0
-    %define with_uml 0
     %define with_phyp 0
     %define with_vmware 0
     %define with_xenapi 0
 %endif
 
 
-%if %{with_qemu} || %{with_lxc} || %{with_uml}
+%if %{with_qemu} || %{with_lxc}
 # numad is used to manage the CPU and memory placement dynamically,
 # it's not available on many non-x86 architectures.
     %ifnarch s390 s390x %{arm} riscv64
@@ -231,9 +229,9 @@ Requires: libvirt-daemon-driver-lxc = %{version}-%{release}
 %if %{with_qemu}
 Requires: libvirt-daemon-driver-qemu = %{version}-%{release}
 %endif
-%if %{with_uml}
-Requires: libvirt-daemon-driver-uml = %{version}-%{release}
-%endif
+# We had UML driver, but we've removed it.
+Obsoletes: libvirt-daemon-driver-uml <= 5.0.0
+Obsoletes: libvirt-daemon-uml <= 5.0.0
 %if %{with_vbox}
 Requires: libvirt-daemon-driver-vbox = %{version}-%{release}
 %endif
@@ -743,19 +741,6 @@ the Linux kernel
 %endif
 
 
-%if %{with_uml}
-%package daemon-driver-uml
-Summary: Uml driver plugin for the libvirtd daemon
-Requires: libvirt-daemon = %{version}-%{release}
-Requires: libvirt-libs = %{version}-%{release}
-
-%description daemon-driver-uml
-The UML driver plugin for the libvirtd daemon, providing
-an implementation of the hypervisor driver APIs using
-User Mode Linux
-%endif
-
-
 %if %{with_vbox}
 %package daemon-driver-vbox
 Summary: VirtualBox driver plugin for the libvirtd daemon
@@ -843,26 +828,6 @@ capabilities of LXC
 %endif
 
 
-%if %{with_uml}
-%package daemon-uml
-Summary: Server side daemon & driver required to run UML guests
-
-Requires: libvirt-daemon = %{version}-%{release}
-Requires: libvirt-daemon-driver-uml = %{version}-%{release}
-Requires: libvirt-daemon-driver-interface = %{version}-%{release}
-Requires: libvirt-daemon-driver-network = %{version}-%{release}
-Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
-Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
-Requires: libvirt-daemon-driver-secret = %{version}-%{release}
-Requires: libvirt-daemon-driver-storage = %{version}-%{release}
-# There are no UML kernel RPMs in Fedora/RHEL to depend on.
-
-%description daemon-uml
-Server side daemon and driver required to manage the virtualization
-capabilities of UML
-%endif
-
-
 %if %{with_libxl}
 %package daemon-xen
 Summary: Server side daemon & driver required to run XEN guests
@@ -1068,12 +1033,6 @@ exit 1
     %define arg_vmware --without-vmware
 %endif
 
-%if %{with_uml}
-    %define arg_uml --with-uml
-%else
-    %define arg_uml --without-uml
-%endif
-
 %if %{with_storage_rbd}
     %define arg_storage_rbd --with-storage-rbd
 %else
@@ -1187,7 +1146,6 @@ rm -f po/stamp-po
            --with-avahi \
            --with-polkit \
            --with-libvirtd \
-           %{?arg_uml} \
            %{?arg_phyp} \
            %{?arg_esx} \
            %{?arg_hyperv} \
@@ -1316,9 +1274,6 @@ rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.libxl
 rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_libxl.aug
 rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_libxl.aug
 %endif
-%if ! %{with_uml}
-rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.uml
-%endif
 
 # Copied into libvirt-docs subpackage eventually
 mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-%{version} libvirt-docs
@@ -1725,15 +1680,6 @@ exit 0
 %{_libdir}/%{name}/connection-driver/libvirt_driver_lxc.so
 %endif
 
-%if %{with_uml}
-%files daemon-driver-uml
-%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/uml/
-%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.uml
-%ghost %dir %{_localstatedir}/run/libvirt/uml/
-%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/uml/
-%{_libdir}/%{name}/connection-driver/libvirt_driver_uml.so
-%endif
-
 %if %{with_libxl}
 %files daemon-driver-libxl
 %config(noreplace) %{_sysconfdir}/libvirt/libxl.conf
@@ -1764,10 +1710,6 @@ exit 0
 %files daemon-lxc
 %endif
 
-%if %{with_uml}
-%files daemon-uml
-%endif
-
 %if %{with_libxl}
 %files daemon-xen
 %endif
diff --git a/m4/virt-driver-uml.m4 b/m4/virt-driver-uml.m4
deleted file mode 100644 (file)
index 9b406a5..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-dnl The UML driver
-dnl
-dnl Copyright (C) 2005-2015 Red Hat, Inc.
-dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License, or (at your option) any later version.
-dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl Lesser General Public License for more details.
-dnl
-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/>.
-dnl
-
-AC_DEFUN([LIBVIRT_DRIVER_ARG_UML],[
-    LIBVIRT_ARG_WITH_FEATURE([UML], [UML], [check])
-])
-
-AC_DEFUN([LIBVIRT_DRIVER_CHECK_UML],[
-    if test "$with_libvirtd" = "no" || test "$with_linux" = "no"; then
-        if test "$with_uml" = "yes"; then
-            AC_MSG_ERROR([The UML driver cannot be enabled])
-        elif test "$with_uml" = "check"; then
-            with_uml="no"
-        fi
-    fi
-
-    if test "$with_uml" = "yes" || test "$with_uml" = "check"; then
-        AC_CHECK_HEADER([sys/inotify.h], [
-          with_uml=yes
-        ], [
-          if test "$with_uml" = "check"; then
-              with_uml=no
-              AC_MSG_NOTICE([<sys/inotify.h> is required for the UML driver, disabling it])
-          else
-              AC_MSG_ERROR([The <sys/inotify.h> is required for the UML driver. Upgrade your libc6.])
-          fi
-        ])
-    fi
-
-    if test "$with_uml" = "yes" ; then
-        AC_DEFINE_UNQUOTED([WITH_UML], 1, [whether UML driver is enabled])
-    fi
-    AM_CONDITIONAL([WITH_UML], [test "$with_uml" = "yes"])
-])
-
-AC_DEFUN([LIBVIRT_DRIVER_RESULT_UML],[
-    LIBVIRT_RESULT([UML], [$with_uml])
-])
index b28e40f7f7e452ead2418fd8485249a5fc13592d..7c7ab4146db6aaa75475980311e3d5954e5f3051 100644 (file)
@@ -177,7 +177,6 @@ autoreconf -if
   --without-avahi \
   --without-polkit \
   --without-libvirtd \
-  --without-uml \
   %{?_without_phyp} \
   %{?_without_esx} \
   %{?_without_hyperv} \
index be2874487c279bc9213dc43d500837db98dc8797..9dd4ee7d9995c8bbe7944e469b0a96d8e15fcf7e 100644 (file)
@@ -190,8 +190,6 @@ src/storage/storage_backend_zfs.c
 src/storage/storage_driver.c
 src/storage/storage_util.c
 src/test/test_driver.c
-src/uml/uml_conf.c
-src/uml/uml_driver.c
 src/util/iohelper.c
 src/util/viralloc.c
 src/util/virarptable.c
index 33ff280d78fd861632f461f6ccefc35328d1ba2c..e2b89e27e8b1717b23332a4ec24e9836865314d0 100644 (file)
@@ -107,7 +107,6 @@ include logging/Makefile.inc.am
 include locking/Makefile.inc.am
 include admin/Makefile.inc.am
 include rpc/Makefile.inc.am
-include uml/Makefile.inc.am
 include phyp/Makefile.inc.am
 include test/Makefile.inc.am
 include esx/Makefile.inc.am
index bb3cddfc6e962a2fb32c289c6ef98ab7df927df2..846bf2b66472f0b394ac3bad8c5eaa2b0a7d3fad 100644 (file)
@@ -34,7 +34,6 @@ Then there are the hypervisor implementations:
  * qemu/         - QEMU / KVM using qemu CLI/monitor
  * remote/       - Generic libvirt native RPC client
  * test/         - A "mock" driver for testing
- * uml/          - User Mode Linux
  * vbox/         - Virtual Box using native API
  * vmware/       - VMware Workstation and Player using the vmrun tool
  * xen/          - Xen using hypercalls, XenD SEXPR & XenStore
@@ -42,7 +41,7 @@ Then there are the hypervisor implementations:
 
 
 Finally some secondary drivers that are shared for several HVs.
-Currently these are used by LXC, OpenVZ, QEMU, UML and Xen drivers.
+Currently these are used by LXC, OpenVZ, QEMU and Xen drivers.
 The ESX, Hyper-V, Power Hypervisor, Remote, Test & VirtualBox drivers all
 implement the secondary drivers directly
 
index f2d5266517641c70854463125eefbb2fcfdba5d4..50c73a70d44da3929ab9badda00a638eba6b6317 100644 (file)
@@ -124,7 +124,7 @@ struct _virLockManagerParam {
  * too old to support key features.
  *
  * NB: A plugin may be loaded multiple times, for different
- * libvirt drivers (eg QEMU, LXC, UML)
+ * libvirt drivers (eg QEMU, LXC)
  *
  * Returns -1 if the requested version/flags were inadequate
  */
index eb8d6feb314c89a848742ede44cc38a8c2af3934..d188c4e3480cce3c87a307658cc538bf9f96c15c 100644 (file)
@@ -39,7 +39,6 @@ LOGROTATE_FILES_IN += \
        remote/libvirtd.qemu.logrotate.in \
        remote/libvirtd.lxc.logrotate.in \
        remote/libvirtd.libxl.logrotate.in \
-       remote/libvirtd.uml.logrotate.in \
        remote/libvirtd.logrotate.in \
        $(NULL)
 
diff --git a/src/remote/libvirtd.uml.logrotate.in b/src/remote/libvirtd.uml.logrotate.in
deleted file mode 100644 (file)
index 66a848e..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-@localstatedir@/log/libvirt/uml/*.log {
-        weekly
-        missingok
-        rotate 4
-        compress
-        delaycompress
-        copytruncate
-}
index f0dd7597e6f4c3654b287741a2b1f0a684e9dd06..3be3ad02fca20a44688dcc3fab494230fef605db 100644 (file)
@@ -339,10 +339,6 @@ static int daemonInitialize(void)
     if (virDriverLoadModule("lxc", "lxcRegister", false) < 0)
         return -1;
 #endif
-#ifdef WITH_UML
-    if (virDriverLoadModule("uml", "umlRegister", false) < 0)
-        return -1;
-#endif
 #ifdef WITH_VBOX
     if (virDriverLoadModule("vbox", "vboxRegister", false) < 0)
         return -1;
diff --git a/src/uml/Makefile.inc.am b/src/uml/Makefile.inc.am
deleted file mode 100644 (file)
index 975398b..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-UML_DRIVER_SOURCES = \
-       uml/uml_conf.c \
-       uml/uml_conf.h \
-       uml/uml_driver.c \
-       uml/uml_driver.h \
-       $(NULL)
-
-DRIVER_SOURCE_FILES += $(UML_DRIVER_SOURCES)
-STATEFUL_DRIVER_SOURCE_FILES += $(UML_DRIVER_SOURCES)
-EXTRA_DIST += $(UML_DRIVER_SOURCES)
-
-if WITH_UML
-noinst_LTLIBRARIES += libvirt_driver_uml_impl.la
-libvirt_driver_uml_la_SOURCES =
-libvirt_driver_uml_la_LIBADD = \
-       libvirt_driver_uml_impl.la \
-       libvirt.la \
-       ../gnulib/lib/libgnu.la \
-       $(NULL)
-mod_LTLIBRARIES += libvirt_driver_uml.la
-libvirt_driver_uml_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
-
-libvirt_driver_uml_impl_la_CFLAGS = \
-       -I$(srcdir)/access \
-       -I$(srcdir)/conf \
-       $(AM_CFLAGS) \
-       $(NULL)
-libvirt_driver_uml_impl_la_LDFLAGS = $(AM_LDFLAGS)
-libvirt_driver_uml_impl_la_SOURCES = $(UML_DRIVER_SOURCES)
-
-INSTALL_DATA_DIRS += uml
-
-install-data-uml:
-       $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/uml"
-       $(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/uml"
-       $(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/uml"
-
-uninstall-data-uml:
-       rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/uml" ||:
-       rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/uml" ||:
-       rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/uml" ||:
-
-endif WITH_UML
-
-.PHONY: \
-       install-data-uml \
-       uninstall-data-uml \
-       $(NULL)
diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c
deleted file mode 100644 (file)
index 067600a..0000000
+++ /dev/null
@@ -1,481 +0,0 @@
-/*
- * uml_conf.c: UML driver configuration
- *
- * Copyright (C) 2006-2014, 2016 Red Hat, Inc.
- * Copyright (C) 2006 Daniel P. Berrange
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library.  If not, see
- * <http://www.gnu.org/licenses/>.
- */
-
-#include <config.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/wait.h>
-#include <arpa/inet.h>
-
-#include "uml_conf.h"
-#include "viruuid.h"
-#include "virbuffer.h"
-#include "virconf.h"
-#include "viralloc.h"
-#include "virlog.h"
-#include "domain_nwfilter.h"
-#include "virfile.h"
-#include "vircommand.h"
-#include "virnetdevtap.h"
-#include "virnodesuspend.h"
-#include "virstring.h"
-
-#define VIR_FROM_THIS VIR_FROM_UML
-
-VIR_LOG_INIT("uml.uml_conf");
-
-virCapsPtr umlCapsInit(void)
-{
-    virCapsPtr caps;
-    virCapsGuestPtr guest;
-
-    if ((caps = virCapabilitiesNew(virArchFromHost(),
-                                   false, false)) == NULL)
-        goto error;
-
-    /* Some machines have problematic NUMA topology causing
-     * unexpected failures. We don't want to break the QEMU
-     * driver in this scenario, so log errors & carry on
-     */
-    if (virCapabilitiesInitNUMA(caps) < 0) {
-        virCapabilitiesFreeNUMAInfo(caps);
-        VIR_WARN("Failed to query host NUMA topology, disabling NUMA capabilities");
-    }
-
-    if (virCapabilitiesInitCaches(caps) < 0)
-        VIR_WARN("Failed to get host CPU cache info");
-
-    if (virNodeSuspendGetTargetMask(&caps->host.powerMgmt) < 0)
-        VIR_WARN("Failed to get host power management capabilities");
-
-    if (virGetHostUUID(caps->host.host_uuid)) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       "%s", _("cannot get the host uuid"));
-        goto error;
-    }
-
-    if ((guest = virCapabilitiesAddGuest(caps,
-                                         VIR_DOMAIN_OSTYPE_UML,
-                                         caps->host.arch,
-                                         NULL,
-                                         NULL,
-                                         0,
-                                         NULL)) == NULL)
-        goto error;
-
-    if (virCapabilitiesAddGuestDomain(guest,
-                                      VIR_DOMAIN_VIRT_UML,
-                                      NULL,
-                                      NULL,
-                                      0,
-                                      NULL) == NULL)
-        goto error;
-
-    return caps;
-
- error:
-    virObjectUnref(caps);
-    return NULL;
-}
-
-
-static int
-umlConnectTapDevice(virDomainDefPtr vm,
-                    virDomainNetDefPtr net,
-                    const char *bridge)
-{
-    bool template_ifname = false;
-    int tapfd = -1;
-
-    if (!net->ifname ||
-        STRPREFIX(net->ifname, VIR_NET_GENERATED_TAP_PREFIX) ||
-        strchr(net->ifname, '%')) {
-        VIR_FREE(net->ifname);
-        if (VIR_STRDUP(net->ifname, VIR_NET_GENERATED_TAP_PREFIX "%d") < 0)
-            goto error;
-        /* avoid exposing vnet%d in getXMLDesc or error outputs */
-        template_ifname = true;
-    }
-
-    if (virNetDevTapCreateInBridgePort(bridge, &net->ifname, &net->mac,
-                                       vm->uuid, net->backend.tap, &tapfd, 1,
-                                       virDomainNetGetActualVirtPortProfile(net),
-                                       virDomainNetGetActualVlan(net),
-                                       NULL, 0, NULL,
-                                       VIR_NETDEV_TAP_CREATE_IFUP |
-                                       VIR_NETDEV_TAP_CREATE_PERSIST) < 0) {
-        if (template_ifname)
-            VIR_FREE(net->ifname);
-        goto error;
-    }
-
-    if (net->filter) {
-        if (virDomainConfNWFilterInstantiate(vm->name, vm->uuid, net, false) < 0) {
-            if (template_ifname)
-                VIR_FREE(net->ifname);
-            goto error;
-        }
-    }
-
-    VIR_FORCE_CLOSE(tapfd);
-    return 0;
-
- error:
-    VIR_FORCE_CLOSE(tapfd);
-    return -1;
-}
-
-static char *
-umlBuildCommandLineNet(virConnectPtr conn,
-                       virDomainDefPtr vm,
-                       virDomainNetDefPtr def,
-                       int idx)
-{
-    virBuffer buf = VIR_BUFFER_INITIALIZER;
-    char macaddr[VIR_MAC_STRING_BUFLEN];
-
-    /* General format:  ethNN=type,options */
-
-    virBufferAsprintf(&buf, "eth%d=", idx);
-
-    switch (def->type) {
-    case VIR_DOMAIN_NET_TYPE_USER:
-        /* ethNNN=slirp,macaddr */
-        virBufferAddLit(&buf, "slirp");
-        break;
-
-    case VIR_DOMAIN_NET_TYPE_ETHERNET:
-        /* ethNNN=tuntap,tapname,macaddr,gateway */
-        virBufferAddLit(&buf, "tuntap,");
-        if (def->ifname)
-            virBufferAdd(&buf, def->ifname, -1);
-        if (def->guestIP.nips > 0) {
-            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                           _("IP address not supported for ethernet interface"));
-            goto error;
-        }
-        break;
-
-    case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("vhostuser networking type not supported"));
-        goto error;
-
-    case VIR_DOMAIN_NET_TYPE_SERVER:
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("TCP server networking type not supported"));
-        goto error;
-
-    case VIR_DOMAIN_NET_TYPE_CLIENT:
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("TCP client networking type not supported"));
-        goto error;
-
-    case VIR_DOMAIN_NET_TYPE_UDP:
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("UDP networking type not supported"));
-        goto error;
-
-    case VIR_DOMAIN_NET_TYPE_MCAST:
-        /* ethNNN=tuntap,macaddr,ipaddr,port */
-        virBufferAddLit(&buf, "mcast");
-        break;
-
-    case VIR_DOMAIN_NET_TYPE_NETWORK:
-    {
-        char *bridge;
-        virNetworkPtr network = virNetworkLookupByName(conn,
-                                                       def->data.network.name);
-        if (!network) {
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("Network '%s' not found"),
-                           def->data.network.name);
-            goto error;
-        }
-        bridge = virNetworkGetBridgeName(network);
-        virObjectUnref(network);
-        if (bridge == NULL)
-            goto error;
-
-        if (umlConnectTapDevice(vm, def, bridge) < 0) {
-            VIR_FREE(bridge);
-            goto error;
-        }
-
-        /* ethNNN=tuntap,tapname,macaddr,gateway */
-        virBufferAsprintf(&buf, "tuntap,%s", def->ifname);
-        break;
-    }
-
-    case VIR_DOMAIN_NET_TYPE_BRIDGE:
-        if (umlConnectTapDevice(vm, def,
-                                def->data.bridge.brname) < 0)
-            goto error;
-
-        /* ethNNN=tuntap,tapname,macaddr,gateway */
-        virBufferAsprintf(&buf, "tuntap,%s", def->ifname);
-        break;
-
-    case VIR_DOMAIN_NET_TYPE_INTERNAL:
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("internal networking type not supported"));
-        goto error;
-
-    case VIR_DOMAIN_NET_TYPE_DIRECT:
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("direct networking type not supported"));
-        goto error;
-
-    case VIR_DOMAIN_NET_TYPE_HOSTDEV:
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("hostdev networking type not supported"));
-        goto error;
-
-    case VIR_DOMAIN_NET_TYPE_LAST:
-        break;
-    }
-
-    if (def->script) {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("interface script execution not supported by this driver"));
-        goto error;
-    }
-
-    virBufferAsprintf(&buf, ",%s", virMacAddrFormat(&def->mac, macaddr));
-
-    if (def->type == VIR_DOMAIN_NET_TYPE_MCAST) {
-        virBufferAsprintf(&buf, ",%s,%d",
-                          def->data.socket.address,
-                          def->data.socket.port);
-    }
-
-    if (virBufferCheckError(&buf) < 0)
-        return NULL;
-
-    return virBufferContentAndReset(&buf);
-
- error:
-    virBufferFreeAndReset(&buf);
-    return NULL;
-}
-
-static char *
-umlBuildCommandLineChr(virDomainChrDefPtr def,
-                       const char *dev,
-                       virCommandPtr cmd)
-{
-    char *ret = NULL;
-
-    switch (def->source->type) {
-    case VIR_DOMAIN_CHR_TYPE_NULL:
-        if (virAsprintf(&ret, "%s%d=null", dev, def->target.port) < 0)
-            return NULL;
-        break;
-
-    case VIR_DOMAIN_CHR_TYPE_PTY:
-        if (virAsprintf(&ret, "%s%d=pts", dev, def->target.port) < 0)
-            return NULL;
-        break;
-
-    case VIR_DOMAIN_CHR_TYPE_DEV:
-        if (virAsprintf(&ret, "%s%d=tty:%s", dev, def->target.port,
-                        def->source->data.file.path) < 0)
-            return NULL;
-        break;
-
-    case VIR_DOMAIN_CHR_TYPE_STDIO:
-        if (virAsprintf(&ret, "%s%d=fd:0,fd:1", dev, def->target.port) < 0)
-            return NULL;
-        break;
-
-    case VIR_DOMAIN_CHR_TYPE_TCP:
-        if (def->source->data.tcp.listen != 1) {
-            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                           _("only TCP listen is supported for chr device"));
-            return NULL;
-        }
-
-        if (virAsprintf(&ret, "%s%d=port:%s", dev, def->target.port,
-                        def->source->data.tcp.service) < 0)
-            return NULL;
-        break;
-
-    case VIR_DOMAIN_CHR_TYPE_FILE:
-         {
-            int fd_out;
-
-            if ((fd_out = open(def->source->data.file.path,
-                               O_WRONLY | O_APPEND | O_CREAT, 0660)) < 0) {
-                virReportSystemError(errno,
-                                     _("failed to open chardev file: %s"),
-                                     def->source->data.file.path);
-                return NULL;
-            }
-            if (virAsprintf(&ret, "%s%d=null,fd:%d", dev, def->target.port, fd_out) < 0) {
-                VIR_FORCE_CLOSE(fd_out);
-                return NULL;
-            }
-            virCommandPassFD(cmd, fd_out,
-                             VIR_COMMAND_PASS_FD_CLOSE_PARENT);
-        }
-        break;
-   case VIR_DOMAIN_CHR_TYPE_PIPE:
-        /* XXX could open the pipe & just pass the FDs. Be wary of
-         * the effects of blocking I/O, though. */
-
-    case VIR_DOMAIN_CHR_TYPE_VC:
-    case VIR_DOMAIN_CHR_TYPE_UDP:
-    case VIR_DOMAIN_CHR_TYPE_UNIX:
-    default:
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("unsupported chr device type %d"), def->source->type);
-        break;
-    }
-
-    return ret;
-}
-
-/*
- * Null-terminate the current argument and return a pointer to the next.
- * This should follow the same rules as the Linux kernel: arguments are
- * separated by spaces; arguments can be quoted with double quotes; double
- * quotes can't be escaped.
- */
-static char *umlNextArg(char *args)
-{
-    int in_quote = 0;
-
-    for (; *args; args++) {
-        if (*args == ' ' && !in_quote) {
-            *args++ = '\0';
-            break;
-        }
-        if (*args == '"')
-            in_quote = !in_quote;
-    }
-
-    while (*args == ' ')
-        args++;
-
-    return args;
-}
-
-/*
- * Constructs a argv suitable for launching uml with config defined
- * for a given virtual machine.
- */
-virCommandPtr umlBuildCommandLine(virConnectPtr conn,
-                                  struct uml_driver *driver,
-                                  virDomainObjPtr vm)
-{
-    size_t i, j;
-    virCommandPtr cmd;
-
-    cmd = virCommandNew(vm->def->os.kernel);
-
-    virCommandAddEnvPassCommon(cmd);
-
-    /* virCommandAddArgPair(cmd, "con0", "fd:0,fd:1"); */
-    virCommandAddArgFormat(cmd, "mem=%lluK", vm->def->mem.cur_balloon);
-    virCommandAddArgPair(cmd, "umid", vm->def->name);
-    virCommandAddArgPair(cmd, "uml_dir", driver->monitorDir);
-
-    if (vm->def->os.root)
-        virCommandAddArgPair(cmd, "root", vm->def->os.root);
-
-    for (i = 0; i < vm->def->ndisks; i++) {
-        virDomainDiskDefPtr disk = vm->def->disks[i];
-
-        if (!STRPREFIX(disk->dst, "ubd")) {
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("unsupported disk type '%s'"), disk->dst);
-            goto error;
-        }
-
-        virCommandAddArgPair(cmd, disk->dst, virDomainDiskGetSource(disk));
-    }
-
-    for (i = 0; i < vm->def->nnets; i++) {
-        char *ret = umlBuildCommandLineNet(conn, vm->def, vm->def->nets[i], i);
-        if (!ret)
-            goto error;
-        virCommandAddArg(cmd, ret);
-        VIR_FREE(ret);
-    }
-
-    for (i = 0; i < UML_MAX_CHAR_DEVICE; i++) {
-        virDomainChrDefPtr chr = NULL;
-        char *ret = NULL;
-        for (j = 0; j < vm->def->nconsoles; j++)
-            if (vm->def->consoles[j]->target.port == i)
-                chr = vm->def->consoles[j];
-        if (chr)
-            ret = umlBuildCommandLineChr(chr, "con", cmd);
-        if (!ret)
-            if (virAsprintf(&ret, "con%zu=none", i) < 0)
-                goto error;
-        virCommandAddArg(cmd, ret);
-        VIR_FREE(ret);
-    }
-
-    for (i = 0; i < UML_MAX_CHAR_DEVICE; i++) {
-        virDomainChrDefPtr chr = NULL;
-        char *ret = NULL;
-        for (j = 0; j < vm->def->nserials; j++)
-            if (vm->def->serials[j]->target.port == i)
-                chr = vm->def->serials[j];
-        if (chr)
-            ret = umlBuildCommandLineChr(chr, "ssl", cmd);
-        if (!ret)
-            if (virAsprintf(&ret, "ssl%zu=none", i) < 0)
-                goto error;
-
-        virCommandAddArg(cmd, ret);
-        VIR_FREE(ret);
-    }
-
-    if (vm->def->os.cmdline) {
-        char *args, *next_arg;
-        char *cmdline;
-        if (VIR_STRDUP(cmdline, vm->def->os.cmdline) < 0)
-            goto error;
-
-        args = cmdline;
-        while (*args == ' ')
-            args++;
-
-        while (*args) {
-            next_arg = umlNextArg(args);
-            virCommandAddArg(cmd, args);
-            args = next_arg;
-        }
-        VIR_FREE(cmdline);
-    }
-
-    return cmd;
-
- error:
-    virCommandFree(cmd);
-    return NULL;
-}
diff --git a/src/uml/uml_conf.h b/src/uml/uml_conf.h
deleted file mode 100644 (file)
index a9520a6..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * uml_conf.h: VM configuration management
- *
- * Copyright (C) 2006, 2007, 2010 Red Hat, Inc.
- * Copyright (C) 2006 Daniel P. Berrange
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library.  If not, see
- * <http://www.gnu.org/licenses/>.
- */
-
-#ifndef LIBVIRT_UML_CONF_H
-# define LIBVIRT_UML_CONF_H
-
-# include "internal.h"
-# include "libvirt_internal.h"
-# include "capabilities.h"
-# include "network_conf.h"
-# include "virdomainobjlist.h"
-# include "domain_event.h"
-# include "virerror.h"
-# include "virthread.h"
-# include "vircommand.h"
-# include "virhash.h"
-
-# define umlDebug(fmt, ...) do {} while (0)
-
-# define UML_CPUMASK_LEN CPU_SETSIZE
-
-# define UML_MAX_CHAR_DEVICE 16
-
-/* Main driver state */
-struct uml_driver {
-    virMutex lock;
-
-    bool privileged;
-    virStateInhibitCallback inhibitCallback;
-    void *inhibitOpaque;
-
-    unsigned long umlVersion;
-    int nextvmid;
-
-    virDomainObjListPtr domains;
-    size_t nactive;
-
-    char *configDir;
-    char *autostartDir;
-    char *logDir;
-    char *monitorDir;
-
-    int inotifyFD;
-    int inotifyWatch;
-
-    virCapsPtr caps;
-    virDomainXMLOptionPtr xmlopt;
-
-    /* Event handling */
-    virObjectEventStatePtr domainEventState;
-
-    /* Mapping of 'char *uuidstr' -> virConnectPtr
-     * of guests which will be automatically killed
-     * when the virConnectPtr is closed*/
-    virHashTablePtr autodestroy;
-};
-
-virCapsPtr  umlCapsInit               (void);
-
-virCommandPtr umlBuildCommandLine(virConnectPtr conn,
-                                  struct uml_driver *driver,
-                                  virDomainObjPtr dom);
-
-#endif /* LIBVIRT_UML_CONF_H */
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
deleted file mode 100644 (file)
index e790273..0000000
+++ /dev/null
@@ -1,2835 +0,0 @@
-/*
- * uml_driver.c: core driver methods for managing UML guests
- *
- * Copyright (C) 2006-2015 Red Hat, Inc.
- * Copyright (C) 2006-2008 Daniel P. Berrange
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library.  If not, see
- * <http://www.gnu.org/licenses/>.
- */
-
-#include <config.h>
-
-#include <sys/types.h>
-#include <sys/poll.h>
-#include <stdarg.h>
-#include <unistd.h>
-#include <sys/utsname.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <pwd.h>
-#include <sys/wait.h>
-#include <sys/ioctl.h>
-#include <sys/inotify.h>
-#include <sys/un.h>
-
-#include "uml_driver.h"
-#include "uml_conf.h"
-#include "virbuffer.h"
-#include "virhostcpu.h"
-#include "virhostmem.h"
-#include "capabilities.h"
-#include "viralloc.h"
-#include "viruuid.h"
-#include "domain_conf.h"
-#include "domain_audit.h"
-#include "datatypes.h"
-#include "virlog.h"
-#include "domain_nwfilter.h"
-#include "virfile.h"
-#include "virfdstream.h"
-#include "configmake.h"
-#include "virnetdevtap.h"
-#include "virnodesuspend.h"
-#include "virprocess.h"
-#include "viruri.h"
-#include "virstring.h"
-#include "viraccessapicheck.h"
-
-#define VIR_FROM_THIS VIR_FROM_UML
-
-VIR_LOG_INIT("uml.uml_driver");
-
-typedef struct _umlDomainObjPrivate umlDomainObjPrivate;
-typedef umlDomainObjPrivate *umlDomainObjPrivatePtr;
-struct _umlDomainObjPrivate {
-    int monitor;
-    int monitorWatch;
-};
-
-static int umlProcessAutoDestroyInit(struct uml_driver *driver);
-static void umlProcessAutoDestroyRun(struct uml_driver *driver,
-                                     virConnectPtr conn);
-static void umlProcessAutoDestroyShutdown(struct uml_driver *driver);
-static int umlProcessAutoDestroyAdd(struct uml_driver *driver,
-                                    virDomainObjPtr vm,
-                                    virConnectPtr conn);
-static int umlProcessAutoDestroyRemove(struct uml_driver *driver,
-                                       virDomainObjPtr vm);
-
-
-static int umlStateCleanup(void);
-
-static void *umlDomainObjPrivateAlloc(void *opaque ATTRIBUTE_UNUSED)
-{
-    umlDomainObjPrivatePtr priv;
-
-    if (VIR_ALLOC(priv) < 0)
-        return NULL;
-
-    priv->monitor = -1;
-    priv->monitorWatch = -1;
-
-    return priv;
-}
-
-static void umlDomainObjPrivateFree(void *data)
-{
-    umlDomainObjPrivatePtr priv = data;
-
-    VIR_FREE(priv);
-}
-
-
-static void umlDriverLock(struct uml_driver *driver)
-{
-    virMutexLock(&driver->lock);
-}
-static void umlDriverUnlock(struct uml_driver *driver)
-{
-    virMutexUnlock(&driver->lock);
-}
-
-
-static int umlOpenMonitor(struct uml_driver *driver,
-                          virDomainObjPtr vm);
-static int umlReadPidFile(struct uml_driver *driver,
-                          virDomainObjPtr vm);
-
-static int umlStartVMDaemon(virConnectPtr conn,
-                            struct uml_driver *driver,
-                            virDomainObjPtr vm,
-                            bool autoDestroy);
-
-static void umlShutdownVMDaemon(struct uml_driver *driver,
-                                virDomainObjPtr vm,
-                                virDomainShutoffReason reason);
-
-
-static int umlMonitorCommand(const struct uml_driver *driver,
-                             const virDomainObj *vm,
-                             const char *cmd,
-                             char **reply);
-
-static struct uml_driver *uml_driver;
-
-static virDomainObjPtr
-umlDomObjFromDomainLocked(struct uml_driver *driver,
-                          const unsigned char *uuid)
-{
-    virDomainObjPtr vm;
-    char uuidstr[VIR_UUID_STRING_BUFLEN];
-
-    if (!(vm = virDomainObjListFindByUUID(driver->domains, uuid))) {
-        virUUIDFormat(uuid, uuidstr);
-
-        virReportError(VIR_ERR_NO_DOMAIN,
-                       _("no domain with matching uuid '%s'"), uuidstr);
-        return NULL;
-    }
-
-    return vm;
-}
-
-
-static virDomainObjPtr
-umlDomObjFromDomain(struct uml_driver *driver,
-                    const unsigned char *uuid)
-{
-    virDomainObjPtr vm;
-
-    umlDriverLock(driver);
-    vm = umlDomObjFromDomainLocked(driver, uuid);
-    umlDriverUnlock(driver);
-    return vm;
-}
-
-
-struct umlAutostartData {
-    struct uml_driver *driver;
-    virConnectPtr conn;
-};
-
-static int
-umlAutostartDomain(virDomainObjPtr vm,
-                   void *opaque)
-{
-    const struct umlAutostartData *data = opaque;
-    int ret = 0;
-    virObjectLock(vm);
-    if (vm->autostart &&
-        !virDomainObjIsActive(vm)) {
-        virResetLastError();
-        ret = umlStartVMDaemon(data->conn, data->driver, vm, false);
-        virDomainAuditStart(vm, "booted", ret >= 0);
-        if (ret < 0) {
-            virReportError(VIR_ERR_INTERNAL_ERROR, _("Failed to autostart VM '%s': %s"),
-                           vm->def->name, virGetLastErrorMessage());
-        } else {
-            virObjectEventPtr event =
-                virDomainEventLifecycleNewFromObj(vm,
-                                         VIR_DOMAIN_EVENT_STARTED,
-                                         VIR_DOMAIN_EVENT_STARTED_BOOTED);
-            virObjectEventStateQueue(data->driver->domainEventState, event);
-        }
-    }
-    virObjectUnlock(vm);
-    return ret;
-}
-
-static void
-umlAutostartConfigs(struct uml_driver *driver)
-{
-    /* XXX: Figure out a better way todo this. The domain
-     * startup code needs a connection handle in order
-     * to lookup the bridge associated with a virtual
-     * network
-     */
-    virConnectPtr conn = virConnectOpen(driver->privileged ?
-                                        "uml:///system" :
-                                        "uml:///session");
-    /* Ignoring NULL conn which is mostly harmless here */
-
-    struct umlAutostartData data = { driver, conn };
-
-    umlDriverLock(driver);
-    virDomainObjListForEach(driver->domains, umlAutostartDomain, &data);
-    umlDriverUnlock(driver);
-
-    virObjectUnref(conn);
-}
-
-
-static int
-umlIdentifyOneChrPTY(struct uml_driver *driver,
-                     virDomainObjPtr dom,
-                     virDomainChrDefPtr def,
-                     const char *dev)
-{
-    char *cmd;
-    char *res = NULL;
-    int retries = 0;
-    if (virAsprintf(&cmd, "config %s%d", dev, def->target.port) < 0)
-        return -1;
- requery:
-    if (umlMonitorCommand(driver, dom, cmd, &res) < 0)
-        return -1;
-
-    if (res && STRPREFIX(res, "pts:")) {
-        VIR_FREE(def->source->data.file.path);
-        if (VIR_STRDUP(def->source->data.file.path, res + 4) < 0) {
-            VIR_FREE(res);
-            VIR_FREE(cmd);
-            return -1;
-        }
-    } else if (!res || STRPREFIX(res, "pts")) {
-        /* It can take a while to startup, so retry for
-           up to 5 seconds */
-        /* XXX should do this in a better non-blocking
-           way somehow ...perhaps register a timer */
-        if (retries++ < 50) {
-            VIR_FREE(res);
-            usleep(1000*10);
-            goto requery;
-        }
-    }
-
-    VIR_FREE(cmd);
-    VIR_FREE(res);
-    return 0;
-}
-
-static int
-umlIdentifyChrPTY(struct uml_driver *driver,
-                  virDomainObjPtr dom)
-{
-    size_t i;
-
-    for (i = 0; i < dom->def->nconsoles; i++)
-        if (dom->def->consoles[i]->source->type == VIR_DOMAIN_CHR_TYPE_PTY)
-        if (umlIdentifyOneChrPTY(driver, dom,
-                                 dom->def->consoles[i], "con") < 0)
-            return -1;
-
-    for (i = 0; i < dom->def->nserials; i++)
-        if (dom->def->serials[i]->source->type == VIR_DOMAIN_CHR_TYPE_PTY &&
-            umlIdentifyOneChrPTY(driver, dom,
-                                 dom->def->serials[i], "ssl") < 0)
-            return -1;
-
-    return 0;
-}
-
-static void
-umlInotifyEvent(int watch,
-                int fd,
-                int events ATTRIBUTE_UNUSED,
-                void *data)
-{
-    char buf[1024];
-    struct inotify_event e;
-    int got;
-    char *tmp, *name;
-    struct uml_driver *driver = data;
-    virDomainObjPtr dom;
-    virObjectEventPtr event = NULL;
-
-    umlDriverLock(driver);
-    if (watch != driver->inotifyWatch)
-        goto cleanup;
-
- reread:
-    got = read(fd, buf, sizeof(buf));
-    if (got == -1) {
-        if (errno == EINTR)
-            goto reread;
-        goto cleanup;
-    }
-
-    tmp = buf;
-    while (got) {
-        if (got < sizeof(e))
-            goto cleanup; /* bad */
-
-        memcpy(&e, tmp, sizeof(e));
-        tmp += sizeof(e);
-        got -= sizeof(e);
-
-        if (got < e.len)
-            goto cleanup;
-
-        tmp += e.len;
-        got -= e.len;
-
-        name = (char *)&(e.name);
-
-        dom = virDomainObjListFindByName(driver->domains, name);
-
-        if (!dom)
-            continue;
-
-        if (e.mask & IN_DELETE) {
-            VIR_DEBUG("Got inotify domain shutdown '%s'", name);
-            if (!virDomainObjIsActive(dom)) {
-                virDomainObjEndAPI(&dom);
-                continue;
-            }
-
-            umlShutdownVMDaemon(driver, dom, VIR_DOMAIN_SHUTOFF_SHUTDOWN);
-            virDomainAuditStop(dom, "shutdown");
-            event = virDomainEventLifecycleNewFromObj(dom,
-                                             VIR_DOMAIN_EVENT_STOPPED,
-                                             VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN);
-            if (!dom->persistent)
-                virDomainObjListRemove(driver->domains, dom);
-        } else if (e.mask & (IN_CREATE | IN_MODIFY)) {
-            VIR_DEBUG("Got inotify domain startup '%s'", name);
-            if (virDomainObjIsActive(dom)) {
-                virDomainObjEndAPI(&dom);
-                continue;
-            }
-
-            if (umlReadPidFile(driver, dom) < 0) {
-                virDomainObjEndAPI(&dom);
-                continue;
-            }
-
-            dom->def->id = driver->nextvmid++;
-
-            if (!driver->nactive && driver->inhibitCallback)
-                driver->inhibitCallback(true, driver->inhibitOpaque);
-            driver->nactive++;
-
-            virDomainObjSetState(dom, VIR_DOMAIN_RUNNING,
-                                 VIR_DOMAIN_RUNNING_BOOTED);
-
-            if (umlOpenMonitor(driver, dom) < 0) {
-                VIR_WARN("Could not open monitor for new domain");
-                umlShutdownVMDaemon(driver, dom,
-                                    VIR_DOMAIN_SHUTOFF_FAILED);
-                virDomainAuditStop(dom, "failed");
-                event = virDomainEventLifecycleNewFromObj(dom,
-                                                 VIR_DOMAIN_EVENT_STOPPED,
-                                                 VIR_DOMAIN_EVENT_STOPPED_FAILED);
-                if (!dom->persistent)
-                    virDomainObjListRemove(driver->domains, dom);
-            } else if (umlIdentifyChrPTY(driver, dom) < 0) {
-                VIR_WARN("Could not identify character devices for new domain");
-                umlShutdownVMDaemon(driver, dom,
-                                    VIR_DOMAIN_SHUTOFF_FAILED);
-                virDomainAuditStop(dom, "failed");
-                event = virDomainEventLifecycleNewFromObj(dom,
-                                                 VIR_DOMAIN_EVENT_STOPPED,
-                                                 VIR_DOMAIN_EVENT_STOPPED_FAILED);
-                if (!dom->persistent)
-                    virDomainObjListRemove(driver->domains, dom);
-            }
-        }
-        virDomainObjEndAPI(&dom);
-        virObjectEventStateQueue(driver->domainEventState, event);
-        event = NULL;
-    }
-
- cleanup:
-    umlDriverUnlock(driver);
-}
-
-
-static int
-umlDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
-                            const virDomainDef *def ATTRIBUTE_UNUSED,
-                            virCapsPtr caps ATTRIBUTE_UNUSED,
-                            unsigned int parseFlags ATTRIBUTE_UNUSED,
-                            void *opaque ATTRIBUTE_UNUSED,
-                            void *parseOpaque ATTRIBUTE_UNUSED)
-{
-    if (dev->type == VIR_DOMAIN_DEVICE_CHR &&
-        dev->data.chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE &&
-        dev->data.chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_NONE)
-        dev->data.chr->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_UML;
-
-    /* forbid capabilities mode hostdev in this kind of hypervisor */
-    if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV &&
-        dev->data.hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES) {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("hostdev mode 'capabilities' is not "
-                         "supported in %s"),
-                       virDomainVirtTypeToString(def->virtType));
-        return -1;
-    }
-
-    return 0;
-}
-
-
-static int
-umlDomainDefPostParse(virDomainDefPtr def ATTRIBUTE_UNUSED,
-                      virCapsPtr caps ATTRIBUTE_UNUSED,
-                      unsigned int parseFlags ATTRIBUTE_UNUSED,
-                      void *opaque ATTRIBUTE_UNUSED,
-                      void *parseOpaque ATTRIBUTE_UNUSED)
-{
-    return 0;
-}
-
-
-virDomainDefParserConfig umlDriverDomainDefParserConfig = {
-    .devicesPostParseCallback = umlDomainDeviceDefPostParse,
-    .domainPostParseCallback = umlDomainDefPostParse,
-};
-
-
-/**
- * umlStartup:
- *
- * Initialization function for the Uml daemon
- */
-static int
-umlStateInitialize(bool privileged,
-                   virStateInhibitCallback callback,
-                   void *opaque)
-{
-    char *base = NULL;
-    char *userdir = NULL;
-
-    virDomainXMLPrivateDataCallbacks privcb = {
-        .alloc = umlDomainObjPrivateAlloc,
-        .free = umlDomainObjPrivateFree,
-    };
-
-    if (VIR_ALLOC(uml_driver) < 0)
-        return -1;
-
-    uml_driver->privileged = privileged;
-    uml_driver->inhibitCallback = callback;
-    uml_driver->inhibitOpaque = opaque;
-
-    if (virMutexInit(&uml_driver->lock) < 0) {
-        VIR_FREE(uml_driver);
-        return -1;
-    }
-    umlDriverLock(uml_driver);
-
-    /* Don't have a dom0 so start from 1 */
-    uml_driver->nextvmid = 1;
-    uml_driver->inotifyWatch = -1;
-
-    if (!(uml_driver->domains = virDomainObjListNew()))
-        goto error;
-
-    uml_driver->domainEventState = virObjectEventStateNew();
-    if (!uml_driver->domainEventState)
-        goto error;
-
-    userdir = virGetUserDirectory();
-    if (!userdir)
-        goto error;
-
-    if (privileged) {
-        if (virAsprintf(&uml_driver->logDir,
-                        "%s/log/libvirt/uml", LOCALSTATEDIR) == -1)
-            goto out_of_memory;
-
-        if (VIR_STRDUP(base, SYSCONFDIR "/libvirt") < 0)
-            goto error;
-
-        if (virAsprintf(&uml_driver->monitorDir,
-                        "%s/run/libvirt/uml-guest", LOCALSTATEDIR) == -1)
-            goto out_of_memory;
-    } else {
-        base = virGetUserConfigDirectory();
-        if (!base)
-            goto error;
-
-        if (virAsprintf(&uml_driver->logDir,
-                        "%s/uml/log", base) == -1)
-            goto out_of_memory;
-
-        if (virAsprintf(&uml_driver->monitorDir,
-                        "%s/.uml", userdir) == -1)
-            goto out_of_memory;
-    }
-
-    /* Configuration paths are either $XDG_CONFIG_HOME/libvirt/uml/... (session) or
-     * /etc/libvirt/uml/... (system).
-     */
-    if (virAsprintf(&uml_driver->configDir, "%s/uml", base) == -1)
-        goto out_of_memory;
-
-    if (virAsprintf(&uml_driver->autostartDir, "%s/uml/autostart", base) == -1)
-        goto out_of_memory;
-
-    VIR_FREE(base);
-
-    if ((uml_driver->caps = umlCapsInit()) == NULL)
-        goto out_of_memory;
-
-    if (!(uml_driver->xmlopt = virDomainXMLOptionNew(&umlDriverDomainDefParserConfig,
-                                                     &privcb, NULL, NULL, NULL)))
-        goto error;
-
-    if ((uml_driver->inotifyFD = inotify_init()) < 0) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("cannot initialize inotify"));
-        goto error;
-    }
-
-    if (virFileMakePath(uml_driver->monitorDir) < 0) {
-        virReportSystemError(errno, _("Failed to create monitor directory %s"),
-                             uml_driver->monitorDir);
-        goto error;
-    }
-
-    VIR_INFO("Adding inotify watch on %s", uml_driver->monitorDir);
-    if (inotify_add_watch(uml_driver->inotifyFD,
-                          uml_driver->monitorDir,
-                          IN_CREATE | IN_MODIFY | IN_DELETE) < 0) {
-        virReportSystemError(errno, _("Failed to create inotify watch on %s"),
-                             uml_driver->monitorDir);
-        goto error;
-    }
-
-    if ((uml_driver->inotifyWatch =
-         virEventAddHandle(uml_driver->inotifyFD, POLLIN,
-                           umlInotifyEvent, uml_driver, NULL)) < 0)
-        goto error;
-
-    if (umlProcessAutoDestroyInit(uml_driver) < 0)
-        goto error;
-
-    if (virDomainObjListLoadAllConfigs(uml_driver->domains,
-                                       uml_driver->configDir,
-                                       uml_driver->autostartDir, false,
-                                       uml_driver->caps,
-                                       uml_driver->xmlopt,
-                                       NULL, NULL) < 0)
-        goto error;
-
-    umlDriverUnlock(uml_driver);
-
-    VIR_FREE(userdir);
-
-    return 0;
-
- out_of_memory:
-    virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("umlStartup: out of memory"));
-
- error:
-    VIR_FREE(userdir);
-    VIR_FREE(base);
-    umlDriverUnlock(uml_driver);
-    umlStateCleanup();
-    return -1;
-}
-
-/**
- * umlStateAutoStart:
- *
- * Function to autostart the Uml daemons
- */
-static void
-umlStateAutoStart(void)
-{
-    if (!uml_driver)
-        return;
-
-    umlAutostartConfigs(uml_driver);
-}
-
-static void umlNotifyLoadDomain(virDomainObjPtr vm, int newVM, void *opaque)
-{
-    struct uml_driver *driver = opaque;
-
-    if (newVM) {
-        virObjectEventPtr event =
-            virDomainEventLifecycleNewFromObj(vm,
-                                     VIR_DOMAIN_EVENT_DEFINED,
-                                     VIR_DOMAIN_EVENT_DEFINED_ADDED);
-        virObjectEventStateQueue(driver->domainEventState, event);
-    }
-}
-
-
-/**
- * umlStateReload:
- *
- * Function to restart the Uml daemon, it will recheck the configuration
- * files and update its state and the networking
- */
-static int
-umlStateReload(void)
-{
-    if (!uml_driver)
-        return 0;
-
-    umlDriverLock(uml_driver);
-    virDomainObjListLoadAllConfigs(uml_driver->domains,
-                                   uml_driver->configDir,
-                                   uml_driver->autostartDir, false,
-                                   uml_driver->caps,
-                                   uml_driver->xmlopt,
-                                   umlNotifyLoadDomain, uml_driver);
-    umlDriverUnlock(uml_driver);
-
-    return 0;
-}
-
-
-static int
-umlShutdownOneVM(virDomainObjPtr dom, void *opaque)
-{
-    struct uml_driver *driver = opaque;
-
-    virObjectLock(dom);
-    if (virDomainObjIsActive(dom)) {
-        umlShutdownVMDaemon(driver, dom, VIR_DOMAIN_SHUTOFF_SHUTDOWN);
-        virDomainAuditStop(dom, "shutdown");
-    }
-    virObjectUnlock(dom);
-    return 0;
-}
-
-/**
- * umlStateCleanup:
- *
- * Shutdown the Uml daemon, it will stop all active domains and networks
- */
-static int
-umlStateCleanup(void)
-{
-    if (!uml_driver)
-        return -1;
-
-    umlDriverLock(uml_driver);
-    if (uml_driver->inotifyWatch != -1)
-        virEventRemoveHandle(uml_driver->inotifyWatch);
-    VIR_FORCE_CLOSE(uml_driver->inotifyFD);
-    virObjectUnref(uml_driver->caps);
-    virObjectUnref(uml_driver->xmlopt);
-
-    /* shutdown active VMs
-     * XXX allow them to stay around & reconnect */
-    virDomainObjListForEach(uml_driver->domains, umlShutdownOneVM, uml_driver);
-
-    virObjectUnref(uml_driver->domains);
-
-    virObjectUnref(uml_driver->domainEventState);
-
-    VIR_FREE(uml_driver->logDir);
-    VIR_FREE(uml_driver->configDir);
-    VIR_FREE(uml_driver->autostartDir);
-    VIR_FREE(uml_driver->monitorDir);
-
-    umlProcessAutoDestroyShutdown(uml_driver);
-
-    umlDriverUnlock(uml_driver);
-    virMutexDestroy(&uml_driver->lock);
-    VIR_FREE(uml_driver);
-
-    return 0;
-}
-
-
-static int umlProcessAutoDestroyInit(struct uml_driver *driver)
-{
-    if (!(driver->autodestroy = virHashCreate(5, NULL)))
-        return -1;
-
-    return 0;
-}
-
-struct umlProcessAutoDestroyData {
-    struct uml_driver *driver;
-    virConnectPtr conn;
-};
-
-static int umlProcessAutoDestroyDom(void *payload,
-                                    const void *name,
-                                    void *opaque)
-{
-    struct umlProcessAutoDestroyData *data = opaque;
-    virConnectPtr conn = payload;
-    const char *uuidstr = name;
-    unsigned char uuid[VIR_UUID_BUFLEN];
-    virDomainObjPtr dom;
-    virObjectEventPtr event = NULL;
-
-    VIR_DEBUG("conn=%p uuidstr=%s thisconn=%p", conn, uuidstr, data->conn);
-
-    if (data->conn != conn)
-        return 0;
-
-    if (virUUIDParse(uuidstr, uuid) < 0) {
-        VIR_WARN("Failed to parse %s", uuidstr);
-        return 0;
-    }
-
-    if (!(dom = virDomainObjListFindByUUID(data->driver->domains, uuid))) {
-        VIR_DEBUG("No domain object to kill");
-        return 0;
-    }
-
-    VIR_DEBUG("Killing domain");
-    umlShutdownVMDaemon(data->driver, dom, VIR_DOMAIN_SHUTOFF_DESTROYED);
-    virDomainAuditStop(dom, "destroyed");
-    event = virDomainEventLifecycleNewFromObj(dom,
-                                     VIR_DOMAIN_EVENT_STOPPED,
-                                     VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
-
-    if (!dom->persistent)
-        virDomainObjListRemove(data->driver->domains, dom);
-
-    virDomainObjEndAPI(&dom);
-    virObjectEventStateQueue(data->driver->domainEventState, event);
-    virHashRemoveEntry(data->driver->autodestroy, uuidstr);
-    return 0;
-}
-
-/*
- * Precondition: driver is locked
- */
-static void umlProcessAutoDestroyRun(struct uml_driver *driver, virConnectPtr conn)
-{
-    struct umlProcessAutoDestroyData data = {
-        driver, conn
-    };
-    VIR_DEBUG("conn=%p", conn);
-    virHashForEach(driver->autodestroy, umlProcessAutoDestroyDom, &data);
-}
-
-static void umlProcessAutoDestroyShutdown(struct uml_driver *driver)
-{
-    virHashFree(driver->autodestroy);
-}
-
-static int umlProcessAutoDestroyAdd(struct uml_driver *driver,
-                                    virDomainObjPtr vm,
-                                    virConnectPtr conn)
-{
-    char uuidstr[VIR_UUID_STRING_BUFLEN];
-    virUUIDFormat(vm->def->uuid, uuidstr);
-    VIR_DEBUG("vm=%s uuid=%s conn=%p", vm->def->name, uuidstr, conn);
-    if (virHashAddEntry(driver->autodestroy, uuidstr, conn) < 0)
-        return -1;
-    return 0;
-}
-
-static int umlProcessAutoDestroyRemove(struct uml_driver *driver,
-                                       virDomainObjPtr vm)
-{
-    char uuidstr[VIR_UUID_STRING_BUFLEN];
-    virUUIDFormat(vm->def->uuid, uuidstr);
-    VIR_DEBUG("vm=%s uuid=%s", vm->def->name, uuidstr);
-    if (virHashRemoveEntry(driver->autodestroy, uuidstr) < 0)
-        return -1;
-    return 0;
-}
-
-
-static int umlReadPidFile(struct uml_driver *driver,
-                          virDomainObjPtr vm)
-{
-    int rc = -1;
-    FILE *file;
-    char *pidfile = NULL;
-    int retries = 0;
-
-    vm->pid = -1;
-    if (virAsprintf(&pidfile, "%s/%s/pid",
-                    driver->monitorDir, vm->def->name) < 0)
-        return -1;
-
- reopen:
-    if (!(file = fopen(pidfile, "r"))) {
-        if (errno == ENOENT &&
-            retries++ < 50) {
-            usleep(1000 * 100);
-            goto reopen;
-        }
-        goto cleanup;
-    }
-
-    if (fscanf(file, "%d", &vm->pid) != 1) {
-        errno = EINVAL;
-        VIR_FORCE_FCLOSE(file);
-        goto cleanup;
-    }
-
-    if (VIR_FCLOSE(file) < 0)
-        goto cleanup;
-
-    rc = 0;
-
- cleanup:
-    if (rc != 0)
-        virReportSystemError(errno,
-                             _("failed to read pid: %s"),
-                             pidfile);
-    VIR_FREE(pidfile);
-    return rc;
-}
-
-static int umlMonitorAddress(const struct uml_driver *driver,
-                             const virDomainObj *vm,
-                             struct sockaddr_un *addr)
-{
-    char *sockname;
-    int retval = 0;
-
-    if (virAsprintf(&sockname, "%s/%s/mconsole",
-                    driver->monitorDir, vm->def->name) < 0)
-        return -1;
-
-    memset(addr, 0, sizeof(*addr));
-    addr->sun_family = AF_UNIX;
-    if (virStrcpyStatic(addr->sun_path, sockname) < 0) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Unix path %s too long for destination"), sockname);
-        retval = -1;
-    }
-    VIR_FREE(sockname);
-    return retval;
-}
-
-static int umlOpenMonitor(struct uml_driver *driver,
-                          virDomainObjPtr vm)
-{
-    struct sockaddr_un addr;
-    struct stat sb;
-    int retries = 0;
-    umlDomainObjPrivatePtr priv = vm->privateData;
-
-    if (umlMonitorAddress(driver, vm, &addr) < 0)
-        return -1;
-
-    VIR_DEBUG("Dest address for monitor is '%s'", addr.sun_path);
- restat:
-    if (stat(addr.sun_path, &sb) < 0) {
-        if (errno == ENOENT &&
-            retries++ < 50) {
-            usleep(1000 * 100);
-            goto restat;
-        }
-        return -1;
-    }
-
-    if ((priv->monitor = socket(PF_UNIX, SOCK_DGRAM, 0)) < 0) {
-        virReportSystemError(errno,
-                             "%s", _("cannot open socket"));
-        return -1;
-    }
-
-    memset(addr.sun_path, 0, sizeof(addr.sun_path));
-    snprintf(addr.sun_path + 1, sizeof(addr.sun_path) - 1,
-             "libvirt-uml-%u", vm->pid);
-    VIR_DEBUG("Reply address for monitor is '%s'", addr.sun_path+1);
-    if (bind(priv->monitor, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
-        virReportSystemError(errno,
-                             "%s", _("cannot bind socket"));
-        VIR_FORCE_CLOSE(priv->monitor);
-        return -1;
-    }
-
-    return 0;
-}
-
-
-#define MONITOR_MAGIC 0xcafebabe
-#define MONITOR_BUFLEN 512
-#define MONITOR_VERSION 2
-
-struct monitor_request {
-    uint32_t magic;
-    uint32_t version;
-    uint32_t length;
-    char data[MONITOR_BUFLEN];
-};
-
-struct monitor_response {
-    uint32_t error;
-    uint32_t extra;
-    uint32_t length;
-    char data[MONITOR_BUFLEN];
-};
-
-
-static int umlMonitorCommand(const struct uml_driver *driver,
-                             const virDomainObj *vm,
-                             const char *cmd,
-                             char **reply)
-{
-    struct monitor_request req;
-    struct monitor_response res;
-    char *retdata = NULL;
-    int retlen = 0, ret = 0;
-    struct sockaddr_un addr;
-    unsigned int addrlen;
-    umlDomainObjPrivatePtr priv = vm->privateData;
-
-    VIR_DEBUG("Run command '%s'", cmd);
-
-    *reply = NULL;
-
-    if (umlMonitorAddress(driver, vm, &addr) < 0)
-        return -1;
-
-    memset(&req, 0, sizeof(req));
-    req.magic = MONITOR_MAGIC;
-    req.version = MONITOR_VERSION;
-    req.length = strlen(cmd);
-    if (req.length > (MONITOR_BUFLEN-1)) {
-        virReportSystemError(EINVAL,
-                             _("cannot send too long command %s (%d bytes)"),
-                             cmd, req.length);
-        return -1;
-    }
-    if (virStrcpyStatic(req.data, cmd) < 0) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Command %s too long for destination"), cmd);
-        return -1;
-    }
-
-    if (sendto(priv->monitor, &req, sizeof(req), 0,
-               (struct sockaddr *)&addr, sizeof(addr)) != sizeof(req)) {
-        virReportSystemError(errno,
-                             _("cannot send command %s"),
-                             cmd);
-        return -1;
-    }
-
-    do {
-        ssize_t nbytes;
-        addrlen = sizeof(addr);
-        nbytes = recvfrom(priv->monitor, &res, sizeof(res), 0,
-                          (struct sockaddr *)&addr, &addrlen);
-        if (nbytes < 0) {
-            if (errno == EAGAIN || errno == EINTR)
-                continue;
-            virReportSystemError(errno, _("cannot read reply %s"), cmd);
-            goto error;
-        }
-        /* Ensure res.length is safe to read before validating its value.  */
-        if (nbytes < offsetof(struct monitor_request, data) ||
-            nbytes < offsetof(struct monitor_request, data) + res.length) {
-            virReportSystemError(0, _("incomplete reply %s"), cmd);
-            goto error;
-        }
-
-        if (VIR_REALLOC_N(retdata, retlen + res.length) < 0)
-            goto error;
-        memcpy(retdata + retlen, res.data, res.length);
-        retlen += res.length - 1;
-        retdata[retlen] = '\0';
-
-        if (res.error)
-            ret = -1;
-
-    } while (res.extra);
-
-    VIR_DEBUG("Command reply is '%s'", NULLSTR(retdata));
-
-    if (ret < 0)
-        VIR_FREE(retdata);
-    else
-        *reply = retdata;
-
-    return ret;
-
- error:
-    VIR_FREE(retdata);
-    return -1;
-}
-
-
-static void umlCleanupTapDevices(virDomainObjPtr vm)
-{
-    size_t i;
-
-    for (i = 0; i < vm->def->nnets; i++) {
-        virDomainNetDefPtr def = vm->def->nets[i];
-
-        if (def->type != VIR_DOMAIN_NET_TYPE_BRIDGE &&
-            def->type != VIR_DOMAIN_NET_TYPE_NETWORK)
-            continue;
-
-        ignore_value(virNetDevTapDelete(def->ifname,
-                                        def->backend.tap));
-    }
-}
-
-static int umlStartVMDaemon(virConnectPtr conn,
-                            struct uml_driver *driver,
-                            virDomainObjPtr vm,
-                            bool autoDestroy)
-{
-    int ret = -1;
-    char *logfile;
-    int logfd = -1;
-    umlDomainObjPrivatePtr priv = vm->privateData;
-    virCommandPtr cmd = NULL;
-    size_t i;
-
-    if (virDomainObjIsActive(vm)) {
-        virReportError(VIR_ERR_OPERATION_INVALID, "%s",
-                       _("VM is already active"));
-        return -1;
-    }
-
-    if (!vm->def->os.kernel) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("no kernel specified"));
-        return -1;
-    }
-    /* Make sure the binary we are about to try exec'ing exists.
-     * Technically we could catch the exec() failure, but that's
-     * in a sub-process so its hard to feed back a useful error
-     */
-    if (!virFileIsExecutable(vm->def->os.kernel)) {
-        virReportSystemError(errno,
-                             _("Cannot find UML kernel %s"),
-                             vm->def->os.kernel);
-        return -1;
-    }
-
-    if (virFileMakePath(driver->logDir) < 0) {
-        virReportSystemError(errno,
-                             _("cannot create log directory %s"),
-                             driver->logDir);
-        return -1;
-    }
-
-    if (virAsprintf(&logfile, "%s/%s.log",
-                    driver->logDir, vm->def->name) < 0)
-        return -1;
-
-    if ((logfd = open(logfile, O_CREAT | O_TRUNC | O_WRONLY,
-                      S_IRUSR | S_IWUSR)) < 0) {
-        virReportSystemError(errno,
-                             _("failed to create logfile %s"),
-                             logfile);
-        VIR_FREE(logfile);
-        return -1;
-    }
-    VIR_FREE(logfile);
-
-    if (virSetCloseExec(logfd) < 0) {
-        virReportSystemError(errno, "%s",
-                             _("Unable to set VM logfile close-on-exec flag"));
-        VIR_FORCE_CLOSE(logfd);
-        return -1;
-    }
-
-    /* Do this upfront, so any part of the startup process can add
-     * runtime state to vm->def that won't be persisted. This let's us
-     * report implicit runtime defaults in the XML, like vnc listen/socket
-     */
-    VIR_DEBUG("Setting current domain def as transient");
-    if (virDomainObjSetDefTransient(driver->caps, driver->xmlopt, vm) < 0) {
-        VIR_FORCE_CLOSE(logfd);
-        return -1;
-    }
-
-    if (!(cmd = umlBuildCommandLine(conn, driver, vm)))
-        goto cleanup;
-
-    for (i = 0; i < vm->def->nconsoles; i++) {
-        VIR_FREE(vm->def->consoles[i]->info.alias);
-        if (virAsprintf(&vm->def->consoles[i]->info.alias, "console%zu", i) < 0)
-            goto cleanup;
-    }
-
-    virCommandWriteArgLog(cmd, logfd);
-
-    priv->monitor = -1;
-
-    virCommandClearCaps(cmd);
-    virCommandSetOutputFD(cmd, &logfd);
-    virCommandSetErrorFD(cmd, &logfd);
-    virCommandDaemonize(cmd);
-
-    if (virCommandRun(cmd, NULL) < 0)
-        goto cleanup;
-
-    if (autoDestroy &&
-        umlProcessAutoDestroyAdd(driver, vm, conn) < 0)
-        goto cleanup;
-
-    ret = 0;
- cleanup:
-    VIR_FORCE_CLOSE(logfd);
-    virCommandFree(cmd);
-
-    if (ret < 0) {
-        virDomainConfVMNWFilterTeardown(vm);
-        umlCleanupTapDevices(vm);
-        virDomainObjRemoveTransientDef(vm);
-    }
-
-    /* NB we don't mark it running here - we do that async
-       with inotify */
-    /* XXX what if someone else tries to start it again
-       before we get the inotification ? Sounds like
-       trouble.... */
-    /* XXX this is bad for events too. must fix this better */
-
-    return ret;
-}
-
-static void umlShutdownVMDaemon(struct uml_driver *driver,
-                                virDomainObjPtr vm,
-                                virDomainShutoffReason reason)
-{
-    int ret;
-    umlDomainObjPrivatePtr priv = vm->privateData;
-
-    if (!virDomainObjIsActive(vm))
-        return;
-
-    virProcessKill(vm->pid, SIGTERM);
-
-    VIR_FORCE_CLOSE(priv->monitor);
-
-    if ((ret = waitpid(vm->pid, NULL, 0)) != vm->pid) {
-        VIR_WARN("Got unexpected pid %d != %d",
-               ret, vm->pid);
-    }
-
-    vm->pid = -1;
-    vm->def->id = -1;
-    virDomainObjSetState(vm, VIR_DOMAIN_SHUTOFF, reason);
-
-    virDomainConfVMNWFilterTeardown(vm);
-    umlCleanupTapDevices(vm);
-
-    /* Stop autodestroy in case guest is restarted */
-    umlProcessAutoDestroyRemove(driver, vm);
-
-    virDomainObjRemoveTransientDef(vm);
-
-    driver->nactive--;
-    if (!driver->nactive && driver->inhibitCallback)
-        driver->inhibitCallback(false, driver->inhibitOpaque);
-}
-
-
-static int umlConnectURIProbe(char **uri)
-{
-    if (uml_driver == NULL)
-        return 0;
-
-    return VIR_STRDUP(*uri, uml_driver->privileged ?
-                      "uml:///system" :
-                      "uml:///session");
-}
-
-
-static virDrvOpenStatus umlConnectOpen(virConnectPtr conn,
-                                       virConnectAuthPtr auth ATTRIBUTE_UNUSED,
-                                       virConfPtr conf ATTRIBUTE_UNUSED,
-                                       unsigned int flags)
-{
-    virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
-
-    /* URI was good, but driver isn't active */
-    if (uml_driver == NULL) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("uml state driver is not active"));
-        return VIR_DRV_OPEN_ERROR;
-    }
-
-    /* Check path and tell them correct path if they made a mistake */
-    if (uml_driver->privileged) {
-        if (STRNEQ(conn->uri->path, "/system") &&
-            STRNEQ(conn->uri->path, "/session")) {
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("unexpected UML URI path '%s', try uml:///system"),
-                           conn->uri->path);
-            return VIR_DRV_OPEN_ERROR;
-        }
-    } else {
-        if (STRNEQ(conn->uri->path, "/session")) {
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("unexpected UML URI path '%s', try uml:///session"),
-                           conn->uri->path);
-            return VIR_DRV_OPEN_ERROR;
-        }
-    }
-
-    if (virConnectOpenEnsureACL(conn) < 0)
-        return VIR_DRV_OPEN_ERROR;
-
-    conn->privateData = uml_driver;
-
-    return VIR_DRV_OPEN_SUCCESS;
-}
-
-static int umlConnectClose(virConnectPtr conn)
-{
-    struct uml_driver *driver = conn->privateData;
-
-    umlDriverLock(driver);
-    umlProcessAutoDestroyRun(driver, conn);
-    umlDriverUnlock(driver);
-
-    conn->privateData = NULL;
-
-    return 0;
-}
-
-static const char *umlConnectGetType(virConnectPtr conn) {
-    if (virConnectGetTypeEnsureACL(conn) < 0)
-        return NULL;
-
-    return "UML";
-}
-
-
-static int umlConnectIsSecure(virConnectPtr conn ATTRIBUTE_UNUSED)
-{
-    /* Trivially secure, since always inside the daemon */
-    return 1;
-}
-
-
-static int umlConnectIsEncrypted(virConnectPtr conn ATTRIBUTE_UNUSED)
-{
-    /* Not encrypted, but remote driver takes care of that */
-    return 0;
-}
-
-
-static int umlConnectIsAlive(virConnectPtr conn ATTRIBUTE_UNUSED)
-{
-    return 1;
-}
-
-
-static char *umlConnectGetCapabilities(virConnectPtr conn) {
-    struct uml_driver *driver = (struct uml_driver *)conn->privateData;
-    char *xml;
-
-    if (virConnectGetCapabilitiesEnsureACL(conn) < 0)
-        return NULL;
-
-    umlDriverLock(driver);
-    xml = virCapabilitiesFormatXML(driver->caps);
-    umlDriverUnlock(driver);
-
-    return xml;
-}
-
-
-
-static int umlGetProcessInfo(unsigned long long *cpuTime, pid_t pid)
-{
-    char *proc;
-    FILE *pidinfo;
-    unsigned long long usertime, systime;
-
-    if (virAsprintf(&proc, "/proc/%lld/stat", (long long)pid) < 0)
-        return -1;
-
-    if (!(pidinfo = fopen(proc, "r"))) {
-        /* VM probably shut down, so fake 0 */
-        *cpuTime = 0;
-        VIR_FREE(proc);
-        return 0;
-    }
-
-    VIR_FREE(proc);
-
-    if (fscanf(pidinfo, "%*d %*s %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %llu %llu", &usertime, &systime) != 2) {
-        umlDebug("not enough arg");
-        VIR_FORCE_FCLOSE(pidinfo);
-        return -1;
-    }
-
-    /* We got jiffies
-     * We want nanoseconds
-     * _SC_CLK_TCK is jiffies per second
-     * So calculate thus....
-     */
-    *cpuTime = 1000ull * 1000ull * 1000ull * (usertime + systime) / (unsigned long long)sysconf(_SC_CLK_TCK);
-
-    umlDebug("Got %llu %llu %llu", usertime, systime, *cpuTime);
-
-    VIR_FORCE_FCLOSE(pidinfo);
-
-    return 0;
-}
-
-
-static virDomainPtr umlDomainLookupByID(virConnectPtr conn,
-                                          int id)
-{
-    struct uml_driver *driver = (struct uml_driver *)conn->privateData;
-    virDomainObjPtr vm;
-    virDomainPtr dom = NULL;
-
-    umlDriverLock(driver);
-    vm = virDomainObjListFindByID(driver->domains, id);
-    umlDriverUnlock(driver);
-
-    if (!vm) {
-        virReportError(VIR_ERR_NO_DOMAIN,
-                       _("no domain with matching id '%d'"), id);
-        goto cleanup;
-    }
-
-    if (virDomainLookupByIDEnsureACL(conn, vm->def) < 0)
-        goto cleanup;
-
-    dom = virGetDomain(conn, vm->def->name, vm->def->uuid, vm->def->id);
-
- cleanup:
-    virDomainObjEndAPI(&vm);
-    return dom;
-}
-
-static virDomainPtr umlDomainLookupByUUID(virConnectPtr conn,
-                                          const unsigned char *uuid)
-{
-    struct uml_driver *driver = (struct uml_driver *)conn->privateData;
-    virDomainObjPtr vm;
-    virDomainPtr dom = NULL;
-
-    if (!(vm = umlDomObjFromDomain(driver, uuid)))
-        return NULL;
-
-    if (virDomainLookupByUUIDEnsureACL(conn, vm->def) < 0)
-        goto cleanup;
-
-    dom = virGetDomain(conn, vm->def->name, vm->def->uuid, vm->def->id);
-
- cleanup:
-    virDomainObjEndAPI(&vm);
-    return dom;
-}
-
-static virDomainPtr umlDomainLookupByName(virConnectPtr conn,
-                                            const char *name)
-{
-    struct uml_driver *driver = (struct uml_driver *)conn->privateData;
-    virDomainObjPtr vm;
-    virDomainPtr dom = NULL;
-
-    umlDriverLock(driver);
-    vm = virDomainObjListFindByName(driver->domains, name);
-    umlDriverUnlock(driver);
-
-    if (!vm) {
-        virReportError(VIR_ERR_NO_DOMAIN,
-                       _("no domain with matching name '%s'"), name);
-        goto cleanup;
-    }
-
-    if (virDomainLookupByNameEnsureACL(conn, vm->def) < 0)
-        goto cleanup;
-
-    dom = virGetDomain(conn, vm->def->name, vm->def->uuid, vm->def->id);
-
- cleanup:
-    virDomainObjEndAPI(&vm);
-    return dom;
-}
-
-
-static int umlDomainIsActive(virDomainPtr dom)
-{
-    struct uml_driver *driver = dom->conn->privateData;
-    virDomainObjPtr obj;
-    int ret = -1;
-
-    if (!(obj = umlDomObjFromDomain(driver, dom->uuid)))
-        return -1;
-
-    if (virDomainIsActiveEnsureACL(dom->conn, obj->def) < 0)
-        goto cleanup;
-
-    ret = virDomainObjIsActive(obj);
-
- cleanup:
-    virDomainObjEndAPI(&obj);
-    return ret;
-}
-
-
-static int umlDomainIsPersistent(virDomainPtr dom)
-{
-    struct uml_driver *driver = dom->conn->privateData;
-    virDomainObjPtr obj;
-    int ret = -1;
-
-    if (!(obj = umlDomObjFromDomain(driver, dom->uuid)))
-        return -1;
-
-    if (virDomainIsPersistentEnsureACL(dom->conn, obj->def) < 0)
-        goto cleanup;
-
-    ret = obj->persistent;
-
- cleanup:
-    virDomainObjEndAPI(&obj);
-    return ret;
-}
-
-static int umlDomainIsUpdated(virDomainPtr dom)
-{
-    struct uml_driver *driver = dom->conn->privateData;
-    virDomainObjPtr obj;
-    int ret = -1;
-
-    if (!(obj = umlDomObjFromDomain(driver, dom->uuid)))
-        return -1;
-
-    if (virDomainIsUpdatedEnsureACL(dom->conn, obj->def) < 0)
-        goto cleanup;
-
-    ret = obj->updated;
-
- cleanup:
-    virDomainObjEndAPI(&obj);
-    return ret;
-}
-
-static int umlConnectGetVersion(virConnectPtr conn, unsigned long *version)
-{
-    struct uml_driver *driver = conn->privateData;
-    struct utsname ut;
-    int ret = -1;
-
-    if (virConnectGetVersionEnsureACL(conn) < 0)
-        return -1;
-
-    umlDriverLock(driver);
-
-    if (driver->umlVersion == 0) {
-        uname(&ut);
-
-        if (virParseVersionString(ut.release, &driver->umlVersion, true) < 0) {
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("cannot parse version %s"), ut.release);
-            goto cleanup;
-        }
-    }
-
-    *version = driver->umlVersion;
-    ret = 0;
-
- cleanup:
-    umlDriverUnlock(driver);
-    return ret;
-}
-
-
-static char *umlConnectGetHostname(virConnectPtr conn)
-{
-    if (virConnectGetHostnameEnsureACL(conn) < 0)
-        return NULL;
-
-    return virGetHostname();
-}
-
-
-static int umlConnectListDomains(virConnectPtr conn, int *ids, int nids)
-{
-    struct uml_driver *driver = conn->privateData;
-    int n;
-
-    if (virConnectListDomainsEnsureACL(conn) < 0)
-        return -1;
-
-    umlDriverLock(driver);
-    n = virDomainObjListGetActiveIDs(driver->domains, ids, nids,
-                                     virConnectListDomainsCheckACL, conn);
-    umlDriverUnlock(driver);
-
-    return n;
-}
-static int umlConnectNumOfDomains(virConnectPtr conn)
-{
-    struct uml_driver *driver = conn->privateData;
-    int n;
-
-    if (virConnectNumOfDomainsEnsureACL(conn) < 0)
-        return -1;
-
-    umlDriverLock(driver);
-    n = virDomainObjListNumOfDomains(driver->domains, true,
-                                     virConnectNumOfDomainsCheckACL, conn);
-    umlDriverUnlock(driver);
-
-    return n;
-}
-static virDomainPtr umlDomainCreateXML(virConnectPtr conn, const char *xml,
-                                       unsigned int flags)
-{
-    struct uml_driver *driver = conn->privateData;
-    virDomainDefPtr def;
-    virDomainObjPtr vm = NULL;
-    virDomainPtr dom = NULL;
-    virObjectEventPtr event = NULL;
-    unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE;
-
-    virCheckFlags(VIR_DOMAIN_START_AUTODESTROY |
-                  VIR_DOMAIN_START_VALIDATE, NULL);
-
-    if (flags & VIR_DOMAIN_START_VALIDATE)
-        parse_flags |= VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA;
-
-    virNWFilterReadLockFilterUpdates();
-    umlDriverLock(driver);
-    if (!(def = virDomainDefParseString(xml, driver->caps, driver->xmlopt,
-                                        NULL, parse_flags)))
-        goto cleanup;
-
-    if (virDomainCreateXMLEnsureACL(conn, def) < 0)
-        goto cleanup;
-
-    if (!(vm = virDomainObjListAdd(driver->domains, def,
-                                   driver->xmlopt,
-                                   VIR_DOMAIN_OBJ_LIST_ADD_LIVE |
-                                   VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
-                                   NULL)))
-        goto cleanup;
-    def = NULL;
-
-    if (umlStartVMDaemon(conn, driver, vm,
-                         (flags & VIR_DOMAIN_START_AUTODESTROY)) < 0) {
-        virDomainAuditStart(vm, "booted", false);
-        if (!vm->persistent)
-            virDomainObjListRemove(driver->domains, vm);
-        goto cleanup;
-    }
-    virDomainAuditStart(vm, "booted", true);
-    event = virDomainEventLifecycleNewFromObj(vm,
-                                     VIR_DOMAIN_EVENT_STARTED,
-                                     VIR_DOMAIN_EVENT_STARTED_BOOTED);
-
-    dom = virGetDomain(conn, vm->def->name, vm->def->uuid, vm->def->id);
-
- cleanup:
-    virDomainDefFree(def);
-    virDomainObjEndAPI(&vm);
-    virObjectEventStateQueue(driver->domainEventState, event);
-    umlDriverUnlock(driver);
-    virNWFilterUnlockFilterUpdates();
-    return dom;
-}
-
-
-static int umlDomainShutdownFlags(virDomainPtr dom,
-                                  unsigned int flags)
-{
-    struct uml_driver *driver = dom->conn->privateData;
-    virDomainObjPtr vm;
-    char *info = NULL;
-    int ret = -1;
-
-    virCheckFlags(0, -1);
-
-    if (!(vm = umlDomObjFromDomain(driver, dom->uuid)))
-        return -1;
-
-    if (virDomainShutdownFlagsEnsureACL(dom->conn, vm->def, flags) < 0)
-        goto cleanup;
-
-#if 0
-    if (umlMonitorCommand(driver, vm, "system_powerdown", &info) < 0) {
-        virReportError(VIR_ERR_OPERATION_FAILED, "%s",
-                       _("shutdown operation failed"));
-        goto cleanup;
-    }
-    ret = 0;
-#endif
-
- cleanup:
-    VIR_FREE(info);
-    virDomainObjEndAPI(&vm);
-    return ret;
-}
-
-static int
-umlDomainShutdown(virDomainPtr dom)
-{
-    return umlDomainShutdownFlags(dom, 0);
-}
-
-static int
-umlDomainDestroyFlags(virDomainPtr dom,
-                      unsigned int flags)
-{
-    struct uml_driver *driver = dom->conn->privateData;
-    virDomainObjPtr vm;
-    virObjectEventPtr event = NULL;
-    int ret = -1;
-
-    virCheckFlags(0, -1);
-
-    umlDriverLock(driver);
-    if (!(vm = umlDomObjFromDomainLocked(driver, dom->uuid)))
-        return -1;
-
-    if (virDomainDestroyFlagsEnsureACL(dom->conn, vm->def) < 0)
-        goto cleanup;
-
-    umlShutdownVMDaemon(driver, vm, VIR_DOMAIN_SHUTOFF_DESTROYED);
-    virDomainAuditStop(vm, "destroyed");
-    event = virDomainEventLifecycleNewFromObj(vm,
-                                     VIR_DOMAIN_EVENT_STOPPED,
-                                     VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
-    if (!vm->persistent)
-        virDomainObjListRemove(driver->domains, vm);
-    ret = 0;
-
- cleanup:
-    virDomainObjEndAPI(&vm);
-    virObjectEventStateQueue(driver->domainEventState, event);
-    umlDriverUnlock(driver);
-    return ret;
-}
-
-
-static int umlDomainDestroy(virDomainPtr dom)
-{
-    return umlDomainDestroyFlags(dom, 0);
-}
-
-
-static char *umlDomainGetOSType(virDomainPtr dom) {
-    struct uml_driver *driver = dom->conn->privateData;
-    virDomainObjPtr vm;
-    char *type = NULL;
-
-    if (!(vm = umlDomObjFromDomain(driver, dom->uuid)))
-        return NULL;
-
-    if (virDomainGetOSTypeEnsureACL(dom->conn, vm->def) < 0)
-        goto cleanup;
-
-    if (VIR_STRDUP(type, virDomainOSTypeToString(vm->def->os.type)) < 0)
-        goto cleanup;
-
- cleanup:
-    virDomainObjEndAPI(&vm);
-    return type;
-}
-
-/* Returns max memory in kb, 0 if error */
-static unsigned long long
-umlDomainGetMaxMemory(virDomainPtr dom)
-{
-    struct uml_driver *driver = dom->conn->privateData;
-    virDomainObjPtr vm;
-    unsigned long long ret = 0;
-
-    if (!(vm = umlDomObjFromDomain(driver, dom->uuid)))
-        return -1;
-
-    if (virDomainGetMaxMemoryEnsureACL(dom->conn, vm->def) < 0)
-        goto cleanup;
-
-    ret = virDomainDefGetMemoryTotal(vm->def);
-
- cleanup:
-    virDomainObjEndAPI(&vm);
-    return ret;
-}
-
-static int umlDomainSetMaxMemory(virDomainPtr dom, unsigned long newmax)
-{
-    struct uml_driver *driver = dom->conn->privateData;
-    virDomainObjPtr vm;
-    int ret = -1;
-
-    if (!(vm = umlDomObjFromDomain(driver, dom->uuid)))
-        return -1;
-
-    if (virDomainSetMaxMemoryEnsureACL(dom->conn, vm->def) < 0)
-        goto cleanup;
-
-    if (newmax < vm->def->mem.cur_balloon) {
-        virReportError(VIR_ERR_INVALID_ARG, "%s",
-                       _("cannot set max memory lower than current memory"));
-        goto cleanup;
-    }
-
-    virDomainDefSetMemoryTotal(vm->def, newmax);
-    ret = 0;
-
- cleanup:
-    virDomainObjEndAPI(&vm);
-    return ret;
-}
-
-static int umlDomainSetMemory(virDomainPtr dom, unsigned long newmem)
-{
-    struct uml_driver *driver = dom->conn->privateData;
-    virDomainObjPtr vm;
-    int ret = -1;
-
-    if (!(vm = umlDomObjFromDomain(driver, dom->uuid)))
-        return -1;
-
-    if (virDomainSetMemoryEnsureACL(dom->conn, vm->def) < 0)
-        goto cleanup;
-
-    if (virDomainObjIsActive(vm)) {
-        virReportError(VIR_ERR_OPERATION_INVALID, "%s",
-                       _("cannot set memory of an active domain"));
-        goto cleanup;
-    }
-
-    if (newmem > virDomainDefGetMemoryTotal(vm->def)) {
-        virReportError(VIR_ERR_INVALID_ARG, "%s",
-                       _("cannot set memory higher than max memory"));
-        goto cleanup;
-    }
-
-    vm->def->mem.cur_balloon = newmem;
-    ret = 0;
-
- cleanup:
-    virDomainObjEndAPI(&vm);
-    return ret;
-}
-
-static int umlDomainGetInfo(virDomainPtr dom,
-                              virDomainInfoPtr info)
-{
-    struct uml_driver *driver = dom->conn->privateData;
-    virDomainObjPtr vm;
-    int ret = -1;
-
-    if (!(vm = umlDomObjFromDomain(driver, dom->uuid)))
-        return -1;
-
-    if (virDomainGetInfoEnsureACL(dom->conn, vm->def) < 0)
-        goto cleanup;
-
-    info->state = virDomainObjGetState(vm, NULL);
-
-    if (!virDomainObjIsActive(vm)) {
-        info->cpuTime = 0;
-    } else {
-        if (umlGetProcessInfo(&(info->cpuTime), vm->pid) < 0) {
-            virReportError(VIR_ERR_OPERATION_FAILED, "%s",
-                           _("cannot read cputime for domain"));
-            goto cleanup;
-        }
-    }
-
-    info->maxMem = virDomainDefGetMemoryTotal(vm->def);
-    info->memory = vm->def->mem.cur_balloon;
-    info->nrVirtCpu = virDomainDefGetVcpus(vm->def);
-    ret = 0;
-
- cleanup:
-    virDomainObjEndAPI(&vm);
-    return ret;
-}
-
-
-static int
-umlDomainGetState(virDomainPtr dom,
-                  int *state,
-                  int *reason,
-                  unsigned int flags)
-{
-    struct uml_driver *driver = dom->conn->privateData;
-    virDomainObjPtr vm;
-    int ret = -1;
-
-    virCheckFlags(0, -1);
-
-    if (!(vm = umlDomObjFromDomain(driver, dom->uuid)))
-        return -1;
-
-    if (virDomainGetStateEnsureACL(dom->conn, vm->def) < 0)
-        goto cleanup;
-
-    *state = virDomainObjGetState(vm, reason);
-    ret = 0;
-
- cleanup:
-    virDomainObjEndAPI(&vm);
-    return ret;
-}
-
-
-static char *umlDomainGetXMLDesc(virDomainPtr dom,
-                                 unsigned int flags)
-{
-    struct uml_driver *driver = dom->conn->privateData;
-    virDomainObjPtr vm;
-    char *ret = NULL;
-
-    /* Flags checked by virDomainDefFormat */
-
-    umlDriverLock(driver);
-    if (!(vm = umlDomObjFromDomainLocked(driver, dom->uuid)))
-        goto cleanup;
-
-    if (virDomainGetXMLDescEnsureACL(dom->conn, vm->def, flags) < 0)
-        goto cleanup;
-
-    ret = virDomainDefFormat((flags & VIR_DOMAIN_XML_INACTIVE) && vm->newDef ?
-                             vm->newDef : vm->def, driver->caps,
-                             virDomainDefFormatConvertXMLFlags(flags));
-
- cleanup:
-    virDomainObjEndAPI(&vm);
-    return ret;
-}
-
-
-static int umlConnectListDefinedDomains(virConnectPtr conn,
-                                        char **const names, int nnames) {
-    struct uml_driver *driver = conn->privateData;
-    int n;
-
-    if (virConnectListDefinedDomainsEnsureACL(conn) < 0)
-        return -1;
-
-    umlDriverLock(driver);
-    n = virDomainObjListGetInactiveNames(driver->domains, names, nnames,
-                                         virConnectListDefinedDomainsCheckACL, conn);
-    umlDriverUnlock(driver);
-
-    return n;
-}
-
-static int umlConnectNumOfDefinedDomains(virConnectPtr conn)
-{
-    struct uml_driver *driver = conn->privateData;
-    int n;
-
-    if (virConnectNumOfDefinedDomainsEnsureACL(conn) < 0)
-        return -1;
-
-    umlDriverLock(driver);
-    n = virDomainObjListNumOfDomains(driver->domains, false,
-                                     virConnectNumOfDefinedDomainsCheckACL, conn);
-    umlDriverUnlock(driver);
-
-    return n;
-}
-
-
-static int umlDomainCreateWithFlags(virDomainPtr dom, unsigned int flags)
-{
-    struct uml_driver *driver = dom->conn->privateData;
-    virDomainObjPtr vm;
-    virObjectEventPtr event = NULL;
-    int ret = -1;
-
-    virCheckFlags(VIR_DOMAIN_START_AUTODESTROY, -1);
-
-    virNWFilterReadLockFilterUpdates();
-    umlDriverLock(driver);
-    if (!(vm = umlDomObjFromDomainLocked(driver, dom->uuid)))
-        goto cleanup;
-
-    if (virDomainCreateWithFlagsEnsureACL(dom->conn, vm->def) < 0)
-        goto cleanup;
-
-    ret = umlStartVMDaemon(dom->conn, driver, vm,
-                           (flags & VIR_DOMAIN_START_AUTODESTROY));
-    virDomainAuditStart(vm, "booted", ret >= 0);
-    if (ret == 0)
-        event = virDomainEventLifecycleNewFromObj(vm,
-                                         VIR_DOMAIN_EVENT_STARTED,
-                                         VIR_DOMAIN_EVENT_STARTED_BOOTED);
-
- cleanup:
-    virDomainObjEndAPI(&vm);
-    virObjectEventStateQueue(driver->domainEventState, event);
-    umlDriverUnlock(driver);
-    virNWFilterUnlockFilterUpdates();
-    return ret;
-}
-
-static int umlDomainCreate(virDomainPtr dom)
-{
-    return umlDomainCreateWithFlags(dom, 0);
-}
-
-static virDomainPtr
-umlDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags)
-{
-    struct uml_driver *driver = conn->privateData;
-    virDomainDefPtr def;
-    virDomainObjPtr vm = NULL;
-    virDomainPtr dom = NULL;
-    unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE;
-
-    virCheckFlags(VIR_DOMAIN_DEFINE_VALIDATE, NULL);
-
-    if (flags & VIR_DOMAIN_DEFINE_VALIDATE)
-        parse_flags |= VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA;
-
-    umlDriverLock(driver);
-    if (!(def = virDomainDefParseString(xml, driver->caps, driver->xmlopt,
-                                        NULL, parse_flags)))
-        goto cleanup;
-
-    if (virXMLCheckIllegalChars("name", def->name, "\n") < 0)
-        goto cleanup;
-
-    if (virDomainDefineXMLFlagsEnsureACL(conn, def) < 0)
-        goto cleanup;
-
-    if (!(vm = virDomainObjListAdd(driver->domains, def,
-                                   driver->xmlopt,
-                                   0, NULL)))
-        goto cleanup;
-    def = NULL;
-    vm->persistent = 1;
-
-    if (virDomainSaveConfig(driver->configDir, driver->caps,
-                            vm->newDef ? vm->newDef : vm->def) < 0) {
-        virDomainObjListRemove(driver->domains, vm);
-        goto cleanup;
-    }
-
-    dom = virGetDomain(conn, vm->def->name, vm->def->uuid, vm->def->id);
-
- cleanup:
-    virDomainDefFree(def);
-    virDomainObjEndAPI(&vm);
-    umlDriverUnlock(driver);
-    return dom;
-}
-
-static virDomainPtr
-umlDomainDefineXML(virConnectPtr conn, const char *xml)
-{
-    return umlDomainDefineXMLFlags(conn, xml, 0);
-}
-
-static int umlDomainUndefineFlags(virDomainPtr dom,
-                                  unsigned int flags)
-{
-    struct uml_driver *driver = dom->conn->privateData;
-    virDomainObjPtr vm;
-    int ret = -1;
-
-    virCheckFlags(0, -1);
-
-    umlDriverLock(driver);
-    if (!(vm = umlDomObjFromDomainLocked(driver, dom->uuid)))
-        goto cleanup;
-
-    if (virDomainUndefineFlagsEnsureACL(dom->conn, vm->def) < 0)
-        goto cleanup;
-
-    if (!vm->persistent) {
-        virReportError(VIR_ERR_OPERATION_INVALID, "%s",
-                       _("cannot undefine transient domain"));
-        goto cleanup;
-    }
-
-    if (virDomainDeleteConfig(driver->configDir, driver->autostartDir, vm) < 0)
-        goto cleanup;
-
-    if (virDomainObjIsActive(vm))
-        vm->persistent = 0;
-    else
-        virDomainObjListRemove(driver->domains, vm);
-
-    ret = 0;
-
- cleanup:
-    virDomainObjEndAPI(&vm);
-    umlDriverUnlock(driver);
-    return ret;
-}
-
-
-static int umlDomainUndefine(virDomainPtr dom)
-{
-    return umlDomainUndefineFlags(dom, 0);
-}
-
-static int umlDomainAttachUmlDisk(struct uml_driver *driver,
-                                  virDomainObjPtr vm,
-                                  virDomainDiskDefPtr disk)
-{
-    size_t i;
-    char *cmd = NULL;
-    char *reply = NULL;
-
-    for (i = 0; i < vm->def->ndisks; i++) {
-        if (STREQ(vm->def->disks[i]->dst, disk->dst)) {
-            virReportError(VIR_ERR_OPERATION_FAILED,
-                           _("target %s already exists"), disk->dst);
-            return -1;
-        }
-    }
-
-    if (!virDomainDiskGetSource(disk)) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       "%s", _("disk source path is missing"));
-        goto error;
-    }
-
-    if (virAsprintf(&cmd, "config %s=%s", disk->dst,
-                    virDomainDiskGetSource(disk)) < 0)
-        return -1;
-
-    if (umlMonitorCommand(driver, vm, cmd, &reply) < 0)
-        goto error;
-
-    if (VIR_REALLOC_N(vm->def->disks, vm->def->ndisks+1) < 0)
-        goto error;
-
-    virDomainDiskInsertPreAlloced(vm->def, disk);
-
-    VIR_FREE(reply);
-    VIR_FREE(cmd);
-
-    return 0;
-
- error:
-
-    VIR_FREE(reply);
-    VIR_FREE(cmd);
-
-    return -1;
-}
-
-
-static int umlDomainAttachDevice(virDomainPtr dom, const char *xml)
-{
-    struct uml_driver *driver = dom->conn->privateData;
-    virDomainObjPtr vm;
-    virDomainDeviceDefPtr dev = NULL;
-    int ret = -1;
-
-    umlDriverLock(driver);
-
-    if (!(vm = umlDomObjFromDomainLocked(driver, dom->uuid)))
-        goto cleanup;
-
-    if (virDomainAttachDeviceEnsureACL(dom->conn, vm->def) < 0)
-        goto cleanup;
-
-    if (!virDomainObjIsActive(vm)) {
-        virReportError(VIR_ERR_OPERATION_INVALID,
-                       "%s", _("cannot attach device on inactive domain"));
-        goto cleanup;
-    }
-
-    dev = virDomainDeviceDefParse(xml, vm->def, driver->caps, driver->xmlopt,
-                                  VIR_DOMAIN_DEF_PARSE_INACTIVE);
-
-    if (dev == NULL)
-        goto cleanup;
-
-    if (dev->type == VIR_DOMAIN_DEVICE_DISK) {
-        if (dev->data.disk->bus == VIR_DOMAIN_DISK_BUS_UML) {
-            ret = umlDomainAttachUmlDisk(driver, vm, dev->data.disk);
-            if (ret == 0)
-                dev->data.disk = NULL;
-        } else {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                           _("disk bus '%s' cannot be hotplugged."),
-                           virDomainDiskBusTypeToString(dev->data.disk->bus));
-        }
-    } else {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("device type '%s' cannot be attached"),
-                       virDomainDeviceTypeToString(dev->type));
-        goto cleanup;
-    }
-
- cleanup:
-
-    virDomainDeviceDefFree(dev);
-    virDomainObjEndAPI(&vm);
-    umlDriverUnlock(driver);
-    return ret;
-}
-
-
-static int
-umlDomainAttachDeviceFlags(virDomainPtr dom,
-                           const char *xml,
-                           unsigned int flags)
-{
-    virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1);
-
-    if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
-        virReportError(VIR_ERR_OPERATION_INVALID,
-                       "%s", _("cannot modify the persistent configuration of a domain"));
-        return -1;
-    }
-
-    return umlDomainAttachDevice(dom, xml);
-}
-
-
-static int umlDomainDetachUmlDisk(struct uml_driver *driver,
-                                  virDomainObjPtr vm,
-                                  virDomainDeviceDefPtr dev)
-{
-    size_t i;
-    int ret = -1;
-    virDomainDiskDefPtr detach = NULL;
-    char *cmd;
-    char *reply;
-
-    for (i = 0; i < vm->def->ndisks; i++) {
-        if (STREQ(vm->def->disks[i]->dst, dev->data.disk->dst))
-            break;
-    }
-
-    if (i == vm->def->ndisks) {
-        virReportError(VIR_ERR_OPERATION_FAILED,
-                       _("disk %s not found"), dev->data.disk->dst);
-        return -1;
-    }
-
-    detach = vm->def->disks[i];
-
-    if (virAsprintf(&cmd, "remove %s", detach->dst) < 0)
-        return -1;
-
-    if (umlMonitorCommand(driver, vm, cmd, &reply) < 0)
-        goto cleanup;
-
-    virDomainDiskRemove(vm->def, i);
-
-    virDomainDiskDefFree(detach);
-
-    ret = 0;
-
-    VIR_FREE(reply);
-
- cleanup:
-    VIR_FREE(cmd);
-
-    return ret;
-}
-
-
-static int umlDomainDetachDevice(virDomainPtr dom, const char *xml)
-{
-    struct uml_driver *driver = dom->conn->privateData;
-    virDomainObjPtr vm;
-    virDomainDeviceDefPtr dev = NULL;
-    int ret = -1;
-
-    umlDriverLock(driver);
-    if (!(vm = umlDomObjFromDomainLocked(driver, dom->uuid)))
-        goto cleanup;
-
-    if (virDomainDetachDeviceEnsureACL(dom->conn, vm->def) < 0)
-        goto cleanup;
-
-    if (!virDomainObjIsActive(vm)) {
-        virReportError(VIR_ERR_OPERATION_INVALID,
-                       "%s", _("cannot detach device on inactive domain"));
-        goto cleanup;
-    }
-
-    dev = virDomainDeviceDefParse(xml, vm->def, driver->caps, driver->xmlopt,
-                                  VIR_DOMAIN_DEF_PARSE_INACTIVE |
-                                  VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);
-    if (dev == NULL)
-        goto cleanup;
-
-    if (dev->type == VIR_DOMAIN_DEVICE_DISK &&
-        dev->data.disk->device == VIR_DOMAIN_DISK_DEVICE_DISK) {
-        if (dev->data.disk->bus == VIR_DOMAIN_DISK_BUS_UML)
-            ret = umlDomainDetachUmlDisk(driver, vm, dev);
-        else
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                           _("This type of disk cannot be hot unplugged"));
-    } else {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       "%s", _("This type of device cannot be hot unplugged"));
-    }
-
- cleanup:
-    virDomainDeviceDefFree(dev);
-    virDomainObjEndAPI(&vm);
-    umlDriverUnlock(driver);
-    return ret;
-}
-
-
-static int
-umlDomainDetachDeviceFlags(virDomainPtr dom,
-                           const char *xml,
-                           unsigned int flags)
-{
-    virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1);
-
-    if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
-        virReportError(VIR_ERR_OPERATION_INVALID,
-                       "%s", _("cannot modify the persistent configuration of a domain"));
-        return -1;
-    }
-
-    return umlDomainDetachDevice(dom, xml);
-}
-
-
-static int umlDomainGetAutostart(virDomainPtr dom,
-                            int *autostart)
-{
-    struct uml_driver *driver = dom->conn->privateData;
-    virDomainObjPtr vm;
-    int ret = -1;
-
-    umlDriverLock(driver);
-    if (!(vm = umlDomObjFromDomainLocked(driver, dom->uuid)))
-        goto cleanup;
-
-    if (virDomainGetAutostartEnsureACL(dom->conn, vm->def) < 0)
-        goto cleanup;
-
-    *autostart = vm->autostart;
-    ret = 0;
-
- cleanup:
-    virDomainObjEndAPI(&vm);
-    umlDriverUnlock(driver);
-    return ret;
-}
-
-static int umlDomainSetAutostart(virDomainPtr dom,
-                                   int autostart)
-{
-    struct uml_driver *driver = dom->conn->privateData;
-    virDomainObjPtr vm;
-    char *configFile = NULL, *autostartLink = NULL;
-    int ret = -1;
-
-    umlDriverLock(driver);
-    if (!(vm = umlDomObjFromDomainLocked(driver, dom->uuid)))
-        goto cleanup;
-
-    if (virDomainSetAutostartEnsureACL(dom->conn, vm->def) < 0)
-        goto cleanup;
-
-    if (!vm->persistent) {
-        virReportError(VIR_ERR_OPERATION_INVALID, "%s",
-                       _("cannot set autostart for transient domain"));
-        goto cleanup;
-    }
-
-    autostart = (autostart != 0);
-
-    if (vm->autostart != autostart) {
-        if ((configFile = virDomainConfigFile(driver->configDir, vm->def->name)) == NULL)
-            goto cleanup;
-        if ((autostartLink = virDomainConfigFile(driver->autostartDir, vm->def->name)) == NULL)
-            goto cleanup;
-
-        if (autostart) {
-            if (virFileMakePath(driver->autostartDir) < 0) {
-                virReportSystemError(errno,
-                                     _("cannot create autostart directory %s"),
-                                     driver->autostartDir);
-                goto cleanup;
-            }
-
-            if (symlink(configFile, autostartLink) < 0) {
-                virReportSystemError(errno,
-                                     _("Failed to create symlink '%s to '%s'"),
-                                     autostartLink, configFile);
-                goto cleanup;
-            }
-        } else {
-            if (unlink(autostartLink) < 0 && errno != ENOENT && errno != ENOTDIR) {
-                virReportSystemError(errno,
-                                     _("Failed to delete symlink '%s'"),
-                                     autostartLink);
-                goto cleanup;
-            }
-        }
-
-        vm->autostart = autostart;
-    }
-    ret = 0;
-
- cleanup:
-    VIR_FREE(configFile);
-    VIR_FREE(autostartLink);
-    virDomainObjEndAPI(&vm);
-    umlDriverUnlock(driver);
-    return ret;
-}
-
-
-static int
-umlDomainBlockPeek(virDomainPtr dom,
-                   const char *path,
-                   unsigned long long offset, size_t size,
-                   void *buffer,
-                   unsigned int flags)
-{
-    struct uml_driver *driver = dom->conn->privateData;
-    virDomainObjPtr vm;
-    int fd = -1, ret = -1;
-    const char *actual;
-
-    virCheckFlags(0, -1);
-
-    if (!(vm = umlDomObjFromDomain(driver, dom->uuid)))
-        return -1;
-
-    if (virDomainBlockPeekEnsureACL(dom->conn, vm->def) < 0)
-        goto cleanup;
-
-    if (!path || path[0] == '\0') {
-        virReportError(VIR_ERR_INVALID_ARG, "%s",
-                       _("NULL or empty path"));
-        goto cleanup;
-    }
-
-    /* Check the path belongs to this domain. */
-    if (!(actual = virDomainDiskPathByName(vm->def, path))) {
-        virReportError(VIR_ERR_INVALID_ARG,
-                       _("invalid path '%s'"), path);
-        goto cleanup;
-    }
-    path = actual;
-
-    /* The path is correct, now try to open it and get its size. */
-    fd = open(path, O_RDONLY);
-    if (fd == -1) {
-        virReportSystemError(errno,
-                             _("cannot open %s"), path);
-        goto cleanup;
-    }
-
-    /* Seek and read. */
-    /* NB. Because we configure with AC_SYS_LARGEFILE, off_t should
-     * be 64 bits on all platforms.
-     */
-    if (lseek(fd, offset, SEEK_SET) == (off_t)-1 ||
-        saferead(fd, buffer, size) == (ssize_t)-1) {
-        virReportSystemError(errno,
-                             _("cannot read %s"), path);
-        goto cleanup;
-    }
-
-    ret = 0;
-
- cleanup:
-    VIR_FORCE_CLOSE(fd);
-    virDomainObjEndAPI(&vm);
-    return ret;
-}
-
-
-static int
-umlDomainOpenConsole(virDomainPtr dom,
-                     const char *dev_name,
-                     virStreamPtr st,
-                     unsigned int flags)
-{
-    struct uml_driver *driver = dom->conn->privateData;
-    virDomainObjPtr vm = NULL;
-    int ret = -1;
-    virDomainChrDefPtr chr = NULL;
-    size_t i;
-
-    virCheckFlags(0, -1);
-
-    umlDriverLock(driver);
-    if (!(vm = umlDomObjFromDomainLocked(driver, dom->uuid)))
-        goto cleanup;
-
-    if (virDomainOpenConsoleEnsureACL(dom->conn, vm->def) < 0)
-        goto cleanup;
-
-    if (virDomainObjCheckActive(vm) < 0)
-        goto cleanup;
-
-    if (dev_name) {
-        for (i = 0; i < vm->def->nconsoles; i++) {
-            if (vm->def->consoles[i]->info.alias &&
-                STREQ(vm->def->consoles[i]->info.alias, dev_name)) {
-                chr = vm->def->consoles[i];
-                break;
-            }
-        }
-    } else {
-        if (vm->def->nconsoles)
-            chr = vm->def->consoles[0];
-        else if (vm->def->nserials)
-            chr = vm->def->serials[0];
-    }
-
-    if (!chr) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("cannot find console device '%s'"),
-                       dev_name ? dev_name : _("default"));
-        goto cleanup;
-    }
-
-    if (chr->source->type != VIR_DOMAIN_CHR_TYPE_PTY) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("character device %s is not using a PTY"),
-                       dev_name ? dev_name : NULLSTR(chr->info.alias));
-        goto cleanup;
-    }
-
-    if (virFDStreamOpenFile(st, chr->source->data.file.path,
-                            0, 0, O_RDWR) < 0)
-        goto cleanup;
-
-    ret = 0;
- cleanup:
-    virDomainObjEndAPI(&vm);
-    umlDriverUnlock(driver);
-    return ret;
-}
-
-
-static int
-umlConnectDomainEventRegister(virConnectPtr conn,
-                              virConnectDomainEventCallback callback,
-                              void *opaque,
-                              virFreeCallback freecb)
-{
-    struct uml_driver *driver = conn->privateData;
-    int ret = 0;
-
-    if (virConnectDomainEventRegisterEnsureACL(conn) < 0)
-        return -1;
-
-    umlDriverLock(driver);
-    if (virDomainEventStateRegister(conn,
-                                    driver->domainEventState,
-                                    callback, opaque, freecb) < 0)
-        ret = -1;
-    umlDriverUnlock(driver);
-
-    return ret;
-}
-
-static int
-umlConnectDomainEventDeregister(virConnectPtr conn,
-                                virConnectDomainEventCallback callback)
-{
-    struct uml_driver *driver = conn->privateData;
-    int ret = 0;
-
-    if (virConnectDomainEventDeregisterEnsureACL(conn) < 0)
-        return -1;
-
-    umlDriverLock(driver);
-    if (virDomainEventStateDeregister(conn,
-                                      driver->domainEventState,
-                                      callback) < 0)
-        ret = -1;
-    umlDriverUnlock(driver);
-
-    return ret;
-}
-
-static int
-umlConnectDomainEventRegisterAny(virConnectPtr conn,
-                                 virDomainPtr dom,
-                                 int eventID,
-                                 virConnectDomainEventGenericCallback callback,
-                                 void *opaque,
-                                 virFreeCallback freecb)
-{
-    struct uml_driver *driver = conn->privateData;
-    int ret;
-
-    if (virConnectDomainEventRegisterAnyEnsureACL(conn) < 0)
-        return -1;
-
-    umlDriverLock(driver);
-    if (virDomainEventStateRegisterID(conn,
-                                      driver->domainEventState,
-                                      dom, eventID,
-                                      callback, opaque, freecb, &ret) < 0)
-        ret = -1;
-    umlDriverUnlock(driver);
-
-    return ret;
-}
-
-
-static int
-umlConnectDomainEventDeregisterAny(virConnectPtr conn,
-                                   int callbackID)
-{
-    struct uml_driver *driver = conn->privateData;
-    int ret = 0;
-
-    if (virConnectDomainEventDeregisterAnyEnsureACL(conn) < 0)
-        return -1;
-
-    umlDriverLock(driver);
-    if (virObjectEventStateDeregisterID(conn,
-                                        driver->domainEventState,
-                                        callbackID, true) < 0)
-        ret = -1;
-    umlDriverUnlock(driver);
-
-    return ret;
-}
-
-
-static int umlConnectListAllDomains(virConnectPtr conn,
-                                    virDomainPtr **domains,
-                                    unsigned int flags)
-{
-    struct uml_driver *driver = conn->privateData;
-    int ret = -1;
-
-    virCheckFlags(VIR_CONNECT_LIST_DOMAINS_FILTERS_ALL, -1);
-
-    if (virConnectListAllDomainsEnsureACL(conn) < 0)
-        return -1;
-
-    umlDriverLock(driver);
-    ret = virDomainObjListExport(driver->domains, conn, domains,
-                                 virConnectListAllDomainsCheckACL, flags);
-    umlDriverUnlock(driver);
-
-    return ret;
-}
-
-
-static int
-umlNodeGetInfo(virConnectPtr conn,
-               virNodeInfoPtr nodeinfo)
-{
-    if (virNodeGetInfoEnsureACL(conn) < 0)
-        return -1;
-
-    return virCapabilitiesGetNodeInfo(nodeinfo);
-}
-
-
-static int
-umlNodeGetCPUStats(virConnectPtr conn,
-                   int cpuNum,
-                   virNodeCPUStatsPtr params,
-                   int *nparams,
-                   unsigned int flags)
-{
-    if (virNodeGetCPUStatsEnsureACL(conn) < 0)
-        return -1;
-
-    return virHostCPUGetStats(cpuNum, params, nparams, flags);
-}
-
-
-static int
-umlNodeGetMemoryStats(virConnectPtr conn,
-                      int cellNum,
-                      virNodeMemoryStatsPtr params,
-                      int *nparams,
-                      unsigned int flags)
-{
-    if (virNodeGetMemoryStatsEnsureACL(conn) < 0)
-        return -1;
-
-    return virHostMemGetStats(cellNum, params, nparams, flags);
-}
-
-
-static int
-umlNodeGetCellsFreeMemory(virConnectPtr conn,
-                          unsigned long long *freeMems,
-                          int startCell,
-                          int maxCells)
-{
-    if (virNodeGetCellsFreeMemoryEnsureACL(conn) < 0)
-        return -1;
-
-    return virHostMemGetCellsFree(freeMems, startCell, maxCells);
-}
-
-
-static unsigned long long
-umlNodeGetFreeMemory(virConnectPtr conn)
-{
-    unsigned long long freeMem;
-
-    if (virNodeGetFreeMemoryEnsureACL(conn) < 0)
-        return 0;
-
-    if (virHostMemGetInfo(NULL, &freeMem) < 0)
-        return 0;
-
-    return freeMem;
-}
-
-
-static int
-umlNodeGetMemoryParameters(virConnectPtr conn,
-                           virTypedParameterPtr params,
-                           int *nparams,
-                           unsigned int flags)
-{
-    if (virNodeGetMemoryParametersEnsureACL(conn) < 0)
-        return -1;
-
-    return virHostMemGetParameters(params, nparams, flags);
-}
-
-
-static int
-umlNodeSetMemoryParameters(virConnectPtr conn,
-                           virTypedParameterPtr params,
-                           int nparams,
-                           unsigned int flags)
-{
-    if (virNodeSetMemoryParametersEnsureACL(conn) < 0)
-        return -1;
-
-    return virHostMemSetParameters(params, nparams, flags);
-}
-
-
-static int
-umlNodeGetCPUMap(virConnectPtr conn,
-                 unsigned char **cpumap,
-                 unsigned int *online,
-                 unsigned int flags)
-{
-    if (virNodeGetCPUMapEnsureACL(conn) < 0)
-        return -1;
-
-    return virHostCPUGetMap(cpumap, online, flags);
-}
-
-
-static int
-umlNodeSuspendForDuration(virConnectPtr conn,
-                          unsigned int target,
-                          unsigned long long duration,
-                          unsigned int flags)
-{
-    if (virNodeSuspendForDurationEnsureACL(conn) < 0)
-        return -1;
-
-    return virNodeSuspend(target, duration, flags);
-}
-
-
-static int
-umlNodeGetFreePages(virConnectPtr conn,
-                    unsigned int npages,
-                    unsigned int *pages,
-                    int startCell,
-                    unsigned int cellCount,
-                    unsigned long long *counts,
-                    unsigned int flags)
-{
-    virCheckFlags(0, -1);
-
-    if (virNodeGetFreePagesEnsureACL(conn) < 0)
-        return -1;
-
-    return virHostMemGetFreePages(npages, pages, startCell, cellCount, counts);
-}
-
-
-static int
-umlNodeAllocPages(virConnectPtr conn,
-                  unsigned int npages,
-                  unsigned int *pageSizes,
-                  unsigned long long *pageCounts,
-                  int startCell,
-                  unsigned int cellCount,
-                  unsigned int flags)
-{
-    bool add = !(flags & VIR_NODE_ALLOC_PAGES_SET);
-
-    virCheckFlags(VIR_NODE_ALLOC_PAGES_SET, -1);
-
-    if (virNodeAllocPagesEnsureACL(conn) < 0)
-        return -1;
-
-    return virHostMemAllocPages(npages, pageSizes, pageCounts,
-                                startCell, cellCount, add);
-}
-
-
-static int
-umlDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags)
-{
-    struct uml_driver *driver = dom->conn->privateData;
-    int ret = -1;
-    virDomainObjPtr vm;
-
-    virCheckFlags(0, -1);
-
-    if (!(vm = umlDomObjFromDomain(driver, dom->uuid)))
-        return -1;
-
-    if (virDomainHasManagedSaveImageEnsureACL(dom->conn, vm->def) < 0)
-        goto cleanup;
-
-    ret = 0;
-
- cleanup:
-    virDomainObjEndAPI(&vm);
-    return ret;
-}
-
-
-static virHypervisorDriver umlHypervisorDriver = {
-    .name = "UML",
-    .connectURIProbe = umlConnectURIProbe,
-    .connectOpen = umlConnectOpen, /* 0.5.0 */
-    .connectClose = umlConnectClose, /* 0.5.0 */
-    .connectGetType = umlConnectGetType, /* 0.5.0 */
-    .connectGetVersion = umlConnectGetVersion, /* 0.5.0 */
-    .connectGetHostname = umlConnectGetHostname, /* 0.5.0 */
-    .nodeGetInfo = umlNodeGetInfo, /* 0.5.0 */
-    .connectGetCapabilities = umlConnectGetCapabilities, /* 0.5.0 */
-    .connectListDomains = umlConnectListDomains, /* 0.5.0 */
-    .connectNumOfDomains = umlConnectNumOfDomains, /* 0.5.0 */
-    .connectListAllDomains = umlConnectListAllDomains, /* 0.9.13 */
-    .domainCreateXML = umlDomainCreateXML, /* 0.5.0 */
-    .domainLookupByID = umlDomainLookupByID, /* 0.5.0 */
-    .domainLookupByUUID = umlDomainLookupByUUID, /* 0.5.0 */
-    .domainLookupByName = umlDomainLookupByName, /* 0.5.0 */
-    .domainShutdown = umlDomainShutdown, /* 0.5.0 */
-    .domainShutdownFlags = umlDomainShutdownFlags, /* 0.9.10 */
-    .domainDestroy = umlDomainDestroy, /* 0.5.0 */
-    .domainDestroyFlags = umlDomainDestroyFlags, /* 0.9.4 */
-    .domainGetOSType = umlDomainGetOSType, /* 0.5.0 */
-    .domainGetMaxMemory = umlDomainGetMaxMemory, /* 0.5.0 */
-    .domainSetMaxMemory = umlDomainSetMaxMemory, /* 0.5.0 */
-    .domainSetMemory = umlDomainSetMemory, /* 0.5.0 */
-    .domainGetInfo = umlDomainGetInfo, /* 0.5.0 */
-    .domainGetState = umlDomainGetState, /* 0.9.2 */
-    .domainGetXMLDesc = umlDomainGetXMLDesc, /* 0.5.0 */
-    .connectListDefinedDomains = umlConnectListDefinedDomains, /* 0.5.0 */
-    .connectNumOfDefinedDomains = umlConnectNumOfDefinedDomains, /* 0.5.0 */
-    .domainCreate = umlDomainCreate, /* 0.5.0 */
-    .domainCreateWithFlags = umlDomainCreateWithFlags, /* 0.8.2 */
-    .domainDefineXML = umlDomainDefineXML, /* 0.5.0 */
-    .domainDefineXMLFlags = umlDomainDefineXMLFlags, /* 1.2.12 */
-    .domainUndefine = umlDomainUndefine, /* 0.5.0 */
-    .domainUndefineFlags = umlDomainUndefineFlags, /* 0.9.4 */
-    .domainAttachDevice = umlDomainAttachDevice, /* 0.8.4 */
-    .domainAttachDeviceFlags = umlDomainAttachDeviceFlags, /* 0.8.4 */
-    .domainDetachDevice = umlDomainDetachDevice, /* 0.8.4 */
-    .domainDetachDeviceFlags = umlDomainDetachDeviceFlags, /* 0.8.4 */
-    .domainGetAutostart = umlDomainGetAutostart, /* 0.5.0 */
-    .domainSetAutostart = umlDomainSetAutostart, /* 0.5.0 */
-    .domainBlockPeek = umlDomainBlockPeek, /* 0.5.0 */
-    .nodeGetCPUStats = umlNodeGetCPUStats, /* 0.9.3 */
-    .nodeGetMemoryStats = umlNodeGetMemoryStats, /* 0.9.3 */
-    .nodeGetCellsFreeMemory = umlNodeGetCellsFreeMemory, /* 0.5.0 */
-    .nodeGetFreeMemory = umlNodeGetFreeMemory, /* 0.5.0 */
-    .nodeGetCPUMap = umlNodeGetCPUMap, /* 1.0.0 */
-    .connectDomainEventRegister = umlConnectDomainEventRegister, /* 0.9.4 */
-    .connectDomainEventDeregister = umlConnectDomainEventDeregister, /* 0.9.4 */
-    .connectIsEncrypted = umlConnectIsEncrypted, /* 0.7.3 */
-    .connectIsSecure = umlConnectIsSecure, /* 0.7.3 */
-    .domainIsActive = umlDomainIsActive, /* 0.7.3 */
-    .domainIsPersistent = umlDomainIsPersistent, /* 0.7.3 */
-    .domainIsUpdated = umlDomainIsUpdated, /* 0.8.6 */
-    .connectDomainEventRegisterAny = umlConnectDomainEventRegisterAny, /* 0.9.4 */
-    .connectDomainEventDeregisterAny = umlConnectDomainEventDeregisterAny, /* 0.9.4 */
-    .domainOpenConsole = umlDomainOpenConsole, /* 0.8.6 */
-    .connectIsAlive = umlConnectIsAlive, /* 0.9.8 */
-    .nodeSuspendForDuration = umlNodeSuspendForDuration, /* 0.9.8 */
-    .nodeGetMemoryParameters = umlNodeGetMemoryParameters, /* 0.10.2 */
-    .nodeSetMemoryParameters = umlNodeSetMemoryParameters, /* 0.10.2 */
-    .nodeGetFreePages = umlNodeGetFreePages, /* 1.2.6 */
-    .nodeAllocPages = umlNodeAllocPages, /* 1.2.9 */
-    .domainHasManagedSaveImage = umlDomainHasManagedSaveImage, /* 1.2.13 */
-};
-
-static virConnectDriver umlConnectDriver = {
-    .localOnly = true,
-    .uriSchemes = (const char *[]){ "uml", NULL },
-    .hypervisorDriver = &umlHypervisorDriver,
-};
-
-static virStateDriver umlStateDriver = {
-    .name = "UML",
-    .stateInitialize = umlStateInitialize,
-    .stateAutoStart = umlStateAutoStart,
-    .stateCleanup = umlStateCleanup,
-    .stateReload = umlStateReload,
-};
-
-int umlRegister(void)
-{
-    if (virRegisterConnectDriver(&umlConnectDriver,
-                                 true) < 0)
-        return -1;
-    if (virRegisterStateDriver(&umlStateDriver) < 0)
-        return -1;
-    return 0;
-}
diff --git a/src/uml/uml_driver.h b/src/uml/uml_driver.h
deleted file mode 100644 (file)
index 3a258f6..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * uml_driver.h: user mode Linux driver
- *
- * Copyright (C) 2006, 2007 Red Hat, Inc.
- * Copyright (C) 2006-2008 Daniel P. Berrange
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library.  If not, see
- * <http://www.gnu.org/licenses/>.
- */
-
-#ifndef LIBVIRT_UML_DRIVER_H
-# define LIBVIRT_UML_DRIVER_H
-
-# include "internal.h"
-
-int umlRegister(void);
-
-#endif /* LIBVIRT_UML_DRIVER_H */
diff --git a/tests/domaincapsschemadata/basic.xml b/tests/domaincapsschemadata/basic.xml
deleted file mode 100644 (file)
index 7bf4e56..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<domainCapabilities>
-  <path>/bin/emulatorbin</path>
-  <domain>uml</domain>
-  <machine>my-machine-type</machine>
-  <arch>x86_64</arch>
-  <iothreads supported='no'/>
-  <os supported='no'/>
-  <cpu>
-    <mode name='host-passthrough' supported='no'/>
-    <mode name='host-model' supported='no'/>
-    <mode name='custom' supported='no'/>
-  </cpu>
-  <devices>
-    <disk supported='no'/>
-    <graphics supported='no'/>
-    <video supported='no'/>
-    <hostdev supported='no'/>
-  </devices>
-  <features>
-    <gic supported='no'/>
-    <vmcoreinfo supported='no'/>
-    <genid supported='no'/>
-    <sev supported='no'/>
-  </features>
-</domainCapabilities>
index ea4e57d118cee5cc0a4760f8c8e1860e1af50d03..7f52058badfb048a026bc86fd578e984625a919c 100644 (file)
@@ -409,8 +409,6 @@ mymain(void)
             ret = -1; \
     } while (0)
 
-    DO_TEST("basic", "/bin/emulatorbin", "my-machine-type",
-            "x86_64", VIR_DOMAIN_VIRT_UML, CAPS_NONE);
     DO_TEST("full", "/bin/emulatorbin", "my-machine-type",
             "x86_64", VIR_DOMAIN_VIRT_KVM, CAPS_ALL);
 
index 778e67cffd4e4534568ba3291f9562bc81d7ab6c..6726d29e735a19f3e2ac35eccdea34ffc547eae0 100644 (file)
@@ -121,7 +121,6 @@ let driverLockMethods = [
     "openvzDriverLock";
     "testDriverLock";
     "lxcDriverLock";
-    "umlDriverLock";
     "nodedevDriverLock";
     "networkDriverLock";
     "storageDriverLock";
@@ -136,7 +135,6 @@ let driverUnlockMethods = [
     "openvzDriverUnlock";
     "testDriverUnlock";
     "lxcDriverUnlock";
-    "umlDriverUnlock";
     "nodedevDriverUnlock";
     "networkDriverUnlock";
     "storageDriverUnlock";
@@ -153,7 +151,6 @@ let lockableDrivers = [
       "openvz_driver";
       "testConnPtr";
       "lxc_driver_t";
-      "uml_driver";
       "virStorageDriverStatePtr";
       "network_driver";
       "virNodeDeviceState";
index 7e9dced87ed1aaee6def2354d8c11f0bd4f3845b..0d753cd0ee6eb90a274b861561be0517dcea0c63 100644 (file)
@@ -89,9 +89,6 @@ mymain(void)
 #ifdef WITH_LXC
     TEST("lxc");
 #endif
-#ifdef WITH_UML
-    TEST("uml");
-#endif
 #ifdef WITH_VBOX
     TEST("vbox");
 #endif
index 09fa0f8a67139ec6e3b02809d7e46647b83734ea..8428e539f62bc97b82477f9318b5e62d421e8494 100644 (file)
@@ -518,9 +518,6 @@ virshShowVersion(vshControl *ctl ATTRIBUTE_UNUSED)
 #ifdef WITH_LXC
     vshPrint(ctl, " LXC");
 #endif
-#ifdef WITH_UML
-    vshPrint(ctl, " UML");
-#endif
 #ifdef WITH_LIBXL
     vshPrint(ctl, " LibXL");
 #endif