SHA256
1
0
forked from pool/libvirt

Fix libvirt compilation when selinux security driver is enabled.

OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=19
This commit is contained in:
James Fehlig 2009-10-19 20:17:26 +00:00 committed by Git OBS Bridge
parent ec6b777cf3
commit f9afad7fb4
5 changed files with 75 additions and 7 deletions

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Mon Oct 19 14:13:47 MDT 2009 - jfehlig@novell.com
- Fix compilation when selinux is enabled
selinux-ldflags.patch
- Fix compilation warnings
updated snapshots.patch
virsh-warning.patch
-------------------------------------------------------------------
Thu Oct 15 22:26:35 MDT 2009 - jfehlig@novell.com

View File

@ -93,6 +93,8 @@ Source1: libvirtd.init
# Upstream patches
Patch0: devmap-no-pkgconfig.patch
Patch1: fs-ocfs2.patch
Patch2: selinux-ldflags.patch
Patch3: virsh-warning.patch
# Need to go upstream
Patch100: socat.patch
Patch101: clone.patch
@ -196,6 +198,8 @@ Authors:
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch100 -p1
%patch101
%patch102 -p1
@ -225,7 +229,6 @@ export CFLAGS="$RPM_OPT_FLAGS"
--with-init-script=none \
--with-remote-pid-file=%{_localstatedir}/run/libvirtd.pid \
--with-xen-proxy=no \
--with-selinux=no \
ac_cv_path_DNSMASQ=/usr/sbin/dnsmasq \
ac_cv_path_QEMU_IMG=/usr/bin/qemu-img-xen \
ac_cv_path_ISCSIADM=/sbin/iscsiadm \

13
selinux-ldflags.patch Normal file
View File

@ -0,0 +1,13 @@
Index: libvirt-0.7.2/src/Makefile.am
===================================================================
--- libvirt-0.7.2.orig/src/Makefile.am
+++ libvirt-0.7.2/src/Makefile.am
@@ -657,6 +657,8 @@ libvirt_driver_security_la_CFLAGS = \
libvirt_driver_security_la_LDFLAGS =
if WITH_SECDRIVER_SELINUX
libvirt_driver_security_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
+libvirt_driver_security_la_CFLAGS += $(SELINUX_CFLAGS)
+libvirt_driver_security_la_LDFLAGS += $(SELINUX_LIBS)
endif
if WITH_SECDRIVER_APPARMOR
libvirt_driver_security_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES)

View File

@ -571,7 +571,7 @@ Index: libvirt-0.7.2/tools/virsh.c
+ if (virDomainSnapshotCreate(dom, name) == 0) {
+ vshPrint(ctl, _("Snapshot %s created for domain %s\n"), name, domain);
+ } else {
+ vshError(ctl, FALSE, _("Failed to create snapshot %s for domain %s"),
+ vshError(ctl, _("Failed to create snapshot %s for domain %s"),
+ name, domain);
+ ret = FALSE;
+ }
@ -617,7 +617,7 @@ Index: libvirt-0.7.2/tools/virsh.c
+ vshPrint(ctl, _("Domain %s started using snapshot %s\n"),
+ domain, name);
+ } else {
+ vshError(ctl, FALSE, _("Failed to start domain %s using snapshot %s"),
+ vshError(ctl, _("Failed to start domain %s using snapshot %s"),
+ domain, name);
+ ret = FALSE;
+ }
@ -662,7 +662,7 @@ Index: libvirt-0.7.2/tools/virsh.c
+ if (virDomainSnapshotDelete(dom, name) == 0) {
+ vshPrint(ctl, _("Snapshot %s deleted from domain %s\n"), name, domain);
+ } else {
+ vshError(ctl, FALSE, _("Failed to delete snapshot %s from domain %s"),
+ vshError(ctl, _("Failed to delete snapshot %s from domain %s"),
+ name, domain);
+ ret = FALSE;
+ }
@ -1014,6 +1014,14 @@ Index: libvirt-0.7.2/python/libvirt-override.c
static PyObject *
libvirt_virStorageVolGetInfo(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
@@ -2425,6 +2453,7 @@ static PyMethodDef libvirtMethods[] = {
{(char *) "virStoragePoolGetAutostart", libvirt_virStoragePoolGetAutostart, METH_VARARGS, NULL},
{(char *) "virStoragePoolListVolumes", libvirt_virStoragePoolListVolumes, METH_VARARGS, NULL},
{(char *) "virStoragePoolGetInfo", libvirt_virStoragePoolGetInfo, METH_VARARGS, NULL},
+ {(char *) "virDomainListSnapshots", libvirt_virDomainListSnapshots, METH_VARARGS, NULL},
{(char *) "virStorageVolGetInfo", libvirt_virStorageVolGetInfo, METH_VARARGS, NULL},
{(char *) "virStoragePoolGetUUID", libvirt_virStoragePoolGetUUID, METH_VARARGS, NULL},
{(char *) "virStoragePoolGetUUIDString", libvirt_virStoragePoolGetUUIDString, METH_VARARGS, NULL},
Index: libvirt-0.7.2/python/libvirt-override-api.xml
===================================================================
--- libvirt-0.7.2.orig/python/libvirt-override-api.xml
@ -1030,3 +1038,19 @@ Index: libvirt-0.7.2/python/libvirt-override-api.xml
<function name='virConnectListStoragePools' file='python'>
<info>list the storage pools, stores the pointers to the names in @names</info>
<arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
Index: libvirt-0.7.2/src/xen/xen_inotify.c
===================================================================
--- libvirt-0.7.2.orig/src/xen/xen_inotify.c
+++ libvirt-0.7.2/src/xen/xen_inotify.c
@@ -88,6 +88,11 @@ struct xenUnifiedDriver xenInotifyDriver
NULL, /* domainGetSchedulerType */
NULL, /* domainGetSchedulerParameters */
NULL, /* domainSetSchedulerParameters */
+ NULL, /* domainSnapshotCreate */
+ NULL, /* domainSnapshotApply */
+ NULL, /* domainSnapshotDelete */
+ NULL, /* domainNumOfSnapshots */
+ NULL, /* domainListSnapshots */
};
static int

19
virsh-warning.patch Normal file
View File

@ -0,0 +1,19 @@
commit edea3dfdd861d5eee4712da43781908f0fa2a6d5
Author: Jim Fehlig <jfehlig@novell.com>
Date: Mon Oct 19 13:53:40 2009 -0600
Remove extra arg in call to vshError()
Index: libvirt-0.7.2/tools/virsh.c
===================================================================
--- libvirt-0.7.2.orig/tools/virsh.c
+++ libvirt-0.7.2/tools/virsh.c
@@ -2510,7 +2510,7 @@ cmdMigrate (vshControl *ctl, const vshCm
* a libvirt URI, or a hypervisor specific URI. */
if (migrateuri != NULL) {
- vshError(ctl, FALSE, "%s", _("migrate: Unexpected migrateuri for peer2peer/direct migration"));
+ vshError(ctl, "%s", _("migrate: Unexpected migrateuri for peer2peer/direct migration"));
goto done;
}