[libvirt] Libvirt block live migration with OpenStack Diablo
by Doude
Hi all,
I use OpenStack Diablo release 2011.3-0ubuntu6.2 on ubuntu 11.10 with
libvirt 0.9.2-4ubuntu15.1
I try to block migrate a VM from one host to another one.
OpenStack uses the 'migrateToURI' method from libvirt python library.
But this call fails.
Libvirt log :
- Source host:
18:27:30.475: 24622: error : remoteIO:5985 : unable to set user and
group to '107:118' on
'/var/lib/nova/instances/instance-000000b7/console.fifo.in': No such
file or directory
- Target host:
27:29.737: 27244: error : virSecurityDACSetOwnership:125 : unable to
set user and group to '107:118' on
'/var/lib/nova/instances/instance-000000b7/console.fifo.in': No such
file or directory
18:27:29.917: 27244: error :
virSecurityDACRestoreSecurityFileLabel:143 : cannot resolve symlink
/var/lib/nova/instances/instance-000000b7/console.fifo.out: No such
file or directory
So the migration fails. VM disks are transfered to the target host but
console files aren't.
XML file of domain:
<domain type='kvm'>
<name>instance-000000b7</name>
<memory>2097152</memory>
<os>
<type>hvm</type>
<boot dev="hd" />
</os>
<features>
<acpi/>
</features>
<vcpu>2</vcpu>
<devices>
<disk type='file'>
<driver type='qcow2'/>
<source file='/var/lib/nova/instances/instance-000000b7/disk'/>
<target dev='vda' bus='virtio'/>
</disk>
<disk type='file'>
<driver type='qcow2'/>
<source
file='/var/lib/nova/instances/instance-000000b7/disk.local'/>
<target dev='vdb' bus='virtio'/>
</disk>
<interface type='bridge'>
<source bridge='br102'/>
<mac address='02:16:3e:36:c4:70'/>
<model type='virtio'/>
<filterref filter="nova-instance-instance-000000b7-02163e36c470">
<parameter name="IP" value="172.16.2.3" />
<parameter name="DHCPSERVER" value="172.16.2.1" />
</filterref>
</interface>
<!-- The order is significant here. File must be defined first -->
<serial type="pipe">
<source
path='/var/lib/nova/instances/instance-000000b7/console.fifo'/>
<target port='1'/>
</serial>
<console type='pty' tty='/dev/pts/2'>
<source path='/dev/pts/2'/>
<target port='0'/>
</console>
<serial type='pty'>
<source path='/dev/pts/2'/>
<target port='0'/>
</serial>
<graphics type='vnc' port='-1' autoport='yes' keymap='fr'
listen='0.0.0.0'/>
</devices>
</domain>
Could you help me ?
Regards,
Doude.
13 years
[libvirt] [PATCH 0/2] Fix build with polkit0
by Jim Fehlig
Commit 0f590c62 was not the proper fix for polkit0 build issue.
This series reverts 0f590c62 and adds virNetServerGetDBusConn()
to libvirt_private.syms
Jim Fehlig (2):
Revert commit 0f590c62
Fix build with polkit0
daemon/Makefile.am | 4 ----
src/libvirt_private.syms | 1 +
2 files changed, 1 insertions(+), 4 deletions(-)
--
1.7.7
13 years
[libvirt] [PATCH] Add support for systemd init service
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
This patch adds support for a systemd init service for libvirtd
and libvirt-guests. The libvirtd.service is *not* written to use
socket activation, since we want libvirtd to start on boot so it
can do guest auto-start.
The libvirt-guests.service is pretty lame, just exec'ing the
original init script for now. Ideally we would factor out the
functionality, into some shared tool.
Instead of
./configure --with-init-script=redhat
You can now do
./configure --with-init-script=systemd
Or better still:
./configure --with-init-script=systemd+redhat
We can also now support install of the upstart init script
In v4:
- Print chosen init script type in configure.ac summary
- Support upstart install
- Error from configure on unsupported requests
- Remove bogus dep from policykit install to redhat init
* configure.ac: Add systemd, and systemd+redhat options to
--with-init-script option
* daemon/Makefile.am: Install systemd services
* daemon/libvirtd.sysconf: Add note about unused env variable
with systemd
* daemon/libvirtd.service.in: libvirtd systemd service unit
* libvirt.spec.in: Add scripts to installing systemd services
and migrating from legacy init scripts
* tools/Makefile.am: Install systemd services
* tools/libvirt-guests.init.sh: Rename to tools/libvirt-guests.init.in
* tools/libvirt-guests.service.in: systemd service unit
---
configure.ac | 37 +++++++++++----
daemon/.gitignore | 1 +
daemon/Makefile.am | 98 +++++++++++++++++++++++++++++---------
daemon/libvirtd.service.in | 20 ++++++++
daemon/libvirtd.sysconf | 3 +
libvirt.spec.in | 93 +++++++++++++++++++++++++++++++++++-
po/POTFILES.in | 2 +-
tools/Makefile.am | 61 +++++++++++++++++++-----
tools/libvirt-guests.service.in | 13 +++++
9 files changed, 279 insertions(+), 49 deletions(-)
create mode 100644 daemon/libvirtd.service.in
create mode 100644 tools/libvirt-guests.service.in
diff --git a/configure.ac b/configure.ac
index 3b7535e..c663f7b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -329,16 +329,33 @@ dnl init script flavor
dnl
AC_MSG_CHECKING([for init script flavor])
AC_ARG_WITH([init-script],
- [AC_HELP_STRING([--with-init-script=@<:@redhat|auto|none@:>@],
- [Style of init script to install @<:@default=auto@:>@])])
-if test "x$with_init_script" = "x" || test "x$with_init_script" = "xauto"; then
- if test "$cross_compiling" = yes || test ! -f /etc/redhat-release; then
- with_init_script=none
- else
- with_init_script=redhat
- fi
-fi
-AM_CONDITIONAL([LIBVIRT_INIT_SCRIPT_RED_HAT], test x$with_init_script = xredhat)
+ [AC_HELP_STRING([--with-init-script@<:@=STYLE@:>@],
+ [Style of init script to install: redhat, systemd, systemd+redhat,
+ upstart, auto, none @<:@default=auto@:>@])])
+init_redhat=no
+init_systemd=no
+case "$with_init_script" in
+ systemd+redhat)
+ init_redhat=yes
+ init_systemd=yes
+ ;;
+ systemd)
+ init_systemd=yes
+ ;;
+ redhat)
+ init_redhat=yes
+ ;;
+ none)
+ ;;
+ *)
+ if test "$cross_compiling" != yes && test -f /etc/redhat-release; then
+ init_redhat=yes
+ with_init_script=redhat
+ fi
+ ;;
+esac
+AM_CONDITIONAL([LIBVIRT_INIT_SCRIPT_RED_HAT], test "$init_redhat" = "yes")
+AM_CONDITIONAL([LIBVIRT_INIT_SCRIPT_SYSTEMD], test "$init_systemd" = "yes")
AC_MSG_RESULT($with_init_script)
dnl RHEL-5 has a peculiar version of Xen, which requires some special casing
diff --git a/daemon/.gitignore b/daemon/.gitignore
index ab3d093..2873143 100644
--- a/daemon/.gitignore
+++ b/daemon/.gitignore
@@ -7,6 +7,7 @@ Makefile.in
libvirt_qemud
libvirtd
libvirtd.init
+libvirtd.service
libvirtd*.logrotate
libvirtd.8
libvirtd.8.in
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index 59db217..9ccbb5b 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -174,22 +174,25 @@ policyfile = libvirtd.policy-1
endif
endif
-install-data-local: install-init install-data-sasl install-data-polkit \
- install-logrotate
+install-data-local: install-init-redhat install-init-systemd install-init-upstart \
+ install-data-sasl install-data-polkit \
+ install-logrotate install-sysctl
mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt
mkdir -p $(DESTDIR)$(localstatedir)/run/libvirt
mkdir -p $(DESTDIR)$(localstatedir)/lib/libvirt
-uninstall-local:: uninstall-init uninstall-data-sasl uninstall-data-polkit
+uninstall-local:: uninstall-init-redhat uninstall-init-systemd uninstall-init-upstart \
+ uninstall-data-sasl uninstall-data-polkit \
+ uninstall-sysctl
rmdir $(DESTDIR)$(localstatedir)/log/libvirt || :
rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || :
if HAVE_POLKIT
-install-data-polkit:: install-init
+install-data-polkit::
mkdir -p $(DESTDIR)$(policydir)
$(INSTALL_DATA) $(srcdir)/$(policyfile) $(DESTDIR)$(policydir)/org.libvirt.unix.policy
-uninstall-data-polkit:: install-init
+uninstall-data-polkit::
rm -f $(DESTDIR)$(policydir)/org.libvirt.unix.policy
else
install-data-polkit::
@@ -238,25 +241,71 @@ install-logrotate: $(LOGROTATE_CONFS)
$(INSTALL_DATA) libvirtd.lxc.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.lxc
$(INSTALL_DATA) libvirtd.uml.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.uml
-if LIBVIRT_INIT_SCRIPT_RED_HAT
-install-init: libvirtd.init
- mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d \
- $(DESTDIR)$(sysconfdir)/sysconfig \
- $(DESTDIR)$(sysconfdir)/sysctl.d
- $(INSTALL_SCRIPT) libvirtd.init \
- $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd
+install-sysconfig:
+ mkdir -p $(DESTDIR)$(sysconfdir)/sysconfig
$(INSTALL_DATA) $(srcdir)/libvirtd.sysconf \
$(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
+uninstall-sysconfig:
+ rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
+
+install-sysctl:
+ mkdir -p $(DESTDIR)$(sysconfdir)/sysctl.d
$(INSTALL_DATA) $(srcdir)/libvirtd.sysctl \
$(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd
-uninstall-init:
- rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd \
- $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd \
- $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd
+uninstall-sysctl:
+ rm -f $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd
+
+if LIBVIRT_INIT_SCRIPT_RED_HAT
BUILT_SOURCES += libvirtd.init
+install-init-redhat: install-sysconfig libvirtd.init
+ mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d
+ $(INSTALL_SCRIPT) libvirtd.init \
+ $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd
+
+uninstall-init-redhat: uninstall-sysconfig
+ rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd
+else
+install-init-redhat:
+uninstall-init-redhat:
+endif # LIBVIRT_INIT_SCRIPT_RED_HAT
+
+
+if LIBVIRT_INIT_SCRIPT_UPSTART
+
+install-init-upstart: install-sysconfig
+ mkdir -p $(DESTDIR)$(sysconfdir)/event.d
+ $(INSTALL_SCRIPT) libvirtd.upstart \
+ $(DESTDIR)$(sysconfdir)/event.d/libvirtd
+
+uninstall-init-upstart: uninstall-sysconfig
+ rm -f $(DESTDIR)$(sysconfdir)/event.d/libvirtd
+else
+install-init-upstart:
+uninstall-init-upstart:
+endif # LIBVIRT_INIT_SCRIPT_UPSTART
+
+
+EXTRA_DIST += libvirtd.service.in
+if LIBVIRT_INIT_SCRIPT_SYSTEMD
+
+SYSTEMD_UNIT_DIR = /lib/systemd/system
+BUILT_SOURCES += libvirtd.service
+
+install-init-systemd: install-sysconfig libvirtd.service
+ mkdir -p $(DESTDIR)$(SYSTEMD_UNIT_DIR)
+ $(INSTALL_SCRIPT) libvirtd.service \
+ $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirtd.service
+
+uninstall-init-systemd: uninstall-sysconfig
+ rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirtd.service
+else
+install-init-systemd:
+uninstall-init-systemd:
+endif # LIBVIRT_INIT_SCRIPT_SYSTEMD
+
libvirtd.init: libvirtd.init.in $(top_builddir)/config.status
$(AM_V_GEN)sed \
-e s!\@localstatedir\@!@localstatedir@!g \
@@ -266,18 +315,21 @@ libvirtd.init: libvirtd.init.in $(top_builddir)/config.status
chmod a+x $@-t && \
mv $@-t $@
+libvirtd.service: libvirtd.service.in $(top_builddir)/config.status
+ $(AM_V_GEN)sed \
+ -e s!\@localstatedir\@!@localstatedir@!g \
+ -e s!\@sbindir\@!@sbindir@!g \
+ -e s!\@sysconfdir\@!@sysconfdir@!g \
+ < $< > $@-t && \
+ chmod a+x $@-t && \
+ mv $@-t $@
+
+
check-local:
$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
'$(AUGPARSE)' -I $(srcdir) $(srcdir)/test_libvirtd.aug; \
fi
-else
-
-install-init:
-uninstall-init:
-libvirtd.init:
-
-endif # LIBVIRT_INIT_SCRIPT_RED_HAT
# This must be added last, since functions it provides/replaces
# are used by nearly every other library.
diff --git a/daemon/libvirtd.service.in b/daemon/libvirtd.service.in
new file mode 100644
index 0000000..9661428
--- /dev/null
+++ b/daemon/libvirtd.service.in
@@ -0,0 +1,20 @@
+# NB we don't use socket activation. When libvirtd starts it will
+# spawn any virtual machines registered for autostart. We want this
+# to occur on every boot, regardless of whether any client connects
+# to a socket. Thus socket activation doesn't have any benefit
+
+[Unit]
+Description=Virtualization daemon
+After=syslog.target
+After=udev.target
+After=avahi.target
+After=dbus.target
+Before=libvirt-guests.service
+
+[Service]
+EnvironmentFile=-/etc/sysconfig/libvirtd
+ExecStart=@sbindir@/libvirtd $LIBVIRTD_ARGS
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/daemon/libvirtd.sysconf b/daemon/libvirtd.sysconf
index b730c5e..ab273c8 100644
--- a/daemon/libvirtd.sysconf
+++ b/daemon/libvirtd.sysconf
@@ -1,4 +1,7 @@
# Override the default config file
+# NOTE: This setting is no longer honoured if using
+# systemd. Set '--config /etc/libvirt/libvirtd.conf'
+# in LIBVIRTD_ARGS instead.
#LIBVIRTD_CONFIG=/etc/libvirt/libvirtd.conf
# Listen for TCP/IP connections
diff --git a/libvirt.spec.in b/libvirt.spec.in
index d4e3e17..ce541a7 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -78,6 +78,7 @@
%define with_dtrace 0%{!?_without_dtrace:0}
%define with_cgconfig 0%{!?_without_cgconfig:0}
%define with_sanlock 0%{!?_without_sanlock:0}
+%define with_systemd 0%{!?_without_systemd:0}
# Non-server/HV driver defaults which are always enabled
%define with_python 0%{!?_without_python:1}
@@ -111,6 +112,11 @@
%define with_hyperv 0
%endif
+# Although earlier Fedora has systemd, libvirt still used sysvinit
+%if 0%{?fedora} >= 17
+%define with_systemd 1
+%endif
+
# RHEL-5 has restricted QEMU to x86_64 only and is too old for LXC
%if 0%{?rhel} == 5
%ifnarch x86_64
@@ -329,7 +335,9 @@ Requires: libcgroup
# All build-time requirements
BuildRequires: python-devel
-
+%if %{with_systemd}
+BuildRequires: systemd-units
+%endif
%if %{with_xen}
BuildRequires: xen-devel
%endif
@@ -474,6 +482,13 @@ BuildRequires: nfs-utils
# Fedora build root suckage
BuildRequires: gawk
+%if %{with_systemd}
+Requires(post): systemd-units
+Requires(post): systemd-sysv
+Requires(preun): systemd-units
+Requires(postun): systemd-units
+%endif
+
%description
Libvirt is a C toolkit to interact with the virtualization capabilities
of recent versions of Linux (and other OSes). The main package includes
@@ -696,6 +711,13 @@ of recent versions of Linux (and other OSes).
%define with_packager --with-packager="%{who}, %{when}, %{where}"
%define with_packager_version --with-packager-version="%{release}"
+%if %{with_systemd}
+# We use 'systemd+redhat', so if someone installs upstart or
+# legacy init scripts, they can still start libvirtd, etc
+%define init_scripts --with-init_script=systemd+redhat
+%else
+%define init_scripts --with-init_script=redhat
+%endif
%configure %{?_without_xen} \
%{?_without_qemu} \
@@ -736,7 +758,7 @@ of recent versions of Linux (and other OSes).
%{with_packager_version} \
--with-qemu-user=%{qemu_user} \
--with-qemu-group=%{qemu_group} \
- --with-init-script=redhat \
+ %{init_scripts} \
--with-remote-pid-file=%{_localstatedir}/run/libvirtd.pid
make %{?_smp_mflags}
gzip -9 ChangeLog
@@ -744,7 +766,7 @@ gzip -9 ChangeLog
%install
rm -fr %{buildroot}
-%makeinstall
+%makeinstall SYSTEMD_UNIT_DIR=%{_unitdir}
for i in domain-events/events-c dominfo domsuspend hellolibvirt openauth python xml/nwfilter systemtap
do
(cd examples/$i ; make clean ; rm -rf .deps .libs Makefile Makefile.in)
@@ -893,6 +915,13 @@ do
done
%endif
+%if %{with_systemd}
+if [ $1 -eq 1 ] ; then
+ # Initial installation
+ /bin/systemctl enable libvirtd.service >/dev/null 2>&1 || :
+ /bin/systemctl enable cgconfig.service >/dev/null 2>&1 || :
+fi
+%else
%if %{with_cgconfig}
# Starting with Fedora 16, systemd automounts all cgroups, and cgconfig is
# no longer a necessary service.
@@ -908,25 +937,64 @@ if [ "$1" -ge "1" ]; then
/sbin/service libvirtd condrestart > /dev/null 2>&1
fi
%endif
+%endif
%preun
%if %{with_libvirtd}
+%if %{with_systemd}
+if [ $1 -eq 0 ] ; then
+ # Package removal, not upgrade
+ /bin/systemctl --no-reload disable libvirtd.service > /dev/null 2>&1 || :
+ /bin/systemctl stop libvirtd.service > /dev/null 2>&1 || :
+fi
+%else
if [ $1 = 0 ]; then
/sbin/service libvirtd stop 1>/dev/null 2>&1
/sbin/chkconfig --del libvirtd
fi
%endif
+%endif
+
+%postun
+%if %{with_libvirtd}
+%if %{with_systemd}
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+if [ $1 -ge 1 ] ; then
+ # Package upgrade, not uninstall
+ /bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || :
+fi
+%endif
+%endif
+
+%if %{with_libvirtd}
+%if %{with_systemd}
+%triggerun -- libvirt < 0.9.4
+%{_bindir}/systemd-sysv-convert --save libvirtd >/dev/null 2>&1 ||:
+
+# If the package is allowed to autostart:
+/bin/systemctl --no-reload enable libvirtd.service >/dev/null 2>&1 ||:
+
+# Run these because the SysV package being removed won't do them
+/sbin/chkconfig --del libvirtd >/dev/null 2>&1 || :
+/bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || :
+%endif
+%endif
%preun client
+%if %{with_systemd}
+%else
if [ $1 = 0 ]; then
/sbin/chkconfig --del libvirt-guests
rm -f /var/lib/libvirt/libvirt-guests
fi
+%endif
%post client
/sbin/ldconfig
+%if %{with_systemd}
+%else
/sbin/chkconfig --add libvirt-guests
if [ $1 -ge 1 ]; then
level=$(/sbin/runlevel | /bin/cut -d ' ' -f 2)
@@ -937,9 +1005,22 @@ if [ $1 -ge 1 ]; then
/sbin/service libvirt-guests start > /dev/null 2>&1 || true
fi
fi
+%endif
%postun client -p /sbin/ldconfig
+%if %{with_systemd}
+%triggerun client -- libvirt < 0.9.4
+%{_bindir}/systemd-sysv-convert --save libvirt-guests >/dev/null 2>&1 ||:
+
+# If the package is allowed to autostart:
+/bin/systemctl --no-reload enable libvirt-guests.service >/dev/null 2>&1 ||:
+
+# Run these because the SysV package being removed won't do them
+/sbin/chkconfig --del libvirt-guests >/dev/null 2>&1 || :
+/bin/systemctl try-restart libvirt-guests.service >/dev/null 2>&1 || :
+%endif
+
%if %{with_libvirtd}
%files
%defattr(-, root, root)
@@ -957,6 +1038,9 @@ fi
%{_sysconfdir}/libvirt/nwfilter/*.xml
%{_sysconfdir}/rc.d/init.d/libvirtd
+%if %{with_systemd}
+%{_unitdir}/libvirtd.service
+%endif
%doc daemon/libvirtd.upstart
%config(noreplace) %{_sysconfdir}/sysconfig/libvirtd
%config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf
@@ -1113,6 +1197,9 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sysctl.d/libvirtd
%{_datadir}/libvirt/cpu_map.xml
%{_sysconfdir}/rc.d/init.d/libvirt-guests
+%if %{with_systemd}
+%{_unitdir}/libvirt-guests.service
+%endif
%config(noreplace) %{_sysconfdir}/sysconfig/libvirt-guests
%dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 810cf68..74f5513 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -152,5 +152,5 @@ src/xenapi/xenapi_utils.c
src/xenxs/xen_sxpr.c
src/xenxs/xen_xm.c
tools/console.c
-tools/libvirt-guests.init.sh
+tools/libvirt-guests.init.in
tools/virsh.c
diff --git a/tools/Makefile.am b/tools/Makefile.am
index c96c7d9..c735398 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -25,7 +25,6 @@ EXTRA_DIST = \
virt-sanlock-cleanup.in \
virt-sanlock-cleanup.8 \
virsh.pod \
- libvirt-guests.init.sh \
libvirt-guests.sysconf
DISTCLEANFILES =
@@ -153,21 +152,32 @@ install-data-local: install-init
uninstall-local: uninstall-init
+install-sysconfig:
+ mkdir -p $(DESTDIR)$(sysconfdir)/sysconfig
+ $(INSTALL_DATA) $(srcdir)/libvirt-guests.sysconf \
+ $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests
+
+uninstall-sysconfig:
+ rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests
+
+EXTRA_DIST += libvirt-guests.init.sh
+
if LIBVIRT_INIT_SCRIPT_RED_HAT
-install-init: libvirt-guests.init
+install-init: libvirt-guests.init install-sysconfig
mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d
$(INSTALL_SCRIPT) libvirt-guests.init \
$(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests
- mkdir -p $(DESTDIR)$(sysconfdir)/sysconfig
- $(INSTALL_DATA) $(srcdir)/libvirt-guests.sysconf \
- $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests
-uninstall-init:
- rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests \
- $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests
+uninstall-init: install-sysconfig
+ rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests
BUILT_SOURCES += libvirt-guests.init
+else
+install-init:
+uninstall-init:
+endif # LIBVIRT_INIT_SCRIPT_RED_HAT
+
libvirt-guests.init: libvirt-guests.init.sh $(top_builddir)/config.status
$(AM_V_GEN)sed \
-e 's!\@PACKAGE\@!$(PACKAGE)!g' \
@@ -179,11 +189,38 @@ libvirt-guests.init: libvirt-guests.init.sh $(top_builddir)/config.status
< $< > $@-t && \
chmod a+x $@-t && \
mv $@-t $@
+
+
+
+EXTRA_DIST += libvirt-guests.service.in
+
+if LIBVIRT_INIT_SCRIPT_SYSTEMD
+install-systemd: libvirt-guests.service install-sysconfig
+ mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/systemd.d
+ $(INSTALL_SCRIPT) libvirt-guests.service \
+ $(DESTDIR)$(sysconfdir)/rc.d/systemd.d/libvirt-guests
+
+uninstall-systemd: install-sysconfig
+ rm -f $(DESTDIR)$(sysconfdir)/rc.d/systemd.d/libvirt-guests
+
+BUILT_SOURCES += libvirt-guests.service
+
else
-install-init:
-uninstall-init:
-libvirt-guests.init:
-endif # LIBVIRT_INIT_SCRIPT_RED_HAT
+install-systemd:
+uninstall-systemd:
+endif # LIBVIRT_INIT_SCRIPT_SYSTEMD
+
+libvirt-guests.service: libvirt-guests.service.in $(top_builddir)/config.status
+ $(AM_V_GEN)sed \
+ -e 's!\@PACKAGE\@!$(PACKAGE)!g' \
+ -e 's!\@bindir\@!$(bindir)!g' \
+ -e 's!\@localedir\@!$(localedir)!g' \
+ -e 's!\@localstatedir\@!$(localstatedir)!g' \
+ -e 's!\@sbindir\@!$(sbindir)!g' \
+ -e 's!\@sysconfdir\@!$(sysconfdir)!g' \
+ < $< > $@-t && \
+ chmod a+x $@-t && \
+ mv $@-t $@
CLEANFILES = $(bin_SCRIPTS)
diff --git a/tools/libvirt-guests.service.in b/tools/libvirt-guests.service.in
new file mode 100644
index 0000000..bc63e91
--- /dev/null
+++ b/tools/libvirt-guests.service.in
@@ -0,0 +1,13 @@
+[Unit]
+Description=Suspend Active Libvirt Guests
+After=syslog.target network.target
+
+[Service]
+EnvironmentFile=-/etc/sysconfig/libvirt-guests
+# Hack just call traditional service until we factor
+# out the code
+ExecStart=/etc/init.d/libvirt-guests start
+ExecStop=/etc/init.d/libvirt-guests stop
+
+[Install]
+WantedBy=multi-user.target
--
1.7.6.4
13 years
[libvirt] [PATCH] Fix build with polkit0
by Jim Fehlig
I missed adding libvirt_driver_remote.la to libvirtd_LDADD in
commit b8adfcc6, which didn't cause a problem in 0.9.6 but
results in this build error in 0.9.7
libvirtd-remote.o: In function `remoteDispatchAuthPolkit':
remote.c:(.text+0x188dd): undefined reference to `virNetServerGetDBusConn'
---
daemon/Makefile.am | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index e8c47ae..59db217 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -156,6 +156,10 @@ endif
if WITH_NWFILTER
libvirtd_LDADD += ../src/libvirt_driver_nwfilter.la
endif
+
+if HAVE_POLKIT0
+ libvirtd_LDADD += ../src/libvirt_driver_remote.la
+endif
endif
libvirtd_LDADD += ../src/libvirt.la
--
1.7.7
13 years
[libvirt] [PATCH] fix a bug in remoteSerializeTypedParameters
by Hu Tao
This is a fatal typo believed to be very likely to happen when using
both i and j at the same time for indexing.
---
daemon/remote.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/daemon/remote.c b/daemon/remote.c
index 857835e..97c9538 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -710,7 +710,7 @@ remoteSerializeTypedParameters(virTypedParameterPtr params,
goto cleanup;
}
val[j].value.type = params[i].type;
- switch (params[j].type) {
+ switch (params[i].type) {
case VIR_TYPED_PARAM_INT:
val[j].value.remote_typed_param_value_u.i = params[i].value.i;
break;
--
1.7.3.1
13 years
Re: [libvirt] [RFC PATCH v3 4/4] qemu/rbd: improve rbd device specification
by Daniel P. Berrange
On Thu, Oct 20, 2011 at 11:01:27AM -0700, Josh Durgin wrote:
> From: Sage Weil <sage(a)newdream.net>
>
> This improves the support for qemu rbd devices by adding support for a few
> key features (e.g., authentication) and cleaning up the way in which
> rbd configuration options are passed to qemu.
>
> And <auth> member of the disk source xml specifies how librbd should
> authenticate. The username attribute is the Ceph/RBD user to authenticate as.
> The usage or uuid attributes specify which secret to use. Usage is an
> arbitrary identifier local to libvirt.
>
> The old RBD support relied on setting an environment variable to
> communicate information to qemu/librbd. Instead, pass those options
> explicitly to qemu. Update the qemu argument parsing and tests
> accordingly.
>
> Signed-off-by: Sage Weil <sage(a)newdream.net>
> Signed-off-by: Josh Durgin <josh.durgin(a)dreamhost.com>
> ---
> src/qemu/qemu_command.c | 284 ++++++++++++--------
> .../qemuxml2argv-disk-drive-network-rbd-auth.args | 6 +
> .../qemuxml2argv-disk-drive-network-rbd-auth.xml | 37 +++
> .../qemuxml2argv-disk-drive-network-rbd.args | 6 +-
> tests/qemuxml2argvtest.c | 52 ++++
> 5 files changed, 268 insertions(+), 117 deletions(-)
> create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd-auth.args
> create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-rbd-auth.xml
>
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index 4dfce88..b2c0eee 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -38,6 +38,7 @@
> #include "domain_audit.h"
> #include "domain_conf.h"
> #include "network/bridge_driver.h"
> +#include "base64.h"
>
> #include <sys/utsname.h>
> #include <sys/stat.h>
> @@ -1489,6 +1490,159 @@ qemuSafeSerialParamValue(const char *value)
> return 0;
> }
>
> +static int buildRBDString(virConnectPtr conn,
> + virDomainDiskDefPtr disk,
> + virBufferPtr opt)
For style reasons, s/buildRBDString/qemuBuildRBDString/
> +{
> + int i;
> + virSecretPtr sec = NULL;
> + char *secret = NULL;
> + size_t secret_size;
> +
> + virBufferAsprintf(opt, "rbd:%s", disk->src);
> + if (disk->auth.username) {
> + virBufferEscape(opt, ":", ":id=%s", disk->auth.username);
> + /* look up secret */
> + switch (disk->auth.secretType) {
> + case VIR_DOMAIN_DISK_SECRET_TYPE_UUID:
> + sec = virSecretLookupByUUID(conn,
> + disk->auth.secret.uuid);
> + break;
> + case VIR_DOMAIN_DISK_SECRET_TYPE_USAGE:
> + sec = virSecretLookupByUsage(conn,
> + VIR_SECRET_USAGE_TYPE_CEPH,
> + disk->auth.secret.usage);
> + break;
> + }
> +
> + if (sec) {
> + char *base64;
> +
> + secret = (char *)conn->secretDriver->getValue(sec, &secret_size, 0,
> + VIR_SECRET_GET_VALUE_INTERNAL_CALL);
> + if (secret == NULL) {
> + qemuReportError(VIR_ERR_INTERNAL_ERROR,
> + _("could not get the value of the secret for username %s"),
> + disk->auth.username);
> + return -1;
> + }
> + /* qemu/librbd wants it base64 encoded */
> + base64_encode_alloc(secret, secret_size, &base64);
> + virBufferEscape(opt, ":", ":key=%s:auth_supported=cephx\\;none",
> + base64);
> + VIR_FREE(base64);
> + VIR_FREE(secret);
> + virUnrefSecret(sec);
> + } else {
> + qemuReportError(VIR_ERR_INTERNAL_ERROR,
> + _("rbd username '%s' specified but secret not found"),
> + disk->auth.username);
> + return -1;
> + }
> + }
> +
> + if (disk->nhosts > 0) {
> + virBufferStrcat(opt, ":mon_host=", NULL);
> + for (i = 0; i < disk->nhosts; ++i) {
> + if (i) {
> + virBufferStrcat(opt, "\\;", NULL);
> + }
> + if (disk->hosts[i].port) {
> + virBufferAsprintf(opt, "%s\\:%s",
> + disk->hosts[i].name,
> + disk->hosts[i].port);
> + } else {
> + virBufferAsprintf(opt, "%s", disk->hosts[i].name);
> + }
> + }
> + }
> +
> + return 0;
> +}
> +
> +static int addRBDHost(virDomainDiskDefPtr disk, char *hostport)
s/add/qemuAdd/
> +{
> + char *port;
> + int ret;
> +
> + disk->nhosts++;
> + ret = VIR_REALLOC_N(disk->hosts, disk->nhosts);
> + if (ret < 0) {
> + virReportOOMError();
> + return -1;
> + }
> +
> + port = strstr(hostport, "\\:");
> + if (port) {
> + *port = '\0';
> + port += 2;
> + disk->hosts[disk->nhosts-1].port = strdup(port);
> + } else {
> + disk->hosts[disk->nhosts-1].port = strdup("6789");
> + }
> + disk->hosts[disk->nhosts-1].name = strdup(hostport);
> + return 0;
> +}
> +
> +/* disk->src initially has everything after the rbd: prefix */
> +static int parseRBDString(virDomainDiskDefPtr disk)
s/parse/qemuParse/
> +{
> + char *options = NULL;
> + char *p, *e, *next;
> +
> + p = strchr(disk->src, ':');
> + if (p) {
> + options = strdup(p + 1);
> + *p = '\0';
> + }
> +
> + /* options */
> + if (!options)
> + return 0; /* all done */
> +
> + p = options;
> + while (*p) {
> + /* find : delimiter or end of string */
> + for (e = p; *e && *e != ':'; ++e) {
> + if (*e == '\\') {
> + e++;
> + if (*e == '\0')
> + break;
> + }
> + }
> + if (*e == '\0') {
> + next = e; /* last kv pair */
> + } else {
> + next = e + 1;
> + *e = '\0';
> + }
> +
> + if (STRPREFIX(p, "id=")) {
> + disk->auth.username = strdup(p + strlen("id="));
> + }
> + if (STRPREFIX(p, "mon_host=")) {
> + char *h, *sep;
> +
> + h = p + strlen("mon_host=");
> + while (h < e) {
> + for (sep = h; sep < e; ++sep) {
> + if (*sep == '\\' && (sep[1] == ',' ||
> + sep[1] == ';' ||
> + sep[1] == ' ')) {
> + *sep = '\0';
> + sep += 2;
> + break;
> + }
> + }
> + addRBDHost(disk, h);
> + h = sep;
> + }
> + }
> +
> + p = next;
> + }
> + return 0;
> +}
>
> char *
> qemuBuildDriveStr(virConnectPtr conn,
> @@ -1608,8 +1762,10 @@ qemuBuildDriveStr(virConnectPtr conn,
> disk->hosts->name, disk->hosts->port);
> break;
> case VIR_DOMAIN_DISK_PROTOCOL_RBD:
> - /* TODO: set monitor hostnames */
> - virBufferAsprintf(&opt, "file=rbd:%s,", disk->src);
> + virBufferStrcat(&opt, "file=", NULL);
> + if (buildRBDString(conn, disk, &opt) < 0)
> + goto error;
> + virBufferStrcat(&opt, ",", NULL);
> break;
> case VIR_DOMAIN_DISK_PROTOCOL_SHEEPDOG:
> if (disk->nhosts == 0)
> @@ -3278,8 +3434,6 @@ qemuBuildCommandLine(virConnectPtr conn,
> int last_good_net = -1;
> bool hasHwVirt = false;
> virCommandPtr cmd;
> - bool has_rbd_hosts = false;
> - virBuffer rbd_hosts = VIR_BUFFER_INITIALIZER;
> bool emitBootindex = false;
> int usbcontroller = 0;
> bool usblegacy = false;
> @@ -3861,7 +4015,6 @@ qemuBuildCommandLine(virConnectPtr conn,
> virDomainDiskDefPtr disk = def->disks[i];
> int withDeviceArg = 0;
> bool deviceFlagMasked = false;
> - int j;
>
> /* Unless we have -device, then USB disks need special
> handling */
> @@ -3919,26 +4072,6 @@ qemuBuildCommandLine(virConnectPtr conn,
> virCommandAddArg(cmd, optstr);
> VIR_FREE(optstr);
>
> - if (disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK &&
> - disk->protocol == VIR_DOMAIN_DISK_PROTOCOL_RBD) {
> - for (j = 0 ; j < disk->nhosts ; j++) {
> - if (!has_rbd_hosts) {
> - virBufferAddLit(&rbd_hosts, "CEPH_ARGS=-m ");
> - has_rbd_hosts = true;
> - } else {
> - virBufferAddLit(&rbd_hosts, ",");
> - }
> - virDomainDiskHostDefPtr host = &disk->hosts[j];
> - if (host->port) {
> - virBufferAsprintf(&rbd_hosts, "%s:%s",
> - host->name,
> - host->port);
> - } else {
> - virBufferAdd(&rbd_hosts, host->name, -1);
> - }
> - }
> - }
> -
> if (!emitBootindex)
> bootindex = 0;
> else if (disk->bootIndex)
> @@ -3976,7 +4109,6 @@ qemuBuildCommandLine(virConnectPtr conn,
> char *file;
> const char *fmt;
> virDomainDiskDefPtr disk = def->disks[i];
> - int j;
>
> if (disk->bus == VIR_DOMAIN_DISK_BUS_USB) {
> if (disk->device == VIR_DOMAIN_DISK_DEVICE_DISK) {
> @@ -4045,24 +4177,15 @@ qemuBuildCommandLine(virConnectPtr conn,
> }
> break;
> case VIR_DOMAIN_DISK_PROTOCOL_RBD:
> - if (virAsprintf(&file, "rbd:%s,", disk->src) < 0) {
> - goto no_memory;
> - }
> - for (j = 0 ; j < disk->nhosts ; j++) {
> - if (!has_rbd_hosts) {
> - virBufferAddLit(&rbd_hosts, "CEPH_ARGS=-m ");
> - has_rbd_hosts = true;
> - } else {
> - virBufferAddLit(&rbd_hosts, ",");
> - }
> - virDomainDiskHostDefPtr host = &disk->hosts[j];
> - if (host->port) {
> - virBufferAsprintf(&rbd_hosts, "%s:%s",
> - host->name,
> - host->port);
> - } else {
> - virBufferAdd(&rbd_hosts, host->name, -1);
> + {
> + virBuffer opt = VIR_BUFFER_INITIALIZER;
> + if (buildRBDString(conn, disk, &opt) < 0)
> + goto error;
> + if (virBufferError(&opt)) {
> + virReportOOMError();
> + goto error;
> }
> + file = virBufferContentAndReset(&opt);
> }
> break;
> case VIR_DOMAIN_DISK_PROTOCOL_SHEEPDOG:
> @@ -4091,9 +4214,6 @@ qemuBuildCommandLine(virConnectPtr conn,
> }
> }
>
> - if (has_rbd_hosts)
> - virCommandAddEnvBuffer(cmd, &rbd_hosts);
> -
> if (qemuCapsGet(qemuCaps, QEMU_CAPS_FSDEV)) {
> for (i = 0 ; i < def->nfss ; i++) {
> char *optstr;
> @@ -5263,7 +5383,6 @@ qemuBuildCommandLine(virConnectPtr conn,
> networkReleaseActualDevice(def->nets[i]);
> for (i = 0; i <= last_good_net; i++)
> virDomainConfNWFilterTeardown(def->nets[i]);
> - virBufferFreeAndReset(&rbd_hosts);
> virCommandFree(cmd);
> return NULL;
> }
> @@ -5295,10 +5414,6 @@ static int qemuStringToArgvEnv(const char *args,
> const char *next;
>
> start = curr;
> - /* accept a space in CEPH_ARGS */
> - if (STRPREFIX(curr, "CEPH_ARGS=-m ")) {
> - start += strlen("CEPH_ARGS=-m ");
> - }
> if (*start == '\'') {
> if (start == curr)
> curr++;
> @@ -5577,6 +5692,8 @@ qemuParseCommandLineDisk(virCapsPtr caps,
> virReportOOMError();
> goto cleanup;
> }
> + if (parseRBDString(def) < 0)
> + goto cleanup;
>
> VIR_FREE(p);
> } else if (STRPREFIX(def->src, "sheepdog:")) {
> @@ -6696,7 +6813,8 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps,
> disk->src = NULL;
> break;
> case VIR_DOMAIN_DISK_PROTOCOL_RBD:
> - /* handled later since the hosts for all disks are in CEPH_ARGS */
> + if (parseRBDString(disk) < 0)
> + goto error;
> break;
> case VIR_DOMAIN_DISK_PROTOCOL_SHEEPDOG:
> /* disk->src must be [vdiname] or [host]:[port]:[vdiname] */
> @@ -7035,68 +7153,6 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps,
> }
>
> #undef WANT_VALUE
> - if (def->ndisks > 0) {
> - const char *ceph_args = qemuFindEnv(progenv, "CEPH_ARGS");
> - if (ceph_args) {
> - char *hosts, *port, *saveptr = NULL, *token;
> - virDomainDiskDefPtr first_rbd_disk = NULL;
> - for (i = 0 ; i < def->ndisks ; i++) {
> - if (def->disks[i]->type == VIR_DOMAIN_DISK_TYPE_NETWORK &&
> - def->disks[i]->protocol == VIR_DOMAIN_DISK_PROTOCOL_RBD) {
> - first_rbd_disk = def->disks[i];
> - break;
> - }
> - }
> -
> - if (!first_rbd_disk) {
> - qemuReportError(VIR_ERR_INTERNAL_ERROR,
> - _("CEPH_ARGS was set without an rbd disk"));
> - goto error;
> - }
> -
> - /* CEPH_ARGS should be: -m host1[:port1][,host2[:port2]]... */
> - if (!STRPREFIX(ceph_args, "-m ")) {
> - qemuReportError(VIR_ERR_INTERNAL_ERROR,
> - _("could not parse CEPH_ARGS '%s'"), ceph_args);
> - goto error;
> - }
> - hosts = strdup(strchr(ceph_args, ' ') + 1);
> - if (!hosts)
> - goto no_memory;
> - first_rbd_disk->nhosts = 0;
> - token = strtok_r(hosts, ",", &saveptr);
> - while (token != NULL) {
> - if (VIR_REALLOC_N(first_rbd_disk->hosts, first_rbd_disk->nhosts + 1) < 0) {
> - VIR_FREE(hosts);
> - goto no_memory;
> - }
> - port = strchr(token, ':');
> - if (port) {
> - *port++ = '\0';
> - port = strdup(port);
> - if (!port) {
> - VIR_FREE(hosts);
> - goto no_memory;
> - }
> - }
> - first_rbd_disk->hosts[first_rbd_disk->nhosts].port = port;
> - first_rbd_disk->hosts[first_rbd_disk->nhosts].name = strdup(token);
> - if (!first_rbd_disk->hosts[first_rbd_disk->nhosts].name) {
> - VIR_FREE(hosts);
> - goto no_memory;
> - }
> - first_rbd_disk->nhosts++;
> - token = strtok_r(NULL, ",", &saveptr);
> - }
> - VIR_FREE(hosts);
> -
> - if (first_rbd_disk->nhosts == 0) {
> - qemuReportError(VIR_ERR_INTERNAL_ERROR,
> - _("found no rbd hosts in CEPH_ARGS '%s'"), ceph_args);
> - goto error;
> - }
> - }
> - }
>
> if (!nographics && def->ngraphics == 0) {
> virDomainGraphicsDefPtr sdl;
> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
> index a7ae925..31bd928 100644
> --- a/tests/qemuxml2argvtest.c
> +++ b/tests/qemuxml2argvtest.c
> @@ -23,6 +23,55 @@
> static const char *abs_top_srcdir;
> static struct qemud_driver driver;
>
> +static unsigned char *
> +fakeSecretGetValue(virSecretPtr obj ATTRIBUTE_UNUSED,
> + size_t *value_size,
> + unsigned int fakeflags ATTRIBUTE_UNUSED,
> + unsigned int internalFlags ATTRIBUTE_UNUSED)
> +{
> + char *secret = strdup("AQCVn5hO6HzFAhAAq0NCv8jtJcIcE+HOBlMQ1A");
> + *value_size = strlen(secret);
> + return (unsigned char *) secret;
> +}
> +
> +static virSecretPtr
> +fakeSecretLookupByUsage(virConnectPtr conn,
> + int usageType ATTRIBUTE_UNUSED,
> + const char *usageID)
> +{
> + virSecretPtr ret = NULL;
> + if (strcmp(usageID, "mycluster_myname"))
s/strcmp/STRNEQ/
> + return ret;
> + ret = malloc(sizeof(virSecret));
Need to use VIR_ALLOC for this.
> + ret->magic = VIR_SECRET_MAGIC;
> + ret->conn = conn;
> + conn->refs++;
> + ret->refs = 1;
> + ret->usageID = strdup(usageID);
> + return ret;
> +}
> +
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
13 years
[libvirt] ANNOUNCE: libvirt-glib release 0.0.1
by Daniel P. Berrange
I am pleased to announce the first release of the libvirt-glib package,
version 0.0.1 is now available from
ftp://libvirt.org/libvirt/glib/
The packages are GPG signed with
Key ID: 15104FDF Daniel P. Berrange <berrange(a)redhat.com>
Key fingerprint: DAF3 A6FD B26B 6291 2D0E 8E3F BE86 EBB4 1510 4FDF
libvirt-glib comprises three distinct libraries:
- libvirt-glib - Integrate with the GLib event loop and error handling
- libvirt-gconfig - Representation of libvirt XML documents as GObjects
- libvirt-gobject - Mapping of libvirt APIs into the GObject type system
As of this release only the event loop integration and some basic APIs for
managing domains are provided. The representation of XML as GObjects is a
major work item that is just beginning.
The libvirt-gconfig library can be used without linking to the main libvirt.so
library, so it is suitable for consumption by applications which use libvirt
indirectly via AMQP, CIM or another API transport which accepts XML documents.
All the libraries support GObject introspection to enable immediate usage
from any language which can dynamically import objects via introspection.
There are also Vala bindings which are automatically generated from the
introspection data.
NB: While libvirt aims to be API/ABI stable, for the first few releases,
we are *NOT* guaranteeing that libvirt-glib libraries are API/ABI stable.
ABI stability will only be guaranteed once the bulk of the APIs have been
fleshed out and proved in non-trivial application usage. We anticipate
this will be within the next 6 months in order to line up with Fedora 17.
Follow up comments about libvirt-glib should be directed to the regular
libvir-list(a)redhat.com developmenht list.
Thanks to all the people involved in contributing to this release.
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
13 years
[libvirt] [libvirt PATCHv5 0/2] add DHCP Snooping support for libvirt
by David L Stevens
These patches add DHCP snooping support to libvirt. The learning method for
IP addresses is specified by setting the "ip_learning" variable to one of
"any" [default] (existing IP learning code), "none" (static only addresses)
or "dhcp" (DHCP snooping).
Differences from v4:
- added documentation of "ip_learning"
- added support for kill -HUP reloading
- simplified lease file handling
David L Stevens (2):
add DHCP snooping
add leasefile support
docs/formatnwfilter.html.in | 17 +
examples/xml/nwfilter/no-ip-spoofing.xml | 5 +
src/Makefile.am | 2 +
src/nwfilter/nwfilter_dhcpsnoop.c | 961 ++++++++++++++++++++++++++++++
src/nwfilter/nwfilter_dhcpsnoop.h | 38 ++
src/nwfilter/nwfilter_driver.c | 6 +
src/nwfilter/nwfilter_gentech_driver.c | 53 ++-
7 files changed, 1069 insertions(+), 13 deletions(-)
create mode 100644 src/nwfilter/nwfilter_dhcpsnoop.c
create mode 100644 src/nwfilter/nwfilter_dhcpsnoop.h
--
1.7.6.4
13 years
[libvirt] [libvirt-glib 1/3] Also distribute private headers
by Zeeshan Ali (Khattak)
From: "Zeeshan Ali (Khattak)" <zeeshanak(a)gnome.org>
Private headers just shouldn't be installed but still distributed as
they are required during the build. Fixes `make distcheck`.
---
libvirt-gobject/Makefile.am | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libvirt-gobject/Makefile.am b/libvirt-gobject/Makefile.am
index d975701..0eef9c8 100644
--- a/libvirt-gobject/Makefile.am
+++ b/libvirt-gobject/Makefile.am
@@ -48,12 +48,12 @@ libvirt_gobject_1_0_la_HEADERS = \
$(GOBJECT_HEADER_FILES) \
libvirt-gobject-input-stream.h
nodist_libvirt_gobject_1_0_la_HEADERS = \
- libvirt-gobject-compat.h \
- libvirt-gobject-domain-device-private.h \
libvirt-gobject-enums.h
libvirt_gobject_1_0_la_SOURCES = \
$(libvirt_gobject_1_0_la_HEADERS) \
$(GOBJECT_SOURCE_FILES) \
+ libvirt-gobject-domain-device-private.h \
+ libvirt-gobject-compat.h \
libvirt-gobject-input-stream.c
nodist_libvirt_gobject_1_0_la_SOURCES = \
$(GOBJECT_GENERATED_FILES)
--
1.7.7.1
13 years
[libvirt] [PATCH] Fix tip of git
by Stefan Berger
I get these type of compilation errors:
In file included from util/virnetdevvportprofile.c:25:0:
util/virnetdevvportprofile.h:49:13: error: expected
specifier-qualifier-list before 'uint8_t'
util/virnetdevvportprofile.c: In function 'virNetDevVPortProfileEqual':
util/virnetdevvportprofile.c:45:33: error: 'struct <anonymous>' has no
member named 'managerID'
util/virnetdevvportprofile.c:45:67: error: 'struct <anonymous>' has no
member named 'managerID'
util/virnetdevvportprofile.c:46:33: error: 'struct <anonymous>' has no
member named 'typeID'
util/virnetdevvportprofile.c:46:64: error: 'struct <anonymous>' has no
member named 'typeID'
util/virnetdevvportprofile.c:47:33: error: 'struct <anonymous>' has no
member named 'typeIDVersion'
util/virnetdevvportprofile.c:47:71: error: 'struct <anonymous>' has no
member named 'typeIDVersion'
util/virnetdevvportprofile.c:48:40: error: 'struct <anonymous>' has no
member named 'instanceID'
util/virnetdevvportprofile.c:48:73: error: 'struct <anonymous>' has no
member named 'instanceID'
This patch trivially fixes it:
--- a/src/util/virnetdevvportprofile.h
+++ b/src/util/virnetdevvportprofile.h
@@ -23,6 +23,8 @@
#ifndef __VIR_NETDEV_VPORT_PROFILE_H__
# define __VIR_NETDEV_VPORT_PROFILE_H__
+# include <stdint.h>
+
# include "internal.h"
# include "uuid.h"
# include "util.h"
13 years