[libvirt] [PATCH] openvz: Allow missing micro tag in the version
by Osier Yang
No reason to cause the openvz driver to fail on startup if
the micro tag in missed. This solves the problem:
https://www.redhat.com/archives/libvirt-users/2012-March/msg00202.html
---
src/openvz/openvz_conf.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c
index 28f86ff..da6869b 100644
--- a/src/openvz/openvz_conf.c
+++ b/src/openvz/openvz_conf.c
@@ -95,11 +95,13 @@ openvzExtractVersionInfo(const char *cmdstr, int *retversion)
tmp = help;
- /* expected format: vzctl version <major>.<minor>.<micro> */
+ /* expected format: vzctl version <major>.<minor>.<micro>,
+ * missing <micro> is allowed.
+ */
if ((tmp = STRSKIP(tmp, "vzctl version ")) == NULL)
goto cleanup;
- if (virParseVersionString(tmp, &version, false) < 0)
+ if (virParseVersionString(tmp, &version, true) < 0)
goto cleanup;
if (retversion)
--
1.7.7.3
12 years, 8 months
[libvirt] [PATCH] build: fix build on cygwin
by Eric Blake
Regression introduced when we changed types in commit 3e2c3d8f6.
We've done this sort of cleanup before (see commit c685993d7).
* src/conf/storage_conf.c (virStoragePoolDefFormat)
(virStorageVolTargetDefFormat): Cast gid_t and uid_t.
---
Pushing under the build-breaker rule.
src/conf/storage_conf.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index bdf6218..2330fa1 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -915,10 +915,10 @@ virStoragePoolDefFormat(virStoragePoolDefPtr def) {
virBufferAddLit(&buf," <permissions>\n");
virBufferAsprintf(&buf," <mode>0%o</mode>\n",
def->target.perms.mode);
- virBufferAsprintf(&buf," <owner>%d</owner>\n",
- def->target.perms.uid);
- virBufferAsprintf(&buf," <group>%d</group>\n",
- def->target.perms.gid);
+ virBufferAsprintf(&buf," <owner>%u</owner>\n",
+ (unsigned int) def->target.perms.uid);
+ virBufferAsprintf(&buf," <group>%u</group>\n",
+ (unsigned int) def->target.perms.gid);
if (def->target.perms.label)
virBufferAsprintf(&buf," <label>%s</label>\n",
@@ -1152,10 +1152,10 @@ virStorageVolTargetDefFormat(virStorageVolOptionsPtr options,
virBufferAddLit(buf," <permissions>\n");
virBufferAsprintf(buf," <mode>0%o</mode>\n",
def->perms.mode);
- virBufferAsprintf(buf," <owner>%d</owner>\n",
- def->perms.uid);
- virBufferAsprintf(buf," <group>%d</group>\n",
- def->perms.gid);
+ virBufferAsprintf(buf," <owner>%u</owner>\n",
+ (unsigned int) def->perms.uid);
+ virBufferAsprintf(buf," <group>%u</group>\n",
+ (unsigned int) def->perms.gid);
if (def->perms.label)
--
1.7.7.6
12 years, 8 months
[libvirt] [PATCH] build: fix mingw ssize_t, syntax check
by Eric Blake
We are so close to a release that we don't want to pull in a
gnulib submodule update and risk regressions, since there has
been a lot of other gnulib churn upstream. However, there are
a couple of gnulib issues that are worth fixing in isolation,
by applying local patches to gnulib.
There was an upstream gnulib bug in maint.mk that rendered most
of our syntax checks ineffective (and fixing it flushed out a
minor bug in our code):
https://lists.gnu.org/archive/html/bug-gnulib/2012-03/msg00194.html
There is still an upstream bug where gnulib uses the wrong type
for ssize_t on mingw; we need the fix now even though it has not
yet been accepted into gnulib:
https://lists.gnu.org/archive/html/bug-gnulib/2012-03/msg00188.html
* gnulib/local/top/maint.mk.diff: Pick up upstream gnulib
maint.mk.
* gnulib/local/m4/ssize_t.m4.diff: Work around gnulib bug.
* src/libvirt.c: Remove unused header.
---
Yes, I know reading a diff of a diff is hard.
Any objections to this? I'd like to apply it before RC2 is built.
I am not set up to easily test if the ssize_t fix works on mingw.
I _did_ test it on Linux, including where I primed the configure
cache to intentionally treat ssize_t as missing, so I'm confident
the replacement mechanism works; I just don't know if it will
silence the warnings that Dan reported here:
https://www.redhat.com/archives/libvir-list/2012-March/msg01273.html
And we still need _part_ of that patch (the conversion from fprintf
to asprintf, in order to support %zd in the first place).
gnulib/local/m4/ssize_t.m4.diff | 34 ++++++++++++++++++++++++++++++++++
gnulib/local/top/maint.mk.diff | 32 ++++++++++++++++++++++++++++++++
src/libvirt.c | 2 --
3 files changed, 66 insertions(+), 2 deletions(-)
create mode 100644 gnulib/local/m4/ssize_t.m4.diff
create mode 100644 gnulib/local/top/maint.mk.diff
diff --git a/gnulib/local/m4/ssize_t.m4.diff b/gnulib/local/m4/ssize_t.m4.diff
new file mode 100644
index 0000000..d0ae286
--- /dev/null
+++ b/gnulib/local/m4/ssize_t.m4.diff
@@ -0,0 +1,34 @@
+diff --git i/m4/ssize_t.m4 w/m4/ssize_t.m4
+index 209d64c..5ea72a1 100644
+--- i/m4/ssize_t.m4
++++ w/m4/ssize_t.m4
+@@ -1,4 +1,4 @@
+-# ssize_t.m4 serial 5 (gettext-0.18.2)
++# ssize_t.m4 serial 6 (gettext-0.18.2)
+ dnl Copyright (C) 2001-2003, 2006, 2010-2012 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -17,7 +17,21 @@ AC_DEFUN([gt_TYPE_SSIZE_T],
+ return !x;]])],
+ [gt_cv_ssize_t=yes], [gt_cv_ssize_t=no])])
+ if test $gt_cv_ssize_t = no; then
+- AC_DEFINE([ssize_t], [int],
+- [Define as a signed type of the same size as size_t.])
++ AC_CACHE_CHECK([for rank of size_t], [gt_cv_size_t_rank],
++ [AC_COMPILE_IFELSE(
++ [AC_LANG_PROGRAM(
++ [[#include <sys/types.h>
++ #ifdef __cplusplus
++ extern "C" {
++ #endif
++ int foo(unsigned long bar);
++ int foo(size_t bar);
++ #ifdef __cplusplus
++ }
++ #endif
++ ]])],
++ [gt_cv_size_t_rank=long], [gt_cv_size_t_rank=int])])
++ AC_DEFINE_UNQUOTED([ssize_t], [$gt_cv_size_t_rank],
++ [Define as a signed type of the same size and rank as size_t.])
+ fi
+ ])
diff --git a/gnulib/local/top/maint.mk.diff b/gnulib/local/top/maint.mk.diff
new file mode 100644
index 0000000..85e97ae
--- /dev/null
+++ b/gnulib/local/top/maint.mk.diff
@@ -0,0 +1,32 @@
+diff --git i/top/maint.mk w/top/maint.mk
+index 4cbd5f4..2228a37 100644
+--- i/top/maint.mk
++++ w/top/maint.mk
+@@ -279,7 +279,7 @@ define _sc_search_regexp
+ if test -n "$$files"; then \
+ if test -n "$$prohibit"; then \
+ grep $$with_grep_options $(_ignore_case) -nE "$$prohibit" $$files \
+- | grep -vE "$${exclude-^$$}" \
++ | grep -vE "$${exclude:-^$$}" \
+ && { msg="$$halt" $(_sc_say_and_exit) } || :; \
+ else \
+ grep $$with_grep_options $(_ignore_case) -LE "$$require" $$files \
+@@ -455,7 +455,8 @@ sc_prohibit_quotearg_without_use:
+
+ # Don't include quote.h unless you use one of its functions.
+ sc_prohibit_quote_without_use:
+- @h='quote.h' re='\<quote(_n)? *\(' $(_sc_header_without_use)
++ @h='quote.h' re='\<quote((_n)? *\(|_quoting_options\>)' \
++ $(_sc_header_without_use)
+
+ # Don't include this header unless you use one of its functions.
+ sc_prohibit_long_options_without_use:
+@@ -1332,7 +1333,7 @@ alpha beta stable: $(local-check) writable-files $(submodule-checks)
+ $(MAKE) vc-diff-check
+ $(MAKE) news-check
+ $(MAKE) distcheck
+- $(MAKE) dist XZ_OPT=-9ev
++ $(MAKE) dist
+ $(MAKE) $(release-prep-hook) RELEASE_TYPE=$@
+ $(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
+
diff --git a/src/libvirt.c b/src/libvirt.c
index 8bca16d..16d1fd5 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -45,8 +45,6 @@
#include "virrandom.h"
#include "viruri.h"
-#include <ctype.h>
-
#ifndef WITH_DRIVER_MODULES
# ifdef WITH_TEST
# include "test/test_driver.h"
--
1.7.1
12 years, 8 months
[libvirt] [PATCH] hold the reference when call monitor's callback
by Wen Congyang
When qemu cannot startup, we will call EOF notify callback.
Unfortunately, there is a bug in libvirt, and it will cause
mon->ref to be 0 while we call EOF notify callback. This
bug will cause the libvirt to be deadlock.
We call the other callback while holding the reference. So
I think we should also hold the reference here.
Note: this patch does not fix the bug. The libvirt will be
deadlock in qemuMonitorUnwatch() because the monitor is freed
unexpectedly.
I am still investigating this bug. But if I set a breakpoint
in qemuMonitorUnref(), it does not happen now. If i remove
the breakpoint, it will happen sometime(the probability is
about 20%).
The steps to reproduce this bug:
1. use newest qemu-kvm
2. add a host pci device into guest config file
3. start the guest
The qemu will fail with the following error message:
Failed to assign irq for "hostdev0": Input/output error
Perhaps you are assigning a device that shares an IRQ with another device?
I have reported qemu's problem to qemu maillist.
---
src/qemu/qemu_monitor.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 78eb492..20eb9ea 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -668,10 +668,14 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) {
/* Make sure anyone waiting wakes up now */
virCondSignal(&mon->notify);
- if (qemuMonitorUnref(mon) > 0)
- qemuMonitorUnlock(mon);
+
+ /* hold the reference when call monitor's callback to avoid deadlock */
+ qemuMonitorUnlock(mon);
VIR_DEBUG("Triggering EOF callback");
(eofNotify)(mon, vm);
+ qemuMonitorLock(mon);
+ if (qemuMonitorUnref(mon) > 0)
+ qemuMonitorUnlock(mon);
} else if (error) {
void (*errorNotify)(qemuMonitorPtr, virDomainObjPtr)
= mon->cb->errorNotify;
@@ -679,10 +683,14 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) {
/* Make sure anyone waiting wakes up now */
virCondSignal(&mon->notify);
- if (qemuMonitorUnref(mon) > 0)
- qemuMonitorUnlock(mon);
+
+ /* hold the reference when call monitor's callback to avoid deadlock */
+ qemuMonitorUnlock(mon);
VIR_DEBUG("Triggering error callback");
(errorNotify)(mon, vm);
+ qemuMonitorLock(mon);
+ if (qemuMonitorUnref(mon) > 0)
+ qemuMonitorUnlock(mon);
} else {
if (qemuMonitorUnref(mon) > 0)
qemuMonitorUnlock(mon);
--
1.7.1
12 years, 8 months
[libvirt] [PATCH] Set default name for SPICE agent channel
by Christophe Fergeau
libvirt documentation for channels with type 'spicevmc' says that the
'target' child node has:
"an optional attribute name controls how the guest will have access
to the channel, and defaults to name='com.redhat.spice.0'."
However, this default value is never set in libvirt code base,
there's only a check in qemu_command.c to error out if the name
attribute doesn't have the expected value (if it's set).
This commit sets a default target name for spicevmc channels during
the domain configuration parsing so that the code agrees with the
documentation.
---
src/conf/domain_conf.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index d5def1c..9012462 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -5218,6 +5218,13 @@ virDomainChrDefParseXML(virCapsPtr caps,
goto error;
} else {
def->source.data.spicevmc = VIR_DOMAIN_CHR_SPICEVMC_VDAGENT;
+ if (!def->target.name) {
+ def->target.name = strdup("com.redhat.spice.0");
+ if (!def->target.name) {
+ virReportOOMError();
+ goto error;
+ }
+ }
}
}
--
1.7.7.6
12 years, 8 months
[libvirt] [PATCH] Refactor the libvirt RPM daemon pieces
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
NB: this is in response to a Fedora 17 beta blocker bug.
Currently gnome-boxes depends on 'libvirt' which pulls
in the default virtual network, which kills networking
if you install Fedora 17 inside a KVM guest.
There are a number of flaws with our packaging of the libvirtd
daemon:
- Installing 'libvirt' does not install 'qemu-kvm' or 'xen'
etc which are required to actually run the hypervisor in
question
- Installing 'libvirt' pulls in the default configuration
files which may not be wanted & cause problems if installed
inside a guest
- It is not possible to explicitly required all the peices
required to manage a specific hypervisor
This change takes the 'libvirt' RPM and and changes it thus
- libvirt: just a virtual package with dep on libvirt-daemon and
libvirt-daemon-configs
- libvirt-daemon: the libvirt daemon and related pieces
- libvirt-daemon-configs: the default network & filter configs
- libvirt-docs: the website HTML
We then introduce some more virtual (empty) packages
- libvirt-daemon-qemu: Deps on libvirt-daemon & 'qemu'
- libvirt-daemon-kvm: Deps on libvirt-daemon & 'qemu-kvm'
- libvirt-daemon-lxc: Deps on libvirt-daemon
- libvirt-daemon-uml: Deps on libvirt-daemon
- libvirt-daemon-xen: Deps on libvirt-daemon & 'xen'
- libvirt-qemu: Deps on libvirt-daemon-qemu & libvirt-daemon-configs
- libvirt-kvm: Deps on libvirt-daemon-kvm & libvirt-daemon-configs
- libvirt-lxc: Deps on libvirt-daemon-lxc & libvirt-daemon-configs
- libvirt-uml: Deps on libvirt-daemon-uml & libvirt-daemon-configs
- libvirt-xen: Deps on libvirt-daemon-xen & libvirt-daemon-configs
My intent in the future is to turn on the driver modules by
default, at which time 'libvirt-daemon' will cease to include
any specific drivers, instead we'll get libvirt-daemon-driver-XXXX
packages for each driver. The libvirt-daemon-XXX packages will
then pull in each driver that they require.
It is recommended that applications required a locally installed
libvirtd daemon, use either 'Requires: libvirt-daemon-XXXX' or
'Requires: libvirt-XXX' and *not* "Requires: libvirt-daemon"
or 'Requires: libvirt'
* libvirt.spec.in: Refactor RPMs
* docs/packaging.html.in, docs/sitemap.html.in: Document
new RPM split rationale
---
docs/packaging.html.in | 100 ++++++++++
docs/sitemap.html.in | 4 +
libvirt.spec.in | 474 +++++++++++++++++++++++++++++++++++-------------
3 files changed, 456 insertions(+), 122 deletions(-)
create mode 100644 docs/packaging.html.in
diff --git a/docs/packaging.html.in b/docs/packaging.html.in
new file mode 100644
index 0000000..2e4abf7
--- /dev/null
+++ b/docs/packaging.html.in
@@ -0,0 +1,100 @@
+<?xml version="1.0"?>
+<html>
+ <body>
+ <h1>Distribution packaging</h1>
+
+ <ul id="toc"></ul>
+
+ <p>
+ This page describes the rationale behind the libvirt distribution
+packaging in RPM format. The RPM specfile provided with libvirt targets
+all Fedora and RHEL releases. It is split up into a number of sub-RPMs
+in order to facilitate minimal installations, targetting specific
+feature sets.
+ </p>
+
+ <h2>Real packages</h2>
+
+ <p>
+ The so called "real" packages provide the actual file payloads
+ related to libvirt. If very specific / targetted functionality
+ is required, then applications can depend on one or more of these
+ real packages.
+ </p>
+
+ <dl>
+ <dt>libvirt-client</dt>
+ <dd>This package provides the main libvirt.so library along with the virsh command line tool.
+ If a C based application only wants to be able to manage remote hypervisors, this is all
+ that they need depend on</dd>
+ <dt>libvirt-devel</dt>
+ <dd>This package provides the header files and libraries required to compile and link C
+ applications using libvirt</dd>
+ <dt>libvirt-python</dt>
+ <dd>This package provides the Python binding to the C libraries. It will pull in the libvirt-client
+ RPM. If a Python application only wants to be able to manage remote hypervisors, this is all that
+ they need depend on</dd>
+ <dt>libvirt-daemon</dt>
+ <dd>This package provides server side libvirtd daemon, which is required in order to
+ manage any stateful hypervisors (currently QEMU, KVM, Xen, LXC and UML).</dd>
+ <dt>libvirt-daemon-configs</dt>
+ <dd>This package provides the standard configuration files for setting up a NAT
+ based network, and network filter rules for ensuring clean VM traffic.</dd>
+ </dl>
+
+ <h2>Virtual packages</h2>
+
+ <p>
+ The virtual packages provide convenient targets for application dependencies to
+ pull in functionality related to specific hypervisors. Since the packaging of
+ the <code>libvirt-daemon</code> RPM is expected to change in the future to split
+ each hypervisor driver out into a separate RPM, applications are strongly
+ recommended to depend on one of the following virtual packages, instead of
+ depending directly on <code>libvirt-daemon</code>
+ </p>
+
+ <dl>
+ <dt>libvirt</dt>
+ <dd>This package, simply pulls in every single other server side RPM.
+ If an application wants to ensure all possible libvirt drivers are installed,
+ this is what they should depend on</dd>
+
+ <dt>libvirt-daemon-qemu</dt>
+ <dd>This package pulls in the server side daemon, drivers and the QEMU TCG binaries
+ required to provide emulation of non-native architectures</dd>
+ <dt>libvirt-daemon-kvm</dt>
+ <dd>This package pulls in the server side daemon, drivers and the KVM binaries
+ required to provide hardware accelerated virtualization of the native
+ architectures</dd>
+ <dt>libvirt-daemon-lxc</dt>
+ <dd>This package pulls in the server side daemon and drivers required to
+ run native Linux containers</dd>
+ <dt>libvirt-daemon-uml</dt>
+ <dd>This package pulls in the server side daemon and drivers required to
+ run User Mode Linux. The application must still provide the actual
+ UML binary kenrels</dd>
+ <dt>libvirt-daemon-xen</dt>
+ <dd>This package pulls in the server side daemon and drivers required to
+ run guests on the Xen hypervisor.</dd>
+
+ <dt>libvirt-qemu</dt>
+ <dd>This package pulls in the server side daemon, drivers and the QEMU TCG binaries
+ required to provide emulation of non-native architectures</dd>
+ <dt>libvirt-kvm</dt>
+ <dd>This package pulls in the server side daemon, drivers and the KVM binaries
+ required to provide hardware accelerated virtualization of the native
+ architectures</dd>
+ <dt>libvirt-lxc</dt>
+ <dd>This package pulls in the server side daemon, drivers and default
+ configuration files required to run native Linux containers</dd>
+ <dt>libvirt-uml</dt>
+ <dd>This package pulls in the server side daemon, drivers and default
+ configuration files required to run User Mode Linux. The application
+ must still provide the actual UML binary kenrels</dd>
+ <dt>libvirt-xen</dt>
+ <dd>This package pulls in the server side daemon, drivers and default
+ configuration files required to run guests on the Xen hypervisor.</dd>
+ </dl>
+
+ </body>
+</html>
diff --git a/docs/sitemap.html.in b/docs/sitemap.html.in
index 1de2b20..620c989 100644
--- a/docs/sitemap.html.in
+++ b/docs/sitemap.html.in
@@ -84,6 +84,10 @@
<a href="hooks.html">Hooks</a>
<span>Hooks for system specific management</span>
</li>
+ <li>
+ <a href="packaging.html">Distribution packaging</a>
+ <span>Rationale for distribution RPM packaging</span>
+ </li>
</ul>
</li>
<li>
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 67f1c33..743d43e 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -52,6 +52,14 @@
%define with_libxl 0%{!?_without_libxl:%{server_drivers}}
%define with_vmware 0%{!?_without_vmware:%{server_drivers}}
+%define with_qemu_tcg %{with_qemu}
+# Change if we ever provide qemu-kvm binaries on non-x86 hosts
+%ifarch %{ix86} x86_64
+%define with_qemu_kvm %{with_qemu}
+%else
+%define with_qemu_kvm 0
+%endif
+
# Then the hypervisor drivers that talk via a native remote protocol
%define with_phyp 0%{!?_without_phyp:1}
%define with_esx 0%{!?_without_esx:1}
@@ -125,8 +133,10 @@
# RHEL-5 has restricted QEMU to x86_64 only and is too old for LXC
%if 0%{?rhel} == 5
+%define with_qemu_tcg 0
%ifnarch x86_64
%define with_qemu 0
+%define with_qemu_kvm 0
%endif
%define with_lxc 0
%endif
@@ -134,8 +144,10 @@
# RHEL-6 has restricted QEMU to x86_64 only, stopped including Xen
# on all archs. Other archs all have LXC available though
%if 0%{?rhel} >= 6
+%define with_qemu_tcg 0
%ifnarch x86_64
%define with_qemu 0
+%define with_qemu_kvm 0
%endif
%define with_xen 0
%endif
@@ -268,109 +280,17 @@ Source: http://libvirt.org/sources/libvirt-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
URL: http://libvirt.org/
-# All runtime requirements for the libvirt package (runtime requrements
-# for subpackages are listed later in those subpackages)
-
-# The client side, i.e. shared libs and virsh are in a subpackage
-Requires: %{name}-client = %{version}-%{release}
-
-# Used by many of the drivers, so turn it on whenever the
-# daemon is present
%if %{with_libvirtd}
-# for modprobe of pci devices
-Requires: module-init-tools
-# for /sbin/ip & /sbin/tc
-Requires: iproute
-%if %{with_avahi}
-Requires: avahi-libs
-%endif
-%endif
-%if %{with_network}
-Requires: dnsmasq >= 2.41
-Requires: radvd
-%endif
-%if %{with_network} || %{with_nwfilter}
-Requires: iptables
-Requires: iptables-ipv6
-%endif
-%if %{with_nwfilter}
-Requires: ebtables
-%endif
-# needed for device enumeration
-%if %{with_hal}
-Requires: hal
-%endif
-%if %{with_udev}
-Requires: udev >= 145
-%endif
-%if %{with_polkit}
-%if 0%{?fedora} >= 12 || 0%{?rhel} >=6
-Requires: polkit >= 0.93
-%else
-Requires: PolicyKit >= 0.6
-%endif
-%endif
-%if %{with_storage_fs}
-Requires: nfs-utils
-# For mkfs
-Requires: util-linux-ng
-# For pool-build probing for existing pools
-BuildRequires: libblkid-devel >= 2.17
-# For glusterfs
-%if 0%{?fedora} >= 11
-Requires: glusterfs-client >= 2.0.1
-%endif
-%endif
-%if %{with_qemu}
-# From QEMU RPMs
-Requires: /usr/bin/qemu-img
-# For image compression
-Requires: gzip
-Requires: bzip2
-Requires: lzop
-Requires: xz
-%else
-%if %{with_xen}
-# From Xen RPMs
-Requires: /usr/sbin/qcow-create
-%endif
-%endif
-%if %{with_storage_lvm}
-# For LVM drivers
-Requires: lvm2
-%endif
-%if %{with_storage_iscsi}
-# For ISCSI driver
-Requires: iscsi-initiator-utils
-%endif
-%if %{with_storage_disk}
-# For disk driver
-Requires: parted
-Requires: device-mapper
-%endif
-%if %{with_storage_mpath}
-# For multipath support
-Requires: device-mapper
-%endif
-%if %{with_cgconfig}
-Requires: libcgroup
-%endif
-%ifarch %{ix86} x86_64 ia64
-# For virConnectGetSysinfo
-Requires: dmidecode
-%endif
-# For service management
-%if %{with_systemd}
-Requires(post): systemd-units
-Requires(post): systemd-sysv
-Requires(preun): systemd-units
-Requires(postun): systemd-units
-%endif
-%if %{with_numad}
-Requires: numad
+Requires: libvirt-daemon = %{version}-%{release}
+Requires: libvirt-daemon-configs = %{version}-%{release}
+# XXX when we turn on driver modules, we need to add
+# deps on each driver (Requires: libvirt-daemon-drv-qemu)
%endif
+Requires: libvirt-docs = %{version}-%{release}
+Requires: libvirt-client = %{version}-%{release}
-# All build-time requirements
+# All build-time requirements. Run-time requirements are
+# listed against each sub-RPM
%if 0%{?enable_autotools}
BuildRequires: autoconf
BuildRequires: automake
@@ -537,6 +457,271 @@ Libvirt is a C toolkit to interact with the virtualization capabilities
of recent versions of Linux (and other OSes). The main package includes
the libvirtd server exporting the virtualization support.
+%if %{with_libvirtd}
+%package daemon
+Summary: Server side daemon and supporting files for libvirt library
+Group: Development/Libraries
+
+# All runtime requirements for the libvirt package (runtime requrements
+# for subpackages are listed later in those subpackages)
+
+# The client side, i.e. shared libs and virsh are in a subpackage
+Requires: %{name}-client = %{version}-%{release}
+
+# Used by many of the drivers, so turn it on whenever the
+# daemon is present
+%if %{with_libvirtd}
+# for modprobe of pci devices
+Requires: module-init-tools
+# for /sbin/ip & /sbin/tc
+Requires: iproute
+%if %{with_avahi}
+Requires: avahi-libs
+%endif
+%endif
+%if %{with_network}
+Requires: dnsmasq >= 2.41
+Requires: radvd
+%endif
+%if %{with_network} || %{with_nwfilter}
+Requires: iptables
+Requires: iptables-ipv6
+%endif
+%if %{with_nwfilter}
+Requires: ebtables
+%endif
+# needed for device enumeration
+%if %{with_hal}
+Requires: hal
+%endif
+%if %{with_udev}
+Requires: udev >= 145
+%endif
+%if %{with_polkit}
+%if 0%{?fedora} >= 12 || 0%{?rhel} >=6
+Requires: polkit >= 0.93
+%else
+Requires: PolicyKit >= 0.6
+%endif
+%endif
+%if %{with_storage_fs}
+Requires: nfs-utils
+# For mkfs
+Requires: util-linux-ng
+# For pool-build probing for existing pools
+BuildRequires: libblkid-devel >= 2.17
+# For glusterfs
+%if 0%{?fedora} >= 11
+Requires: glusterfs-client >= 2.0.1
+%endif
+%endif
+%if %{with_qemu}
+# From QEMU RPMs
+Requires: /usr/bin/qemu-img
+# For image compression
+Requires: gzip
+Requires: bzip2
+Requires: lzop
+Requires: xz
+%else
+%if %{with_xen}
+# From Xen RPMs
+Requires: /usr/sbin/qcow-create
+%endif
+%endif
+%if %{with_storage_lvm}
+# For LVM drivers
+Requires: lvm2
+%endif
+%if %{with_storage_iscsi}
+# For ISCSI driver
+Requires: iscsi-initiator-utils
+%endif
+%if %{with_storage_disk}
+# For disk driver
+Requires: parted
+Requires: device-mapper
+%endif
+%if %{with_storage_mpath}
+# For multipath support
+Requires: device-mapper
+%endif
+%if %{with_cgconfig}
+Requires: libcgroup
+%endif
+%ifarch %{ix86} x86_64 ia64
+# For virConnectGetSysinfo
+Requires: dmidecode
+%endif
+# For service management
+%if %{with_systemd}
+Requires(post): systemd-units
+Requires(post): systemd-sysv
+Requires(preun): systemd-units
+Requires(postun): systemd-units
+%endif
+%if %{with_numad}
+Requires: numad
+%endif
+
+%package docs
+Summary: Documentation for libvirt library and daemon
+Group: Development/Libraries
+
+%description docs
+Copy of the libvirt website documentation
+
+%description daemon
+Server side daemon required to manage the virtualization capabilities
+of recent versions of Linux. Requires a hypervisor specific sub-RPM
+for specific drivers.
+
+%package daemon-configs
+Summary: Default configuration files for the libvirtd daemon
+Group: Development/Libraries
+
+Requires: libvirt-daemon = %{version}-%{release}
+
+%description daemon-configs
+Default configuration files for setting up NAT based networking
+and guest network traffic filtering.
+%endif
+
+# XXX when we turn on driver modules, we will need to
+# create daemon-drv-XXX sub-RPMs and add them as deps
+# to all of the following daemon-XXX RPMs
+
+%if %{with_qemu_tcg}
+%package daemon-qemu
+Summary: Server side daemon & driver required to run QEMU guests
+Group: Development/Libraries
+
+Requires: libvirt-daemon = %{version}-%{release}
+Requires: qemu
+%endif
+
+%if %{with_qemu_kvm}
+%package daemon-kvm
+Summary: Server side daemon & driver required to run QEMU guests
+Group: Development/Libraries
+
+Requires: libvirt-daemon = %{version}-%{release}
+Requires: qemu-kvm
+%endif
+
+%if %{with_qemu_tcg}
+%description daemon-qemu
+Server side daemon and driver required to manage the virtualization
+capabilities of the QEMU TCG emulators
+%endif
+
+%if %{with_qemu_kvm}
+%description daemon-kvm
+Server side daemon and driver required to manage the virtualization
+capabilities of the QEMU KVM hypervisor
+%endif
+
+%if %{with_qemu_tcg}
+%package qemu
+Summary: Server side daemon, driver & default configs required to run QEMU guests
+Group: Development/Libraries
+
+Requires: libvirt-daemon-qemu = %{version}-%{release}
+Requires: libvirt-configs = %{version}-%{release}
+
+%description qemu
+Server side daemon, driver and default network & firewall configs
+required to manage the virtualization capabilities of QEMU.
+%endif
+
+%if %{with_qemu_kvm}
+%package kvm
+Summary: Server side daemon, driver & default configs required to run KVM guests
+Group: Development/Libraries
+
+Requires: libvirt-daemon-kvm = %{version}-%{release}
+Requires: libvirt-configs = %{version}-%{release}
+
+%description kvm
+Server side daemon, driver and default network & firewall configs
+required to manage the virtualization capabilities of KVM.
+%endif
+
+
+%if %{with_lxc}
+%package daemon-lxc
+Summary: Server side daemon & driver required to run LXC guests
+Group: Development/Libraries
+
+Requires: libvirt-daemon = %{version}-%{release}
+Requires: lxc
+
+%description daemon-lxc
+Server side daemon and driver required to manage the virtualization
+capabilities of LXC
+
+%package lxc
+Summary: Server side daemon, driver & default configs required to run LXC guests
+Group: Development/Libraries
+
+Requires: libvirt-daemon-lxc = %{version}-%{release}
+Requires: libvirt-configs = %{version}-%{release}
+
+%description lxc
+Server side daemon, driver and default network & firewall configs
+required to manage the virtualization capabilities of LXC.
+%endif
+
+
+%if %{with_uml}
+%package daemon-uml
+Summary: Server side daemon & driver required to run UML guests
+Group: Development/Libraries
+
+Requires: libvirt-daemon = %{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
+
+%package uml
+Summary: Server side daemon, driver & default configs required to run UML guests
+Group: Development/Libraries
+
+Requires: libvirt-daemon-uml = %{version}-%{release}
+Requires: libvirt-configs = %{version}-%{release}
+
+%description uml
+Server side daemon, driver and default network & firewall configs
+required to manage the virtualization capabilities of UML.
+%endif
+
+
+%if %{with_xen}
+%package daemon-xen
+Summary: Server side daemon & driver required to run XEN guests
+Group: Development/Libraries
+
+Requires: libvirt-daemon = %{version}-%{release}
+Requires: xen
+
+%description daemon-xen
+Server side daemon and driver required to manage the virtualization
+capabilities of XEN
+
+%package xen
+Summary: Server side daemon, driver & default configs required to run XEN guests
+Group: Development/Libraries
+
+Requires: libvirt-daemon-xen = %{version}-%{release}
+Requires: libvirt-configs = %{version}-%{release}
+
+%description xen
+Server side daemon, driver and default network & firewall configs
+required to manage the virtualization capabilities of Xen.
+%endif
+
%package client
Summary: Client side library and utilities of the libvirt library
Group: Development/Libraries
@@ -582,7 +767,7 @@ Group: Development/Libraries
Requires: sanlock >= 1.8
#for virt-sanlock-cleanup require augeas
Requires: augeas
-Requires: %{name} = %{version}-%{release}
+Requires: %{name}-daemon = %{version}-%{release}
%description lock-sanlock
Includes the Sanlock lock manager plugin for the QEMU
@@ -811,8 +996,7 @@ autoreconf -if
%{with_packager_version} \
--with-qemu-user=%{qemu_user} \
--with-qemu-group=%{qemu_group} \
- %{init_scripts} \
- --with-remote-pid-file=%{_localstatedir}/run/libvirtd.pid
+ %{init_scripts}
make %{?_smp_mflags}
gzip -9 ChangeLog
@@ -884,6 +1068,8 @@ rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.lxc
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.uml
%endif
+mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-%{version} $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-docs-%{version}
+
%clean
rm -fr %{buildroot}
@@ -898,7 +1084,8 @@ do
done
make check
-%pre
+%if %{with_libvirtd}
+%pre daemon
%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
# Normally 'setup' adds this in /etc/passwd, but this is
# here for case of upgrades from earlier Fedora/RHEL. This
@@ -910,22 +1097,9 @@ getent passwd qemu >/dev/null || \
-c "qemu user" qemu
%endif
-%post
+%post daemon
-%if %{with_libvirtd}
%if %{with_network}
-# We want to install the default network for initial RPM installs
-# or on the first upgrade from a non-network aware libvirt only.
-# We check this by looking to see if the daemon is already installed
-if ! /sbin/chkconfig libvirtd && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml
-then
- UUID=`/usr/bin/uuidgen`
- sed -e "s,</name>,</name>\n <uuid>$UUID</uuid>," \
- < %{_datadir}/libvirt/networks/default.xml \
- > %{_sysconfdir}/libvirt/qemu/networks/default.xml
- ln -s ../default.xml %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
-fi
-
# All newly defined networks will have a mac address for the bridge
# auto-generated, but networks already existing at the time of upgrade
# will not. We need to go through all the network configs, look for
@@ -991,8 +1165,8 @@ fi
%endif
%endif
-%preun
%if %{with_libvirtd}
+%preun daemon
%if %{with_systemd}
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
@@ -1007,8 +1181,8 @@ fi
%endif
%endif
-%postun
%if %{with_libvirtd}
+%postun daemon
%if %{with_systemd}
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
@@ -1019,6 +1193,20 @@ fi
%endif
%if %{with_libvirtd}
+%if %{with_network}
+%post daemon-configs
+if [ $1 -eq 1 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml ] ; then
+ UUID=`/usr/bin/uuidgen`
+ sed -e "s,</name>,</name>\n <uuid>$UUID</uuid>," \
+ < %{_datadir}/libvirt/networks/default.xml \
+ > %{_sysconfdir}/libvirt/qemu/networks/default.xml
+ ln -s ../default.xml %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
+fi
+%endif
+%endif
+
+
+%if %{with_libvirtd}
%if %{with_systemd}
%triggerun -- libvirt < 0.9.4
%{_bindir}/systemd-sysv-convert --save libvirtd >/dev/null 2>&1 ||:
@@ -1064,10 +1252,19 @@ fi
/bin/systemctl try-restart libvirt-guests.service >/dev/null 2>&1 || :
%endif
-%if %{with_libvirtd}
%files
%defattr(-, root, root)
+%files docs
+%defattr(-, root, root)
+%dir %{_datadir}/doc/libvirt-docs-%{version}
+%dir %{_datadir}/doc/libvirt-docs-%{version}/html
+%{_datadir}/doc/libvirt-docs-%{version}/html/*
+
+%if %{with_libvirtd}
+%files daemon
+%defattr(-, root, root)
+
%doc AUTHORS ChangeLog.gz NEWS README COPYING.LIB TODO
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/
@@ -1078,7 +1275,6 @@ fi
%endif
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/
-%{_sysconfdir}/libvirt/nwfilter/*.xml
%{_sysconfdir}/rc.d/init.d/libvirtd
%if %{with_systemd}
@@ -1190,8 +1386,42 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sysctl.d/libvirtd
%{_mandir}/man8/libvirtd.8*
%doc docs/*.xml
+
+%files daemon-configs
+%defattr(-, root, root)
+%{_sysconfdir}/libvirt/nwfilter/*.xml
%endif
+%files daemon-qemu
+%defattr(-, root, root)
+
+%files daemon-kvm
+%defattr(-, root, root)
+
+%files daemon-lxc
+%defattr(-, root, root)
+
+%files daemon-uml
+%defattr(-, root, root)
+
+%files daemon-xen
+%defattr(-, root, root)
+
+%files qemu
+%defattr(-, root, root)
+
+%files kvm
+%defattr(-, root, root)
+
+%files lxc
+%defattr(-, root, root)
+
+%files uml
+%defattr(-, root, root)
+
+%files xen
+%defattr(-, root, root)
+
%if %{with_sanlock}
%files lock-sanlock
%defattr(-, root, root)
--
1.7.7.6
12 years, 8 months
[libvirt] [PATCH v2] qemu_agent: Issue guest-sync prior to every command
by Michal Privoznik
If we issue guest command and GA is not running, the issuing thread
will block endlessly. We can check for GA presence by issuing
guest-sync with unique ID (timestamp). We don't want to issue real
command as even if GA is not running, once it is started, it process
all commands written to GA socket.
---
diff to v1:
- don't keep list of issued IDs because it's pointless
Some background on this:
I've intended to switch to new guest-sync-delimited and use
older guest-sync for older GA. However, since we don't use
stream base implementation but use new line as delimiter for
GA responses we don't need GA to issue sentinel byte 0xFF for us:
http://wiki.qemu.org/Features/QAPI/GuestAgent#QEMU_Guest_Agent_Protocol
Moreover, since we are using guest-sync just for detecting GA, it is
not necessary to use sentinel byte at all:
http://lists.nongnu.org/archive/html/qemu-devel/2012-03/msg03278.html
src/qemu/qemu_agent.c | 134 ++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 128 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
index a17d025..ee82fae 100644
--- a/src/qemu/qemu_agent.c
+++ b/src/qemu/qemu_agent.c
@@ -39,6 +39,7 @@
#include "virterror_internal.h"
#include "json.h"
#include "virfile.h"
+#include "virtime.h"
#define VIR_FROM_THIS VIR_FROM_QEMU
@@ -316,6 +317,7 @@ qemuAgentIOProcessLine(qemuAgentPtr mon,
{
virJSONValuePtr obj = NULL;
int ret = -1;
+ unsigned long long id;
VIR_DEBUG("Line [%s]", line);
@@ -340,6 +342,20 @@ qemuAgentIOProcessLine(qemuAgentPtr mon,
obj = NULL;
ret = 0;
} else {
+ /* If we've received something like:
+ * {"return": 1234}
+ * it is likely that somebody started GA
+ * which is now processing our previous
+ * guest-sync commands. Check if this is
+ * the case and don't report an error but
+ * return silently.
+ */
+ if (virJSONValueObjectGetNumberUlong(obj, "return", &id) == 0) {
+ VIR_DEBUG("Ignoring delayed reply to guest-sync: %llu", id);
+ ret = 0;
+ goto cleanup;
+ }
+
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Unexpected JSON reply '%s'"), line);
}
@@ -813,11 +829,28 @@ void qemuAgentClose(qemuAgentPtr mon)
qemuAgentUnlock(mon);
}
+#define QEMU_AGENT_WAIT_TIME (1000ull * 5)
+/**
+ * qemuAgentSend:
+ * @mon: Monitor
+ * @msg: Message
+ * @timeout: use timeout?
+ *
+ * Send @msg to agent @mon.
+ * Wait max QEMU_AGENT_WAIT_TIME for agent
+ * to reply.
+ *
+ * Returns: 0 on success,
+ * -2 on timeout,
+ * -1 otherwise
+ */
static int qemuAgentSend(qemuAgentPtr mon,
- qemuAgentMessagePtr msg)
+ qemuAgentMessagePtr msg,
+ bool timeout)
{
int ret = -1;
+ unsigned long long now, then;
/* Check whether qemu quit unexpectedly */
if (mon->lastError.code != VIR_ERR_OK) {
@@ -827,13 +860,26 @@ static int qemuAgentSend(qemuAgentPtr mon,
return -1;
}
+ if (timeout) {
+ if (virTimeMillisNow(&now) < 0)
+ return -1;
+ then = now + QEMU_AGENT_WAIT_TIME;
+ }
+
mon->msg = msg;
qemuAgentUpdateWatch(mon);
while (!mon->msg->finished) {
- if (virCondWait(&mon->notify, &mon->lock) < 0) {
- qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to wait on monitor condition"));
+ if ((timeout && virCondWaitUntil(&mon->notify, &mon->lock, then) < 0) ||
+ (!timeout && virCondWait(&mon->notify, &mon->lock) < 0)) {
+ if (errno == ETIMEDOUT) {
+ qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Guest agent not available for now"));
+ ret = -2;
+ } else {
+ qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to wait on monitor condition"));
+ }
goto cleanup;
}
}
@@ -855,6 +901,78 @@ cleanup:
}
+/**
+ * qemuAgentGuestSync:
+ * @mon: Monitor
+ *
+ * Send guest-sync with unique ID
+ * and wait for reply. If we get one, check if
+ * received ID is equal to given.
+ *
+ * Returns: 0 on success,
+ * -1 otherwise
+ */
+static int
+qemuAgentGuestSync(qemuAgentPtr mon)
+{
+ int ret = -1;
+ int send_ret;
+ unsigned long long id, id_ret;
+ qemuAgentMessage sync_msg;
+
+ memset(&sync_msg, 0, sizeof sync_msg);
+
+ if (virTimeMillisNow(&id) < 0)
+ return -1;
+
+ if (virAsprintf(&sync_msg.txBuffer,
+ "{\"execute\":\"guest-sync\", "
+ "\"arguments\":{\"id\":%llu}}", id) < 0) {
+ virReportOOMError();
+ return -1;
+ }
+
+ sync_msg.txLength = strlen(sync_msg.txBuffer);
+
+ VIR_DEBUG("Sending guest-sync command with ID: %llu", id);
+
+ send_ret = qemuAgentSend(mon, &sync_msg, true);
+
+ VIR_DEBUG("qemuAgentSend returned: %d", send_ret);
+
+ if (send_ret < 0) {
+ /* error reported */
+ goto cleanup;
+ }
+
+ if (!sync_msg.rxObject) {
+ qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Missing monitor reply object"));
+ goto cleanup;
+ }
+
+ if (virJSONValueObjectGetNumberUlong(sync_msg.rxObject,
+ "return", &id_ret) < 0) {
+ qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Malformed return value"));
+ goto cleanup;
+ }
+
+ VIR_DEBUG("Guest returned ID: %llu", id_ret);
+ if (id_ret != id) {
+ qemuReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Guest agent returned ID: %llu instead of %llu"),
+ id_ret, id);
+ goto cleanup;
+ }
+ ret = 0;
+
+cleanup:
+ virJSONValueFree(sync_msg.rxObject);
+ VIR_FREE(sync_msg.txBuffer);
+ return ret;
+}
+
static int
qemuAgentCommand(qemuAgentPtr mon,
virJSONValuePtr cmd,
@@ -866,6 +984,11 @@ qemuAgentCommand(qemuAgentPtr mon,
*reply = NULL;
+ if (qemuAgentGuestSync(mon) < 0) {
+ /* helper reported the error */
+ return -1;
+ }
+
memset(&msg, 0, sizeof msg);
if (!(cmdstr = virJSONValueToString(cmd))) {
@@ -880,12 +1003,11 @@ qemuAgentCommand(qemuAgentPtr mon,
VIR_DEBUG("Send command '%s' for write", cmdstr);
- ret = qemuAgentSend(mon, &msg);
+ ret = qemuAgentSend(mon, &msg, false);
VIR_DEBUG("Receive command reply ret=%d rxObject=%p",
ret, msg.rxObject);
-
if (ret == 0) {
if (!msg.rxObject) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
--
1.7.8.5
12 years, 8 months
[libvirt] [ANNOUNCE] libvirt-glib 0.0.7 release
by Daniel P. Berrange
am pleased to announce that a new release of the libvirt-glib package,
version 0.0.7 is now available from
ftp://libvirt.org/libvirt/glib/
The packages are GPG signed with
Key fingerprint: DAF3 A6FD B26B 6291 2D0E 8E3F BE86 EBB4 1510 4FDF (4096R)
New in this release:
- Fix typo in filesystem access mode constant
- Remove incorrect encoding of XML attributes
- Add support for USB redirection devices
- Add support for SPICE agent device
- Fix typo in channel device target constant
- Make all string getters return a const string
- Keep list of devices sorted in original XML order
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
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 redhat com development 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 :|
12 years, 8 months
[libvirt] [PATCH] virnetdevtap: Don't check for flags in virNetDevTapCreateFlags
by Michal Privoznik
With latest gnulib we are checking even the lowest level functions
whether they check flags. Moreover, we are shadowing the real error
on system without TUNSETIFF support.
---
cfg.mk | 2 +-
src/util/virnetdevtap.c | 5 +----
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/cfg.mk b/cfg.mk
index c3de533..d44c8d2 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -741,7 +741,7 @@ exclude_file_name_regexp--sc_avoid_write = \
exclude_file_name_regexp--sc_bindtextdomain = ^(tests|examples)/
-exclude_file_name_regexp--sc_flags_usage = ^docs/
+exclude_file_name_regexp--sc_flags_usage = ^(docs/|src/util/virnetdevtap\.c$$)
exclude_file_name_regexp--sc_libvirt_unmarked_diagnostics = \
^src/rpc/gendispatch\.pl$$
diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c
index 717b6ac..54f76bd 100644
--- a/src/util/virnetdevtap.c
+++ b/src/util/virnetdevtap.c
@@ -129,14 +129,12 @@ virNetDevProbeVnetHdr(int tapfd)
*/
int virNetDevTapCreate(char **ifname,
int *tapfd,
- unsigned int flags)
+ unsigned int flags ATTRIBUTE_UNUSED)
{
int fd;
struct ifreq ifr;
int ret = -1;
- virCheckFlags(VIR_NETDEV_TAP_CREATE_VNET_HDR, -1);
-
if ((fd = open("/dev/net/tun", O_RDWR)) < 0) {
virReportSystemError(errno, "%s",
_("Unable to open /dev/net/tun, is tun module loaded?"));
@@ -241,7 +239,6 @@ int virNetDevTapCreate(char **ifname ATTRIBUTE_UNUSED,
int *tapfd ATTRIBUTE_UNUSED,
unsigned int flags)
{
- virCheckFlags(0, -1);
virReportSystemError(ENOSYS, "%s",
_("Unable to create TAP devices on this platform"));
return -1;
--
1.7.8.5
12 years, 8 months