From e9afe9ad5c653b8a21fe6c0aaa349f4d07fd7902 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 6 Oct 2015 16:28:50 -0400 Subject: [PATCH] Fix qemu.conf dynamic_ownership=0 (bz #1266628) Fix some spec file warnings --- ...-dynamic_ownership-qemu.conf-setting.patch | 37 +++++++++++++++ ...x-some-warnings-with-latest-rpmbuild.patch | 45 +++++++++++++++++++ libvirt.spec | 17 +++++-- 3 files changed, 95 insertions(+), 4 deletions(-) create mode 100644 0001-qemu-Fix-dynamic_ownership-qemu.conf-setting.patch create mode 100644 0002-spec-Fix-some-warnings-with-latest-rpmbuild.patch diff --git a/0001-qemu-Fix-dynamic_ownership-qemu.conf-setting.patch b/0001-qemu-Fix-dynamic_ownership-qemu.conf-setting.patch new file mode 100644 index 0000000..6fabfb4 --- /dev/null +++ b/0001-qemu-Fix-dynamic_ownership-qemu.conf-setting.patch @@ -0,0 +1,37 @@ +From: Cole Robinson +Date: Mon, 28 Sep 2015 19:47:09 -0400 +Subject: [PATCH] qemu: Fix dynamic_ownership qemu.conf setting + +Commit 307fb904 (Sep 10) added a 'privileged' variable when creating +the DAC driver: + +@@ -153,6 +157,7 @@ virSecurityManagerNewDAC(const char *virtDriver, + bool defaultConfined, + bool requireConfined, + bool dynamicOwnership, ++ bool privileged, + virSecurityManagerDACChownCallback chownCallback) + +But argument order is mixed up at the caller, swapping dynamicOwnership +and privileged values. This corrects the argument order + +https://bugzilla.redhat.com/show_bug.cgi?id=1266628 +(cherry picked from commit 68572de8228e3971174a83c227fcb018d6f684c7) +--- + src/qemu/qemu_driver.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index a38e776..fda9cd9 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -430,8 +430,8 @@ qemuSecurityInit(virQEMUDriverPtr driver) + cfg->allowDiskFormatProbing, + cfg->securityDefaultConfined, + cfg->securityRequireConfined, +- virQEMUDriverIsPrivileged(driver), + cfg->dynamicOwnership, ++ virQEMUDriverIsPrivileged(driver), + qemuSecurityChownCallback))) + goto error; + if (!stack) { diff --git a/0002-spec-Fix-some-warnings-with-latest-rpmbuild.patch b/0002-spec-Fix-some-warnings-with-latest-rpmbuild.patch new file mode 100644 index 0000000..35ddc51 --- /dev/null +++ b/0002-spec-Fix-some-warnings-with-latest-rpmbuild.patch @@ -0,0 +1,45 @@ +From: Cole Robinson +Date: Tue, 22 Sep 2015 15:56:50 -0400 +Subject: [PATCH] spec: Fix some warnings with latest rpmbuild + +$ rpmbuild -ba libvirt.spec +warning: Macro expanded in comment on line 5: # If neither fedora nor rhel was defined, try to guess them from %{dist} + +warning: Macro %enable_autotools defined but not used within scope +warning: Macro %client_only defined but not used within scope +... + +(cherry picked from commit dae1250b24404f7f21e7bd8aeeb304565d175de4) +--- + libvirt.spec.in | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/libvirt.spec.in b/libvirt.spec.in +index 2acb01b..62dfecd 100644 +--- a/libvirt.spec.in ++++ b/libvirt.spec.in +@@ -2,7 +2,7 @@ + + # This spec file assumes you are building for Fedora 13 or newer, + # or for RHEL 5 or newer. It may need some tweaks for other distros. +-# If neither fedora nor rhel was defined, try to guess them from %{dist} ++# If neither fedora nor rhel was defined, try to guess them from dist + %if !0%{?rhel} && !0%{?fedora} + %{expand:%(echo "%{?dist}" | \ + sed -ne 's/^\.el\([0-9]\+\).*/%%define rhel \1/p')} +@@ -13,13 +13,13 @@ + # Default to skipping autoreconf. Distros can change just this one line + # (or provide a command-line override) if they backport any patches that + # touch configure.ac or Makefile.am. +-%{!?enable_autotools:%define enable_autotools 0} ++%{!?enable_autotools:%global enable_autotools 0} + + # A client only build will create a libvirt.so only containing + # the generic RPC driver, and test driver and no libvirtd + # Default to a full server + client build, but with the possibility + # of a command-line or ~/.rpmmacros override for client-only. +-%{!?client_only:%define client_only 0} ++%{!?client_only:%global client_only 0} + + # Now turn off server build in certain cases + diff --git a/libvirt.spec b/libvirt.spec index a69a9a2..b4203d8 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -2,7 +2,7 @@ # This spec file assumes you are building for Fedora 13 or newer, # or for RHEL 5 or newer. It may need some tweaks for other distros. -# If neither fedora nor rhel was defined, try to guess them from %{dist} +# If neither fedora nor rhel was defined, try to guess them from dist %if !0%{?rhel} && !0%{?fedora} %{expand:%(echo "%{?dist}" | \ sed -ne 's/^\.el\([0-9]\+\).*/%%define rhel \1/p')} @@ -13,13 +13,13 @@ # Default to skipping autoreconf. Distros can change just this one line # (or provide a command-line override) if they backport any patches that # touch configure.ac or Makefile.am. -%{!?enable_autotools:%define enable_autotools 0} +%{!?enable_autotools:%global enable_autotools 0} # A client only build will create a libvirt.so only containing # the generic RPC driver, and test driver and no libvirtd # Default to a full server + client build, but with the possibility # of a command-line or ~/.rpmmacros override for client-only. -%{!?client_only:%define client_only 0} +%{!?client_only:%global client_only 0} # Now turn off server build in certain cases @@ -378,7 +378,7 @@ Summary: Library providing a simple virtualization API Name: libvirt Version: 1.2.18.1 -Release: 1%{?dist}%{?extra_release} +Release: 2%{?dist}%{?extra_release} License: LGPLv2+ Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root @@ -389,6 +389,11 @@ URL: http://libvirt.org/ %endif Source: http://libvirt.org/sources/%{?mainturl}libvirt-%{version}.tar.gz +# Fix qemu.conf dynamic_ownership=0 (bz #1266628) +Patch0001: 0001-qemu-Fix-dynamic_ownership-qemu.conf-setting.patch +# Fix some spec file warnings +Patch0002: 0002-spec-Fix-some-warnings-with-latest-rpmbuild.patch + %if %{with_libvirtd} Requires: libvirt-daemon = %{version}-%{release} %if %{with_network} @@ -2330,6 +2335,10 @@ exit 0 %doc examples/systemtap %changelog +* Tue Oct 06 2015 Cole Robinson - 1.2.18.1-2 +- Fix qemu.conf dynamic_ownership=0 (bz #1266628) +- Fix some spec file warnings + * Mon Sep 21 2015 Cole Robinson - 1.2.18.1-1 - Rebased to version 1.2.18.1 - libvirt reports physical=0 for COW2 volumes on block storage (bz #1253754)