Update to libvirt 0.8.0

OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=46
This commit is contained in:
James Fehlig 2010-04-13 00:31:59 +00:00 committed by Git OBS Bridge
parent 0aa1caddc0
commit d4d5a5f4e3
13 changed files with 96 additions and 142 deletions

View File

@ -1,26 +0,0 @@
commit b7a7b3365145f6e9e434a3265a58666cd2e6d8dd
Author: Guido Günther <agx@sigxcpu.org>
Date: Wed Mar 17 21:04:11 2010 +0100
Don't crash without a security driver
"virsh dominfo <vm>" crashes if there's no primary security driver set
since we only intialize the secmodel.model and secmodel.doi if we have
one. Attached patch checks for securityPrimaryDriver instead of
securityDriver since the later is always set in qemudSecurityInit().
Closes: http://bugs.debian.org/574359
Index: libvirt-0.7.7/src/qemu/qemu_driver.c
===================================================================
--- libvirt-0.7.7.orig/src/qemu/qemu_driver.c
+++ libvirt-0.7.7/src/qemu/qemu_driver.c
@@ -4901,7 +4901,7 @@ static int qemudNodeGetSecurityModel(vir
int ret = 0;
qemuDriverLock(driver);
- if (!driver->securityDriver) {
+ if (!driver->securityPrimaryDriver) {
memset(secmodel, 0, sizeof (*secmodel));
goto cleanup;
}

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2f91e7437893aa66fa7f2bace9ec57967ee66ac80be5cb6bbfba0acce78eb708
size 6512919

3
libvirt-0.8.0.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:98ff762add810e318d2d586ea419219e71fe29f25f32eab20bae1cd9edbbc703
size 7478088

View File

@ -1,3 +1,19 @@
-------------------------------------------------------------------
Mon Apr 12 18:15:38 MDT 2010 - jfehlig@novell.com
- Update to libvirt 0.8.0
- Snapshot API framework
- Add managed save API entry points
- Timer subselection for domain clock
- Add hook utilities
- Network filtering API
- Introduce a new virDomainUpdateDeviceFlags public API
- Introduce a new public API for domain events
- Public virDomainMigrateSetMaxDowntime API
- Add public API for volume wiping
- xenapi: Initial commit of the new driver
- lots of improvements and bug fixes
-------------------------------------------------------------------
Fri Mar 26 17:20:11 MDT 2010 - jfehlig@novell.com

View File

@ -1,5 +1,5 @@
#
# spec file for package libvirt (Version 0.7.7)
# spec file for package libvirt (Version 0.8.0)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@ -113,7 +113,7 @@ Url: http://libvirt.org/
License: LGPLv2.1+
Group: Development/Libraries/C and C++
AutoReqProv: yes
Version: 0.7.7
Version: 0.8.0
Release: 1
Summary: A C toolkit to interract with the virtualization capabilities of Linux
# The client side, i.e. shared libs and virsh are in a subpackage
@ -138,20 +138,16 @@ Requires: PolicyKit >= 0.6
Source0: %{name}-%{version}.tar.bz2
Source1: libvirtd.init
# Upstream patches
Patch0: xen-name-for-devid.patch
Patch1: lxc-cgroup.patch
Patch2: fix-no-secdriver.patch
# Need to go upstream
Patch100: socat.patch
Patch101: clone.patch
Patch102: xen-pv-cdrom.patch
Patch103: xen-domctl-ver7.patch
Patch104: xen-tap2-support.patch
Patch105: xend-disk-order.patch
Patch100: xen-name-for-devid.patch
Patch101: socat.patch
Patch102: clone.patch
Patch103: xen-pv-cdrom.patch
Patch104: xen-domctl-ver7.patch
Patch105: xen-tap2-support.patch
Patch106: xend-disk-order.patch
# Our patches
Patch200: libvirtd-defaults.patch
Patch201: suse-network.patch
Patch202: snapshots.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@ -255,18 +251,14 @@ Authors:
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch100 -p1
%patch101
%patch102 -p1
%patch101 -p1
%patch102
%patch103 -p1
%patch104 -p1
%patch105 -p1
%patch106 -p1
%patch200 -p1
%patch201 -p1
%patch202 -p1
%build
%if ! %{with_xen}
@ -366,10 +358,15 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.*a $RPM_BUILD_ROOT%{py_sitedir}/*.*a
%if ! %{with_lxc}
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/lxc.conf
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_lxc.aug
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.lxc
%endif
%if ! %{with_qemu}
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu.conf
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_qemu.aug
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.qemu
%endif
%if ! %{with_uml}
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.uml
%endif
ln_dupes()
{
@ -422,10 +419,11 @@ rm -rf $RPM_BUILD_ROOT
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/autostart
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/
%{_sysconfdir}/libvirt/nwfilter/*.xml
%config /etc/init.d/libvirtd
%{_sbindir}/rclibvirtd
%config %{_sysconfdir}/libvirt/libvirtd.conf
%config %{_sysconfdir}/logrotate.d/libvirtd
%config %{_sysconfdir}/libvirt/qemu/networks/default.xml
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/network/
%dir %{_localstatedir}/run/libvirt/
@ -441,24 +439,27 @@ rm -rf $RPM_BUILD_ROOT
%endif
%{_datadir}/augeas
%if %{with_qemu}
%config %{_sysconfdir}/libvirt/qemu.conf
%config (noreplace)%{_sysconfdir}/libvirt/qemu.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.qemu
%dir %attr(0700, root, root) %{_localstatedir}/run/libvirt/qemu/
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/qemu/
%dir %attr(0700, root, root) %{_localstatedir}/cache/libvirt/qemu/
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/
%endif
%if %{with_lxc}
%config %{_sysconfdir}/libvirt/lxc.conf
%config(noreplace) %{_sysconfdir}/libvirt/lxc.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.lxc
%dir %attr(0700, root, root) %{_localstatedir}/run/libvirt/lxc/
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/lxc/
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/
%attr(0755, root, root) %{_libdir}/%{name}/libvirt_lxc
%endif
%if %{with_uml}
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.uml
%dir %attr(0700, root, root) %{_localstatedir}/run/libvirt/uml/
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/uml/
%endif
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/uml/
%endif
%if 0%{with_storage_disk}
%{_libdir}/%{name}/libvirt_parthelper
%endif
@ -489,6 +490,7 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/libvirt/schemas/secret.rng
%{_datadir}/libvirt/schemas/storageencryption.rng
%{_datadir}/libvirt/cpu_map.xml
%{_datadir}/libvirt/schemas/nwfilter.rng
%config %{_sysconfdir}/sasl2/libvirt.conf
%files devel

View File

@ -1,7 +1,7 @@
Index: libvirt-0.7.5/daemon/libvirtd.conf
Index: libvirt-0.8.0/daemon/libvirtd.conf
===================================================================
--- libvirt-0.7.5.orig/daemon/libvirtd.conf
+++ libvirt-0.7.5/daemon/libvirtd.conf
--- libvirt-0.8.0.orig/daemon/libvirtd.conf
+++ libvirt-0.8.0/daemon/libvirtd.conf
@@ -18,8 +18,8 @@
# It is necessary to setup a CA and issue server certificates before
# using this capability.
@ -28,11 +28,11 @@ Index: libvirt-0.7.5/daemon/libvirtd.conf
# Override the default mDNS advertizement name. This must be
# unique on the immediate broadcast network.
Index: libvirt-0.7.5/daemon/libvirtd.c
Index: libvirt-0.8.0/daemon/libvirtd.c
===================================================================
--- libvirt-0.7.5.orig/daemon/libvirtd.c
+++ libvirt-0.7.5/daemon/libvirtd.c
@@ -137,7 +137,7 @@ static int sigwrite = -1; /* Signa
--- libvirt-0.8.0.orig/daemon/libvirtd.c
+++ libvirt-0.8.0/daemon/libvirtd.c
@@ -141,7 +141,7 @@ static int sigwrite = -1; /* Signa
static int ipsock = 0; /* -l Listen for TCP/IP */
/* Defaults for configuration file elements */
@ -41,7 +41,7 @@ Index: libvirt-0.7.5/daemon/libvirtd.c
static int listen_tcp = 0;
static char *listen_addr = (char *) LIBVIRTD_LISTEN_ADDR;
static char *tls_port = (char *) LIBVIRTD_TLS_PORT;
@@ -159,7 +159,7 @@ static int auth_tcp = REMOTE_AUTH_NONE;
@@ -163,7 +163,7 @@ static int auth_tcp = REMOTE_AUTH_NONE;
#endif
static int auth_tls = REMOTE_AUTH_NONE;

View File

@ -1,45 +0,0 @@
commit f034c0bfd7089ba3400b7a44b97540c4a8785e35
Author: Jim Fehlig <jfehlig@novell.com>
Date: Sun Mar 21 19:59:13 2010 -0600
Avoid libvirtd crash when cgroups is not configured on host
Invoking virDomainSetMemory() on lxc driver results in libvirtd
segfault when cgroups has not been configured on the host.
Ensure driver->cgroup is non-null before invoking
virCgroupForDomain(). To prevent similar segfaults in the future,
ensure driver parameter to virCgroupForDomain() is non-null before
dereferencing.
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index aeec593..ba13065 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -625,6 +625,12 @@ static int lxcDomainSetMemory(virDomainPtr dom, unsigned long newmem) {
}
if (virDomainObjIsActive(vm)) {
+ if (driver->cgroup == NULL) {
+ lxcError(VIR_ERR_NO_SUPPORT,
+ "%s", _("cgroups must be configured on the host"));
+ goto cleanup;
+ }
+
if (virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) != 0) {
lxcError(VIR_ERR_INTERNAL_ERROR,
_("Unable to get cgroup for %s\n"), vm->def->name);
diff --git a/src/util/cgroup.c b/src/util/cgroup.c
index 8777781..496d9d3 100644
--- a/src/util/cgroup.c
+++ b/src/util/cgroup.c
@@ -692,6 +692,9 @@ int virCgroupForDomain(virCgroupPtr driver,
int rc;
char *path;
+ if (driver == NULL)
+ return -EINVAL;
+
if (virAsprintf(&path, "%s/%s", driver->path, name) < 0)
return -ENOMEM;

View File

@ -1,8 +1,8 @@
Index: libvirt-0.7.7/src/remote/remote_driver.c
Index: libvirt-0.8.0/src/remote/remote_driver.c
===================================================================
--- libvirt-0.7.7.orig/src/remote/remote_driver.c
+++ libvirt-0.7.7/src/remote/remote_driver.c
@@ -766,12 +766,29 @@ doRemoteOpen (virConnectPtr conn,
--- libvirt-0.8.0.orig/src/remote/remote_driver.c
+++ libvirt-0.8.0/src/remote/remote_driver.c
@@ -768,12 +768,29 @@ doRemoteOpen (virConnectPtr conn,
cmd_argv[j++] = strdup ("none");
}
cmd_argv[j++] = strdup (priv->hostname);

View File

@ -1,7 +1,7 @@
Index: libvirt-0.7.6/src/xen/xen_hypervisor.c
Index: libvirt-0.8.0/src/xen/xen_hypervisor.c
===================================================================
--- libvirt-0.7.6.orig/src/xen/xen_hypervisor.c
+++ libvirt-0.7.6/src/xen/xen_hypervisor.c
--- libvirt-0.8.0.orig/src/xen/xen_hypervisor.c
+++ libvirt-0.8.0/src/xen/xen_hypervisor.c
@@ -230,11 +230,28 @@ struct xen_v2d6_getdomaininfo {
};
typedef struct xen_v2d6_getdomaininfo xen_v2d6_getdomaininfo;
@ -251,11 +251,11 @@ Index: libvirt-0.7.6/src/xen/xen_hypervisor.c
static int
@@ -2106,8 +2156,16 @@ xenHypervisorInit(void)
@@ -2105,8 +2155,16 @@ xenHypervisorInit(void)
sys_interface_version = 7; /* XEN_SYSCTL_INTERFACE_VERSION */
if (virXen_getdomaininfo(fd, 0, &info) == 1) {
dom_interface_version = 6; /* XEN_DOMCTL_INTERFACE_VERSION */
- DEBUG0("Using hypervisor call v2, sys ver7 dom ver6\n");
- DEBUG0("Using hypervisor call v2, sys ver7 dom ver6");
- goto done;
+ if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){
+ DEBUG0("Using hypervisor call v2, sys ver6 dom ver6\n");

View File

@ -13,11 +13,11 @@ Date: Wed Jan 27 16:11:41 2010 -0700
This approach allows removing a disk when domain is inactive. We
obviously can't search xenstore when the domain is inactive.
Index: libvirt-0.7.7/src/xen/xend_internal.c
Index: libvirt-0.8.0/src/xen/xend_internal.c
===================================================================
--- libvirt-0.7.7.orig/src/xen/xend_internal.c
+++ libvirt-0.7.7/src/xen/xend_internal.c
@@ -93,6 +93,7 @@ xenDaemonFormatSxprOnePCI(virConnectPtr
--- libvirt-0.8.0.orig/src/xen/xend_internal.c
+++ libvirt-0.8.0/src/xen/xend_internal.c
@@ -91,6 +91,7 @@ xenDaemonFormatSxprOnePCI(virDomainHostd
static int
virDomainXMLDevID(virDomainPtr domain,
@ -25,7 +25,7 @@ Index: libvirt-0.7.7/src/xen/xend_internal.c
virDomainDeviceDefPtr dev,
char *class,
char *ref,
@@ -4212,7 +4213,7 @@ xenDaemonAttachDeviceFlags(virDomainPtr
@@ -4161,7 +4162,7 @@ xenDaemonAttachDeviceFlags(virDomainPtr
sexpr = virBufferContentAndReset(&buf);
@ -34,7 +34,16 @@ Index: libvirt-0.7.7/src/xen/xend_internal.c
/* device doesn't exist, define it */
ret = xend_op(domain->conn, domain->name, "op", "device_create",
"config", sexpr, NULL);
@@ -4306,7 +4307,7 @@ xenDaemonDetachDeviceFlags(virDomainPtr
@@ -4274,7 +4275,7 @@ xenDaemonUpdateDeviceFlags(virDomainPtr
sexpr = virBufferContentAndReset(&buf);
- if (virDomainXMLDevID(domain, dev, class, ref, sizeof(ref))) {
+ if (virDomainXMLDevID(domain, def, dev, class, ref, sizeof(ref))) {
virXendError(VIR_ERR_OPERATION_INVALID, "%s",
_("requested device does not exist"));
goto cleanup;
@@ -4366,7 +4367,7 @@ xenDaemonDetachDeviceFlags(virDomainPtr
def, xml, VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
@ -43,7 +52,7 @@ Index: libvirt-0.7.7/src/xen/xend_internal.c
goto cleanup;
if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV) {
@@ -6060,6 +6061,7 @@ error:
@@ -6114,6 +6115,7 @@ error:
*/
static int
virDomainXMLDevID(virDomainPtr domain,
@ -51,7 +60,7 @@ Index: libvirt-0.7.7/src/xen/xend_internal.c
virDomainDeviceDefPtr dev,
char *class,
char *ref,
@@ -6068,27 +6070,33 @@ virDomainXMLDevID(virDomainPtr domain,
@@ -6122,27 +6124,33 @@ virDomainXMLDevID(virDomainPtr domain,
xenUnifiedPrivatePtr priv = domain->conn->privateData;
char *xref;
char *tmp;

View File

@ -1,8 +1,8 @@
Index: libvirt-0.7.7/src/xen/xend_internal.c
Index: libvirt-0.8.0/src/xen/xend_internal.c
===================================================================
--- libvirt-0.7.7.orig/src/xen/xend_internal.c
+++ libvirt-0.7.7/src/xen/xend_internal.c
@@ -5475,7 +5475,10 @@ xenDaemonFormatSxprDisk(virConnectPtr co
--- libvirt-0.8.0.orig/src/xen/xend_internal.c
+++ libvirt-0.8.0/src/xen/xend_internal.c
@@ -5524,7 +5524,10 @@ xenDaemonFormatSxprDisk(virConnectPtr co
} else if (def->device == VIR_DOMAIN_DISK_DEVICE_CDROM) {
virBufferVSprintf(buf, "(dev '%s:cdrom')", def->dst);
} else {

View File

@ -1,8 +1,8 @@
Index: libvirt-0.7.6/src/xen/xend_internal.c
Index: libvirt-0.8.0/src/xen/xend_internal.c
===================================================================
--- libvirt-0.7.6.orig/src/xen/xend_internal.c
+++ libvirt-0.7.6/src/xen/xend_internal.c
@@ -1606,7 +1606,8 @@ xenDaemonParseSxprDisks(virConnectPtr co
--- libvirt-0.8.0.orig/src/xen/xend_internal.c
+++ libvirt-0.8.0/src/xen/xend_internal.c
@@ -1593,7 +1593,8 @@ xenDaemonParseSxprDisks(virDomainDefPtr
but blktap disks ended up in a differently named
(device (tap ....)) block.... */
if (sexpr_lookup(node, "device/vbd") ||
@ -12,7 +12,7 @@ Index: libvirt-0.7.6/src/xen/xend_internal.c
char *offset;
const char *src = NULL;
const char *dst = NULL;
@@ -1617,10 +1618,14 @@ xenDaemonParseSxprDisks(virConnectPtr co
@@ -1604,10 +1605,14 @@ xenDaemonParseSxprDisks(virDomainDefPtr
src = sexpr_node(node, "device/vbd/uname");
dst = sexpr_node(node, "device/vbd/dev");
mode = sexpr_node(node, "device/vbd/mode");

View File

@ -1,8 +1,8 @@
Index: libvirt-0.7.6/src/xen/xend_internal.c
Index: libvirt-0.8.0/src/xen/xend_internal.c
===================================================================
--- libvirt-0.7.6.orig/src/xen/xend_internal.c
+++ libvirt-0.7.6/src/xen/xend_internal.c
@@ -1612,20 +1612,24 @@ xenDaemonParseSxprDisks(virConnectPtr co
--- libvirt-0.8.0.orig/src/xen/xend_internal.c
+++ libvirt-0.8.0/src/xen/xend_internal.c
@@ -1599,20 +1599,24 @@ xenDaemonParseSxprDisks(virDomainDefPtr
const char *src = NULL;
const char *dst = NULL;
const char *mode = NULL;
@ -27,13 +27,11 @@ Index: libvirt-0.7.6/src/xen/xend_internal.c
}
if (VIR_ALLOC(disk) < 0)
@@ -1749,8 +1753,13 @@ xenDaemonParseSxprDisks(virConnectPtr co
@@ -1737,7 +1741,12 @@ xenDaemonParseSxprDisks(virDomainDefPtr
if (VIR_REALLOC_N(def->disks, def->ndisks+1) < 0)
goto no_memory;
-
- def->disks[def->ndisks++] = disk;
+
+ if (bootable == 1 && def->ndisks > 0) {
+ memmove(def->disks + 1, def->disks, sizeof(def->disks) * def->ndisks);
+ def->disks[0] = disk;