diff --git a/fs-storage-driver.patch b/fs-storage-driver.patch new file mode 100644 index 0000000..2429882 --- /dev/null +++ b/fs-storage-driver.patch @@ -0,0 +1,61 @@ +Index: libvirt-0.4.4/src/storage_backend_fs.c +=================================================================== +--- libvirt-0.4.4.orig/src/storage_backend_fs.c ++++ libvirt-0.4.4/src/storage_backend_fs.c +@@ -455,7 +455,9 @@ virStorageBackendFileSystemIsMounted(vir + virStoragePoolObjPtr pool) { + FILE *mtab; + struct mntent *ent; +- ++ char *mpoint; ++ size_t len; ++ + if ((mtab = fopen(_PATH_MOUNTED, "r")) == NULL) { + virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR, + _("cannot read %s: %s"), +@@ -463,14 +465,27 @@ virStorageBackendFileSystemIsMounted(vir + return -1; + } + ++ if ((mpoint = strdup(pool->def->target.path)) == NULL) { ++ virStorageReportError(conn, VIR_ERR_NO_MEMORY, ++ "%s", strerror(errno)); ++ return -1; ++ } ++ ++ len = strlen(mpoint); ++ if (mpoint[len-1] == '/') ++ mpoint[len-1] = NULL; ++ ++ + while ((ent = getmntent(mtab)) != NULL) { +- if (STREQ(ent->mnt_dir, pool->def->target.path)) { ++ if (STREQ(ent->mnt_dir, mpoint)) { + fclose(mtab); ++ free(mpoint); + return 1; + } + } + + fclose(mtab); ++ free(mpoint); + return 0; + } + +@@ -797,12 +812,16 @@ virStorageBackendFileSystemDelete(virCon + { + /* XXX delete all vols first ? */ + ++ /* target.path is never created AFAIKT, so dont delete it. */ ++#if 0 ++ + if (unlink(pool->def->target.path) < 0) { + virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR, + _("cannot unlink path '%s': %s"), + pool->def->target.path, strerror(errno)); + return -1; + } ++#endif + + return 0; + } diff --git a/libvirt.changes b/libvirt.changes index c7e800a..466ba88 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,30 @@ +------------------------------------------------------------------- +Fri Aug 29 17:37:53 MDT 2008 - jfehlig@novell.com + +- Fixed bugs in nfs storage pool creation/deletion + +------------------------------------------------------------------- +Thu Aug 28 18:23:42 MDT 2008 - jfehlig@novell.com + +- Fixed bugs in LVM storage pool creation. + logical-storage-driver.patch submitted upstream + +------------------------------------------------------------------- +Wed Aug 27 11:35:45 MDT 2008 - jfehlig@novell.com + +- Changed mDNS advertisement of libvirtd service to disabled by + default. Enable in libvirtd.conf. +- Disable libvirtd from listening on TLS socket by default. User + must enable after setting up CA and issuing certificates. + +------------------------------------------------------------------- +Mon Aug 25 14:53:33 MDT 2008 - jfehlig@novell.com + +- Enabled iscsi storage driver support +- Enabled ssh transport using socat. SuSE's version of netcat + does not support connecting to UDS. +- Fixed spec file breakage due to SELinux enablement + ------------------------------------------------------------------- Fri Aug 22 17:07:08 CEST 2008 - prusnak@suse.cz diff --git a/libvirt.spec b/libvirt.spec index 710df60..cf2b347 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -19,17 +19,18 @@ %define with_xen 1 %define with_lxc 0 +%define with_selinux 0 # Xen is available only on i386 x86_64 ia64 %ifnarch i386 i586 x86_64 ia64 %define with_xen 0 %endif %if 0%{?suse_version} > 1100 %define with_lxc 1 +%define with_selinux 1 %endif Name: libvirt BuildRequires: PolicyKit-devel bridge-utils cyrus-sasl-devel fdupes gettext gnutls-devel iptables-devel libxml2-devel lvm2 ncurses-devel parted-devel pkg-config python-devel readline-devel util-linux xhtml-dtd -BuildRequires: libselinux-devel %if %{with_xen} BuildRequires: xen-devel %endif @@ -38,6 +39,9 @@ BuildRequires: libavahi-devel %else BuildRequires: avahi-devel %endif +%if %{with_selinux} +BuildRequires: libselinux-devel +%endif # Only for directory ownership: BuildRequires: gtk-doc Url: http://libvirt.org/ @@ -45,7 +49,7 @@ License: LGPL v2.1 or later Group: Development/Libraries/C and C++ AutoReqProv: yes Version: 0.4.4 -Release: 21 +Release: 28 Summary: A C toolkit to interract with the virtualization capabilities of Linux Requires: readline Requires: ncurses @@ -57,9 +61,14 @@ Requires: parted Recommends: cyrus-sasl-digestmd5 Requires: dnsmasq Requires: PolicyKit >= 0.6 +Requires: socat Source0: %{name}-%{version}.tar.bz2 Source1: libvirtd.init Patch0: libvirtd-polkit.patch +Patch1: socat.patch +Patch2: libvirtd-defaults.patch +Patch3: logical-storage-driver.patch +Patch4: fs-storage-driver.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -151,6 +160,10 @@ Authors: %prep %setup -q %patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 rm po/no.* %build @@ -160,18 +173,21 @@ rm po/no.* %if %{with_lxc} %define _with_lxc --with-lxc %endif +%if %{with_selinux} +%define _with_selinux --with-selinux +%endif autoreconf -f -i export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" %configure %{?_without_xen} \ %{?_with_lxc} \ + %{?_with_selinux} \ --libexecdir=%{_libdir}/%{name} \ - --with-selinux \ --with-init-script=none \ --with-remote-pid-file=%{_localstatedir}/run/libvirtd.pid \ - --with-storage-iscsi=no \ --with-xen-proxy=no \ ac_cv_path_DNSMASQ=/usr/sbin/dnsmasq \ - ac_cv_path_QEMU_IMG=/usr/bin/qemu-img + ac_cv_path_QEMU_IMG=/usr/bin/qemu-img \ + ac_cv_path_ISCSIADM=/sbin/iscsiadm make DOCS_DIR=%{_docdir}/%{name}-python EXAMPLE_DIR=%{_docdir}/%{name}-python/examples HTML_DIR=%{_docdir}/%{name} cd docs/examples ; make index.html ; cd ../.. @@ -272,6 +288,21 @@ rm -rf $RPM_BUILD_ROOT %{py_sitedir}/libvirtmod* %changelog +* Fri Aug 29 2008 jfehlig@novell.com +- Fixed bugs in nfs storage pool creation/deletion +* Thu Aug 28 2008 jfehlig@novell.com +- Fixed bugs in LVM storage pool creation. + logical-storage-driver.patch submitted upstream +* Wed Aug 27 2008 jfehlig@novell.com +- Changed mDNS advertisement of libvirtd service to disabled by + default. Enable in libvirtd.conf. +- Disable libvirtd from listening on TLS socket by default. User + must enable after setting up CA and issuing certificates. +* Mon Aug 25 2008 jfehlig@novell.com +- Enabled iscsi storage driver support +- Enabled ssh transport using socat. SuSE's version of netcat + does not support connecting to UDS. +- Fixed spec file breakage due to SELinux enablement * Fri Aug 22 2008 prusnak@suse.cz - enabled SELinux support [Fate#303662] * Tue Aug 12 2008 jfehlig@novell.com @@ -298,12 +329,12 @@ rm -rf $RPM_BUILD_ROOT suse procedures. bnc#388769 * Mon May 05 2008 jfehlig@novell.com - Fix path to iptables. bnc#386280 -* Fri Apr 25 2008 jfehlig@novell.com +* Thu Apr 24 2008 jfehlig@novell.com - Fix Xen 3.2 hypercalls. bnc#378798 * Thu Apr 10 2008 jfehlig@novell.com - Fix NULL pointer dereference in auth callback. bnc#373180, bnc#354995 -* Thu Jan 10 2008 jfehlig@novell.com +* Wed Jan 09 2008 jfehlig@novell.com - Remove Requires of nc package. netcat is the equivalent but it does not support unix domain sockets so no need to require it either. @@ -317,7 +348,7 @@ rm -rf $RPM_BUILD_ROOT - Documentation: example files for QEMU and libvirtd configuations, authentication documentation updates - Bug fixes, improvements and code cleanup -* Wed Oct 10 2007 jfehlig@novell.com +* Tue Oct 09 2007 jfehlig@novell.com - Updated to libvirt 0.3.3 - Avahi mDNS daemon export - NUMA support @@ -328,11 +359,11 @@ rm -rf $RPM_BUILD_ROOT to be a subtle dependency issue in one of the makefiles which is causing problems with generation of python bindings when jobs > 1. Bug #329032. -* Tue Aug 21 2007 jfehlig@novell.com +* Mon Aug 20 2007 jfehlig@novell.com - Added init script for libvirtd. libvirtd is needed to support management of qemu/kvm guests. Some Xen networking is handled through libvirt as well - bug #298021. -* Tue Jul 24 2007 jfehlig@novell.com +* Mon Jul 23 2007 jfehlig@novell.com - Update to libvirt-0.3.0 - Secure Remote support - Documentation: remote support, description of the URI connection @@ -373,14 +404,14 @@ rm -rf $RPM_BUILD_ROOT - Fixed docdir destination. - Build with CFLAGS. - Spec file cleanup. -* Wed Feb 21 2007 jfehlig@novell.com +* Tue Feb 20 2007 jfehlig@novell.com - Removed usr/lib/libvirt_proxy setuid binary from package. Fixes bug #246610. -* Sat Feb 17 2007 jfehlig@novell.com +* Fri Feb 16 2007 jfehlig@novell.com - Updated to latest release. Many of the issues seen in virt-manager have been caused by bugs / missing functionality in libvirt. This upate provides a better basis for virt-manager. -* Thu Jan 11 2007 jfehlig@novell.com +* Wed Jan 10 2007 jfehlig@novell.com - Updated to latest release, version 0.1.10. Submitting to SLES10 SP1 to provide base functionality for FATE feature 301181. - more localizations @@ -392,7 +423,7 @@ rm -rf $RPM_BUILD_ROOT - support graphic framebuffer for Xen paravirt (Daniel Berrange) - VNC listen IP range support (Daniel Berrange) - support for default Xen config files and inactive domains of 3.0.4 (Daniel Berrange) -* Sat Dec 09 2006 jfehlig@novell.com +* Fri Dec 08 2006 jfehlig@novell.com - Updated to latest release, version 0.1.9. - python bindings: release interpeter lock when calling C (Daniel Berrange) - don't raise HTTP error when looking informations for a domain @@ -433,10 +464,10 @@ rm -rf $RPM_BUILD_ROOT * Tue Sep 26 2006 jfehlig@novell.com - Updated to latest release, version 0.1.6. This release includes fix in hypercall driver so local patch has been removed. -* Thu Sep 14 2006 jfehlig@novell.com +* Wed Sep 13 2006 jfehlig@novell.com - Fixed bug in hypercall driver introduced in version 0.1.5. Patch sumbmitted upstream and included locally until next release. -* Tue Sep 12 2006 jfehlig@novell.com +* Mon Sep 11 2006 jfehlig@novell.com - Updated to latest release, version 0.1.5 - Support for new hypercalls change in Xen changeset 86d26e6ec89b - bug fixes: virParseUUID() was wrong, netwoking for paravirt guestsi diff --git a/libvirtd-defaults.patch b/libvirtd-defaults.patch new file mode 100644 index 0000000..b2a6e67 --- /dev/null +++ b/libvirtd-defaults.patch @@ -0,0 +1,52 @@ +Index: libvirt-0.4.4/qemud/libvirtd.conf +=================================================================== +--- libvirt-0.4.4.orig/qemud/libvirtd.conf ++++ libvirt-0.4.4/qemud/libvirtd.conf +@@ -15,8 +15,8 @@ + # It is necessary to setup a CA and issue server certificates before + # using this capability. + # +-# This is enabled by default, uncomment this to disable it +-#listen_tls = 0 ++# This is disabled by default, uncomment this to enable it ++#listen_tls = 1 + + # Listen for unencrypted TCP connections on the public TCP/IP port. + # NB, must pass the --listen flag to the libvirtd process for this to +@@ -50,11 +50,9 @@ + + # Flag toggling mDNS advertizement of the libvirt service. + # +-# Alternatively can disable for all services on a host by +-# stopping the Avahi daemon +-# +-# This is enabled by default, uncomment this to disable it +-#mdns_adv = 0 ++# Disabled by default. To enable, ensure the Avahi daemon is ++# running and uncomment this flag. ++#mdns_adv = 1 + + # Override the default mDNS advertizement name. This must be + # unique on the immediate broadcast network. +Index: libvirt-0.4.4/qemud/qemud.c +=================================================================== +--- libvirt-0.4.4.orig/qemud/qemud.c ++++ libvirt-0.4.4/qemud/qemud.c +@@ -68,7 +68,7 @@ static int sigwrite = -1; /* Signa + static int ipsock = 0; /* -l Listen for TCP/IP */ + + /* Defaults for configuration file elements */ +-static int listen_tls = 1; ++static int listen_tls = 0; + static int listen_tcp = 0; + static char *listen_addr = (char *) LIBVIRTD_LISTEN_ADDR; + static char *tls_port = (char *) LIBVIRTD_TLS_PORT; +@@ -92,7 +92,7 @@ static int auth_tcp = REMOTE_AUTH_NONE; + #endif + static int auth_tls = REMOTE_AUTH_NONE; + +-static int mdns_adv = 1; ++static int mdns_adv = 0; + static char *mdns_name = NULL; + + static int tls_no_verify_certificate = 0; diff --git a/logical-storage-driver.patch b/logical-storage-driver.patch new file mode 100644 index 0000000..625d05e --- /dev/null +++ b/logical-storage-driver.patch @@ -0,0 +1,21 @@ +Index: libvirt-0.4.4/src/storage_backend_logical.c +=================================================================== +--- libvirt-0.4.4.orig/src/storage_backend_logical.c ++++ libvirt-0.4.4/src/storage_backend_logical.c +@@ -280,7 +280,7 @@ virStorageBackendLogicalBuildPool(virCon + memset(zeros, 0, sizeof(zeros)); + + /* XXX multiple pvs */ +- if (VIR_ALLOC_N(vgargv, 1) < 0) { ++ if (VIR_ALLOC_N(vgargv, 3 + pool->def->source.ndevice) < 0) { + virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("command line")); + return -1; + } +@@ -531,6 +531,7 @@ virStorageBackend virStorageBackendLogic + .deleteVol = virStorageBackendLogicalDeleteVol, + + .poolOptions = { ++ .flags = (VIR_STORAGE_BACKEND_POOL_SOURCE_DEVICE), + .formatFromString = virStorageBackendLogicalPoolFormatFromString, + .formatToString = virStorageBackendLogicalPoolFormatToString, + }, diff --git a/socat.patch b/socat.patch new file mode 100644 index 0000000..6c01965 --- /dev/null +++ b/socat.patch @@ -0,0 +1,30 @@ +Index: libvirt-0.4.4/src/remote_internal.c +=================================================================== +--- libvirt-0.4.4.orig/src/remote_internal.c ++++ libvirt-0.4.4/src/remote_internal.c +@@ -660,9 +660,22 @@ doRemoteOpen (virConnectPtr conn, + cmd_argv[j++] = strdup ("none"); + } + cmd_argv[j++] = strdup (priv->hostname); +- cmd_argv[j++] = strdup (netcat ? netcat : "nc"); +- cmd_argv[j++] = strdup ("-U"); +- cmd_argv[j++] = strdup (sockname ? sockname : LIBVIRTD_PRIV_UNIX_SOCKET); ++ if (netcat) { ++ cmd_argv[j++] = strdup (netcat); ++ cmd_argv[j++] = strdup ("-U"); ++ cmd_argv[j++] = strdup (sockname ? sockname : LIBVIRTD_PRIV_UNIX_SOCKET); ++ } else { ++ cmd_argv[j++] = strdup ("socat"); ++ cmd_argv[j++] = strdup ("-"); ++ ++ char *socat_addr = 0; ++ if ((asprintf (&socat_addr, "GOPEN:%s", ++ sockname ? sockname : LIBVIRTD_PRIV_UNIX_SOCKET)) < 0) { ++ error (conn, VIR_ERR_SYSTEM_ERROR, strerror (ENOMEM)); ++ goto failed; ++ } ++ cmd_argv[j++] = socat_addr; ++ } + cmd_argv[j++] = 0; + assert (j == nr_args); + for (j = 0; j < (nr_args-1); j++) {