Don't try to label a disk with no path (e.g. empty cdrom) (bug #499569)

This commit is contained in:
Cole Robinson 2009-05-11 02:29:05 +00:00
parent 3f397d9786
commit 4465a63872
2 changed files with 20 additions and 1 deletions

View File

@ -0,0 +1,13 @@
diff -rup libvirt-0.6.2/src/security_selinux.c new/src/security_selinux.c
--- libvirt-0.6.2/src/security_selinux.c 2009-05-10 22:04:25.000000000 -0400
+++ new/src/security_selinux.c 2009-05-10 22:06:09.000000000 -0400
@@ -338,6 +338,9 @@ SELinuxSetSecurityImageLabel(virConnectP
{
const virSecurityLabelDefPtr secdef = &vm->def->seclabel;
+ if (!disk->src)
+ return 0;
+
if (disk->shared) {
return SELinuxSetFilecon(conn, disk->src, default_image_context);
} else if (disk->readonly) {

View File

@ -55,7 +55,7 @@
Summary: Library providing a simple API virtualization
Name: libvirt
Version: 0.6.3
Release: 7%{?dist}%{?extra_release}
Release: 8%{?dist}%{?extra_release}
License: LGPLv2+
Group: Development/Libraries
Source: libvirt-%{version}.tar.gz
@ -67,6 +67,8 @@ Patch2: libvirt-0.6.3-hostdev-managed.patch
Patch3: libvirt-0.6.3-refresh-qemu-caps.patch
# Enable migration with qemu 0.10
Patch4: libvirt-0.6.3-enable-qemu-0-10-migration.patch
# Don't try to label a disk with no path (e.g. empty cdrom) (bz 499569)
Patch5: libvirt-0.6.2-fix-nosource-label.patch
# Not for upstream. Temporary hack till PulseAudio autostart
# problems are sorted out when SELinux enforcing
@ -224,6 +226,7 @@ of recent versions of Linux (and other OSes).
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch200 -p0
@ -554,6 +557,9 @@ fi
%endif
%changelog
* Sun May 10 2009 Cole Robinson <crobinso@redhat.com> - 0.6.2-8.fc12
- Don't try to label a disk with no path (e.g. empty cdrom) (bug #499569)
* Thu May 7 2009 Mark McLoughlin <markmc@redhat.com> - 0.6.3-7.fc12
- Enable migration for qemu 0.10 (bug #499704)