From e88899c8f066fa5a84387494733ec4e0cbd1e460 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Wed, 4 May 2016 20:01:46 -0400 Subject: [PATCH] Rebased to version 1.2.18.3 Start network after config-network RPM install (bz #867546) --- ...e-domain-name-and-uuid-with-other-el.patch | 38 ----- ...r-fix-crash-when-no-mac-is-specified.patch | 32 ---- ...y-generate-systemtap-tapsets-bz-1173.patch | 63 -------- 0004-rpc-socket-Minor-cleanups.patch | 48 ------ ...citly-error-if-we-exceed-retry-count.patch | 40 ----- ...-repeatedly-attempt-to-launch-daemon.patch | 43 ------ ...not-restore-kernel-and-initrd-labels.patch | 57 ------- ...-error-path-for-forked-virFileRemove.patch | 42 ----- 0009-lxc-fuse-Unindent-meminfo-logic.patch | 146 ------------------ ...se-Fix-proc-meminfo-size-calculation.patch | 55 ------- ...ill-in-MemAvailable-for-proc-meminfo.patch | 34 ---- ...e-Stub-out-Slab-bits-in-proc-meminfo.patch | 35 ----- ...arify-setuid-usage-for-virFileRemove.patch | 62 -------- ...y-setuid-for-virFileRemove-if-on-NFS.patch | 55 ------- ...onger-for-session-daemon-to-start-up.patch | 37 ----- ...log-missing-modules-as-INFO-not-WARN.patch | 27 ---- libvirt.spec | 69 ++++----- sources | 2 +- 18 files changed, 27 insertions(+), 858 deletions(-) delete mode 100644 0001-schema-interleave-domain-name-and-uuid-with-other-el.patch delete mode 100644 0002-leaseshelper-fix-crash-when-no-mac-is-specified.patch delete mode 100644 0003-build-predictably-generate-systemtap-tapsets-bz-1173.patch delete mode 100644 0004-rpc-socket-Minor-cleanups.patch delete mode 100644 0005-rpc-socket-Explicitly-error-if-we-exceed-retry-count.patch delete mode 100644 0006-rpc-socket-Don-t-repeatedly-attempt-to-launch-daemon.patch delete mode 100644 0007-security-Do-not-restore-kernel-and-initrd-labels.patch delete mode 100644 0008-virfile-Fix-error-path-for-forked-virFileRemove.patch delete mode 100644 0009-lxc-fuse-Unindent-meminfo-logic.patch delete mode 100644 0010-lxc-fuse-Fix-proc-meminfo-size-calculation.patch delete mode 100644 0011-lxc-fuse-Fill-in-MemAvailable-for-proc-meminfo.patch delete mode 100644 0012-lxc-fuse-Stub-out-Slab-bits-in-proc-meminfo.patch delete mode 100644 0013-util-virfile-Clarify-setuid-usage-for-virFileRemove.patch delete mode 100644 0014-util-virfile-Only-setuid-for-virFileRemove-if-on-NFS.patch delete mode 100644 0015-rpc-wait-longer-for-session-daemon-to-start-up.patch delete mode 100644 0016-driver-log-missing-modules-as-INFO-not-WARN.patch diff --git a/0001-schema-interleave-domain-name-and-uuid-with-other-el.patch b/0001-schema-interleave-domain-name-and-uuid-with-other-el.patch deleted file mode 100644 index 0033803..0000000 --- a/0001-schema-interleave-domain-name-and-uuid-with-other-el.patch +++ /dev/null @@ -1,38 +0,0 @@ -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Thu, 17 Dec 2015 13:43:58 +0100 -Subject: [PATCH] schema: interleave domain name and uuid with other elements -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Allow and anywhere under , not just at the top: - -error:XML document failed to validate against schema: Unable to validate -doc against /usr/share/libvirt/schemas/domain.rng -Expecting an element name, got nothing -Invalid sequence in interleave -Element domain failed to validate content - -Introduced with the first RelaxNG schema in commit c642103. - -https://bugzilla.redhat.com/show_bug.cgi?id=1292131 -(cherry picked from commit b4e0549febe416ffefc16f389423740d6d65fa74) -Signed-off-by: Ján Tomko ---- - docs/schemas/domaincommon.rng | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng -index 1120003..9e7fad5 100644 ---- a/docs/schemas/domaincommon.rng -+++ b/docs/schemas/domaincommon.rng -@@ -30,8 +30,8 @@ - - - -- - -+ - - - diff --git a/0002-leaseshelper-fix-crash-when-no-mac-is-specified.patch b/0002-leaseshelper-fix-crash-when-no-mac-is-specified.patch deleted file mode 100644 index d9c290b..0000000 --- a/0002-leaseshelper-fix-crash-when-no-mac-is-specified.patch +++ /dev/null @@ -1,32 +0,0 @@ -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Thu, 14 Jan 2016 14:31:17 +0100 -Subject: [PATCH] leaseshelper: fix crash when no mac is specified -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -If dnsmasq specified DNSMASQ_IAID (so we're dealing with an IPv6 -lease) but no DNSMASQ_MAC, we skip creation of the new lease object. - -Also skip adding it to the leases array. - -https://bugzilla.redhat.com/show_bug.cgi?id=1202350 -(cherry picked from commit df9fe124d650bc438c531673492569da87523d20) -Signed-off-by: Ján Tomko ---- - src/network/leaseshelper.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/network/leaseshelper.c b/src/network/leaseshelper.c -index 2d528f7..6930310 100644 ---- a/src/network/leaseshelper.c -+++ b/src/network/leaseshelper.c -@@ -439,7 +439,7 @@ main(int argc, char **argv) - - case VIR_LEASE_ACTION_OLD: - case VIR_LEASE_ACTION_ADD: -- if (virJSONValueArrayAppend(leases_array_new, lease_new) < 0) { -+ if (lease_new && virJSONValueArrayAppend(leases_array_new, lease_new) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("failed to create json")); - goto cleanup; diff --git a/0003-build-predictably-generate-systemtap-tapsets-bz-1173.patch b/0003-build-predictably-generate-systemtap-tapsets-bz-1173.patch deleted file mode 100644 index bbe1330..0000000 --- a/0003-build-predictably-generate-systemtap-tapsets-bz-1173.patch +++ /dev/null @@ -1,63 +0,0 @@ -From: Cole Robinson -Date: Tue, 19 Jan 2016 22:19:56 -0500 -Subject: [PATCH] build: predictably generate systemtap tapsets (bz 1173641) - -The generated output is dependent on perl hashtable ordering, which -gives different results for i686 and x86_64. Fix this by sorting -the hash keys before iterating over them - -https://bugzilla.redhat.com/show_bug.cgi?id=1173641 -(cherry picked from commit a1edb05c6028470aa24b74aa0f8d5fb5a181128a) ---- - src/rpc/gensystemtap.pl | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/src/rpc/gensystemtap.pl b/src/rpc/gensystemtap.pl -index 2467300..7b80fbf 100755 ---- a/src/rpc/gensystemtap.pl -+++ b/src/rpc/gensystemtap.pl -@@ -72,7 +72,7 @@ function libvirt_rpc_auth_name(type, verbose) - { - EOF - my $first = 1; --foreach my $type (keys %auth) { -+foreach my $type (sort(keys %auth)) { - my $cond = $first ? "if" : "} else if"; - $first = 0; - print " $cond (type == ", $type, ") {\n"; -@@ -95,7 +95,7 @@ function libvirt_rpc_type_name(type, verbose) - { - EOF - $first = 1; --foreach my $type (keys %type) { -+foreach my $type (sort(keys %type)) { - my $cond = $first ? "if" : "} else if"; - $first = 0; - print " $cond (type == ", $type, ") {\n"; -@@ -118,7 +118,7 @@ function libvirt_rpc_status_name(status, verbose) - { - EOF - $first = 1; --foreach my $status (keys %status) { -+foreach my $status (sort(keys %status)) { - my $cond = $first ? "if" : "} else if"; - $first = 0; - print " $cond (status == ", $status, ") {\n"; -@@ -141,7 +141,7 @@ function libvirt_rpc_program_name(program, verbose) - { - EOF - $first = 1; --foreach my $prog (keys %funcs) { -+foreach my $prog (sort(keys %funcs)) { - my $cond = $first ? "if" : "} else if"; - $first = 0; - print " $cond (program == ", $funcs{$prog}->{id}, ") {\n"; -@@ -165,7 +165,7 @@ function libvirt_rpc_procedure_name(program, version, proc, verbose) - { - EOF - $first = 1; --foreach my $prog (keys %funcs) { -+foreach my $prog (sort(keys %funcs)) { - my $cond = $first ? "if" : "} else if"; - $first = 0; - print " $cond (program == ", $funcs{$prog}->{id}, " && version == ", $funcs{$prog}->{version}, ") {\n"; diff --git a/0004-rpc-socket-Minor-cleanups.patch b/0004-rpc-socket-Minor-cleanups.patch deleted file mode 100644 index f7461b9..0000000 --- a/0004-rpc-socket-Minor-cleanups.patch +++ /dev/null @@ -1,48 +0,0 @@ -From: Cole Robinson -Date: Mon, 11 Jan 2016 20:01:24 -0500 -Subject: [PATCH] rpc: socket: Minor cleanups - -- Add some debugging -- Make the loop dependent only on retries -- Make it explicit that connect(2) success exits the loop -- Invert the error checking logic - -(cherry picked from commit f102c7146ed7f6e04af0ad3bce302476239f2502) ---- - src/rpc/virnetsocket.c | 16 ++++++++++++---- - 1 file changed, 12 insertions(+), 4 deletions(-) - -diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c -index 5e5f1ab..fc8ce6c 100644 ---- a/src/rpc/virnetsocket.c -+++ b/src/rpc/virnetsocket.c -@@ -620,6 +620,9 @@ int virNetSocketNewConnectUNIX(const char *path, - char *rundir = NULL; - int ret = -1; - -+ VIR_DEBUG("path=%s spawnDaemon=%d binary=%s", path, spawnDaemon, -+ NULLSTR(binary)); -+ - memset(&localAddr, 0, sizeof(localAddr)); - memset(&remoteAddr, 0, sizeof(remoteAddr)); - -@@ -680,10 +683,15 @@ int virNetSocketNewConnectUNIX(const char *path, - if (remoteAddr.data.un.sun_path[0] == '@') - remoteAddr.data.un.sun_path[0] = '\0'; - -- while (retries && -- connect(fd, &remoteAddr.data.sa, remoteAddr.len) < 0) { -- if (!(spawnDaemon && (errno == ENOENT || -- errno == ECONNREFUSED))) { -+ while (retries) { -+ if (connect(fd, &remoteAddr.data.sa, remoteAddr.len) == 0) { -+ VIR_DEBUG("connect() succeeded"); -+ break; -+ } -+ VIR_DEBUG("connect() failed: retries=%d errno=%d", retries, errno); -+ -+ if (!spawnDaemon || -+ (errno != ENOENT && errno != ECONNREFUSED)) { - virReportSystemError(errno, _("Failed to connect socket to '%s'"), - path); - goto cleanup; diff --git a/0005-rpc-socket-Explicitly-error-if-we-exceed-retry-count.patch b/0005-rpc-socket-Explicitly-error-if-we-exceed-retry-count.patch deleted file mode 100644 index 2134425..0000000 --- a/0005-rpc-socket-Explicitly-error-if-we-exceed-retry-count.patch +++ /dev/null @@ -1,40 +0,0 @@ -From: Cole Robinson -Date: Mon, 11 Jan 2016 20:08:45 -0500 -Subject: [PATCH] rpc: socket: Explicitly error if we exceed retry count - -When we autolaunch libvirtd for session URIs, we spin in a retry -loop waiting for the daemon to start and the connect(2) to succeed. - -However if we exceed the retry count, we don't explicitly raise an -error, which can yield a slew of different error messages elsewhere -in the code. - -Explicitly raise the last connect(2) failure if we run out of retries. - -(cherry picked from commit 8da02d528068942303923fc4f935e77cccac9c7c) ---- - src/rpc/virnetsocket.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c -index fc8ce6c..6a51dc8 100644 ---- a/src/rpc/virnetsocket.c -+++ b/src/rpc/virnetsocket.c -@@ -690,7 +690,9 @@ int virNetSocketNewConnectUNIX(const char *path, - } - VIR_DEBUG("connect() failed: retries=%d errno=%d", retries, errno); - -+ retries--; - if (!spawnDaemon || -+ retries == 0 || - (errno != ENOENT && errno != ECONNREFUSED)) { - virReportSystemError(errno, _("Failed to connect socket to '%s'"), - path); -@@ -700,7 +702,6 @@ int virNetSocketNewConnectUNIX(const char *path, - if (virNetSocketForkDaemon(binary) < 0) - goto cleanup; - -- retries--; - usleep(5000); - } - diff --git a/0006-rpc-socket-Don-t-repeatedly-attempt-to-launch-daemon.patch b/0006-rpc-socket-Don-t-repeatedly-attempt-to-launch-daemon.patch deleted file mode 100644 index dc1900c..0000000 --- a/0006-rpc-socket-Don-t-repeatedly-attempt-to-launch-daemon.patch +++ /dev/null @@ -1,43 +0,0 @@ -From: Cole Robinson -Date: Mon, 11 Jan 2016 20:13:38 -0500 -Subject: [PATCH] rpc: socket: Don't repeatedly attempt to launch daemon - -On every socket connect(2) attempt we were re-launching session -libvirtd, up to 100 times in 5 seconds. - -This understandably caused some weird load races and intermittent -qemu:///session startup failures - -https://bugzilla.redhat.com/show_bug.cgi?id=1271183 -(cherry picked from commit 2eb7a975756d05a5b54ab4acf60083beb6161ac6) ---- - src/rpc/virnetsocket.c | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c -index 6a51dc8..b132532 100644 ---- a/src/rpc/virnetsocket.c -+++ b/src/rpc/virnetsocket.c -@@ -619,6 +619,7 @@ int virNetSocketNewConnectUNIX(const char *path, - virSocketAddr remoteAddr; - char *rundir = NULL; - int ret = -1; -+ bool daemonLaunched = false; - - VIR_DEBUG("path=%s spawnDaemon=%d binary=%s", path, spawnDaemon, - NULLSTR(binary)); -@@ -699,8 +700,12 @@ int virNetSocketNewConnectUNIX(const char *path, - goto cleanup; - } - -- if (virNetSocketForkDaemon(binary) < 0) -- goto cleanup; -+ if (!daemonLaunched) { -+ if (virNetSocketForkDaemon(binary) < 0) -+ goto cleanup; -+ -+ daemonLaunched = true; -+ } - - usleep(5000); - } diff --git a/0007-security-Do-not-restore-kernel-and-initrd-labels.patch b/0007-security-Do-not-restore-kernel-and-initrd-labels.patch deleted file mode 100644 index 559405c..0000000 --- a/0007-security-Do-not-restore-kernel-and-initrd-labels.patch +++ /dev/null @@ -1,57 +0,0 @@ -From: Jiri Denemark -Date: Fri, 15 Jan 2016 10:55:58 +0100 -Subject: [PATCH] security: Do not restore kernel and initrd labels - -Kernel/initrd files are essentially read-only shareable images and thus -should be handled in the same way. We already use the appropriate label -for kernel/initrd files when starting a domain, but when a domain gets -destroyed we would remove the labels which would make other running -domains using the same files very unhappy. - -https://bugzilla.redhat.com/show_bug.cgi?id=921135 - -Signed-off-by: Jiri Denemark -(cherry picked from commit 68acc701bd449481e3206723c25b18fcd3d261b7) ---- - src/security/security_dac.c | 8 -------- - src/security/security_selinux.c | 8 -------- - 2 files changed, 16 deletions(-) - -diff --git a/src/security/security_dac.c b/src/security/security_dac.c -index deb6980..d01215f 100644 ---- a/src/security/security_dac.c -+++ b/src/security/security_dac.c -@@ -971,14 +971,6 @@ virSecurityDACRestoreSecurityAllLabel(virSecurityManagerPtr mgr, - virSecurityDACRestoreSecurityFileLabel(def->os.loader->nvram) < 0) - rc = -1; - -- if (def->os.kernel && -- virSecurityDACRestoreSecurityFileLabel(def->os.kernel) < 0) -- rc = -1; -- -- if (def->os.initrd && -- virSecurityDACRestoreSecurityFileLabel(def->os.initrd) < 0) -- rc = -1; -- - if (def->os.dtb && - virSecurityDACRestoreSecurityFileLabel(def->os.dtb) < 0) - rc = -1; -diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c -index c2464c2..38f2a29 100644 ---- a/src/security/security_selinux.c -+++ b/src/security/security_selinux.c -@@ -1978,14 +1978,6 @@ virSecuritySELinuxRestoreSecurityAllLabel(virSecurityManagerPtr mgr, - virSecuritySELinuxRestoreSecurityFileLabel(mgr, def->os.loader->nvram) < 0) - rc = -1; - -- if (def->os.kernel && -- virSecuritySELinuxRestoreSecurityFileLabel(mgr, def->os.kernel) < 0) -- rc = -1; -- -- if (def->os.initrd && -- virSecuritySELinuxRestoreSecurityFileLabel(mgr, def->os.initrd) < 0) -- rc = -1; -- - if (def->os.dtb && - virSecuritySELinuxRestoreSecurityFileLabel(mgr, def->os.dtb) < 0) - rc = -1; diff --git a/0008-virfile-Fix-error-path-for-forked-virFileRemove.patch b/0008-virfile-Fix-error-path-for-forked-virFileRemove.patch deleted file mode 100644 index 1d459fa..0000000 --- a/0008-virfile-Fix-error-path-for-forked-virFileRemove.patch +++ /dev/null @@ -1,42 +0,0 @@ -From: John Ferlan -Date: Wed, 30 Sep 2015 17:37:27 -0400 -Subject: [PATCH] virfile: Fix error path for forked virFileRemove - -As it turns out the caller in this case expects a return < 0 for failure -and to get/use "errno" rather than using the negative of returned status. -Again different than the create path. - -If someone "deleted" a file from the pool without using virsh vol-delete, -then the unlink/rmdir would return an error (-1) and set errno to ENOENT. -The caller checks errno for ENOENT when determining whether to throw an -error message indicating the failure. Without the change, the error -message is: - -error: Failed to delete vol $vol -error: cannot unlink file '/$pathto/$vol': Success - -This patch thus allows the fork path to follow the non-fork path -where unlink/rmdir return -1 and errno. - -(cherry picked from commit cb19cff468432e55366014658f405066ce06c2f2) ---- - src/util/virfile.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/src/util/virfile.c b/src/util/virfile.c -index 7b14ee8..d742645 100644 ---- a/src/util/virfile.c -+++ b/src/util/virfile.c -@@ -2381,9 +2381,10 @@ virFileUnlink(const char *path, - path, msg); - VIR_FREE(msg); - if (WIFEXITED(status)) -- ret = -WEXITSTATUS(status); -+ errno = WEXITSTATUS(status); - else -- ret = -EACCES; -+ errno = EACCES; -+ ret = -errno; - } - - parenterror: diff --git a/0009-lxc-fuse-Unindent-meminfo-logic.patch b/0009-lxc-fuse-Unindent-meminfo-logic.patch deleted file mode 100644 index 566e721..0000000 --- a/0009-lxc-fuse-Unindent-meminfo-logic.patch +++ /dev/null @@ -1,146 +0,0 @@ -From: Cole Robinson -Date: Thu, 21 Jan 2016 13:06:03 -0500 -Subject: [PATCH] lxc: fuse: Unindent meminfo logic - -Reverse the conditional at the start so we aren't stuffing all the logic -in an 'if' block - -(cherry picked from commit f65dcfcd140d0a627aeab3fa0e9dc5f74da98e6d) ---- - src/lxc/lxc_fuse.c | 122 ++++++++++++++++++++++++++--------------------------- - 1 file changed, 61 insertions(+), 61 deletions(-) - -diff --git a/src/lxc/lxc_fuse.c b/src/lxc/lxc_fuse.c -index 34a69cc..f9c02c0 100644 ---- a/src/lxc/lxc_fuse.c -+++ b/src/lxc/lxc_fuse.c -@@ -161,68 +161,68 @@ static int lxcProcReadMeminfo(char *hostpath, virDomainDefPtr def, - res = -1; - while (copied < size && getline(&line, &n, fd) > 0) { - char *ptr = strchr(line, ':'); -- if (ptr) { -- *ptr = '\0'; -- -- if (STREQ(line, "MemTotal") && -- (virMemoryLimitIsSet(def->mem.hard_limit) || -- virDomainDefGetMemoryActual(def))) { -- virBufferAsprintf(new_meminfo, "MemTotal: %8llu kB\n", -- meminfo.memtotal); -- } else if (STREQ(line, "MemFree") && -- (virMemoryLimitIsSet(def->mem.hard_limit) || -- virDomainDefGetMemoryActual(def))) { -- virBufferAsprintf(new_meminfo, "MemFree: %8llu kB\n", -- (meminfo.memtotal - meminfo.memusage)); -- } else if (STREQ(line, "Buffers")) { -- virBufferAsprintf(new_meminfo, "Buffers: %8d kB\n", 0); -- } else if (STREQ(line, "Cached")) { -- virBufferAsprintf(new_meminfo, "Cached: %8llu kB\n", -- meminfo.cached); -- } else if (STREQ(line, "Active")) { -- virBufferAsprintf(new_meminfo, "Active: %8llu kB\n", -- (meminfo.active_anon + meminfo.active_file)); -- } else if (STREQ(line, "Inactive")) { -- virBufferAsprintf(new_meminfo, "Inactive: %8llu kB\n", -- (meminfo.inactive_anon + meminfo.inactive_file)); -- } else if (STREQ(line, "Active(anon)")) { -- virBufferAsprintf(new_meminfo, "Active(anon): %8llu kB\n", -- meminfo.active_anon); -- } else if (STREQ(line, "Inactive(anon)")) { -- virBufferAsprintf(new_meminfo, "Inactive(anon): %8llu kB\n", -- meminfo.inactive_anon); -- } else if (STREQ(line, "Active(file)")) { -- virBufferAsprintf(new_meminfo, "Active(file): %8llu kB\n", -- meminfo.active_file); -- } else if (STREQ(line, "Inactive(file)")) { -- virBufferAsprintf(new_meminfo, "Inactive(file): %8llu kB\n", -- meminfo.inactive_file); -- } else if (STREQ(line, "Unevictable")) { -- virBufferAsprintf(new_meminfo, "Unevictable: %8llu kB\n", -- meminfo.unevictable); -- } else if (STREQ(line, "SwapTotal") && -- virMemoryLimitIsSet(def->mem.swap_hard_limit)) { -- virBufferAsprintf(new_meminfo, "SwapTotal: %8llu kB\n", -- (meminfo.swaptotal - meminfo.memtotal)); -- } else if (STREQ(line, "SwapFree") && -- virMemoryLimitIsSet(def->mem.swap_hard_limit)) { -- virBufferAsprintf(new_meminfo, "SwapFree: %8llu kB\n", -- (meminfo.swaptotal - meminfo.memtotal - -- meminfo.swapusage + meminfo.memusage)); -- } else { -- *ptr = ':'; -- virBufferAdd(new_meminfo, line, -1); -- } -- -- if (virBufferCheckError(new_meminfo) < 0) { -- res = -errno; -- goto cleanup; -- } -- -- copied += strlen(line); -- if (copied > size) -- copied = size; -+ if (!ptr) -+ continue; -+ *ptr = '\0'; -+ -+ if (STREQ(line, "MemTotal") && -+ (virMemoryLimitIsSet(def->mem.hard_limit) || -+ virDomainDefGetMemoryActual(def))) { -+ virBufferAsprintf(new_meminfo, "MemTotal: %8llu kB\n", -+ meminfo.memtotal); -+ } else if (STREQ(line, "MemFree") && -+ (virMemoryLimitIsSet(def->mem.hard_limit) || -+ virDomainDefGetMemoryActual(def))) { -+ virBufferAsprintf(new_meminfo, "MemFree: %8llu kB\n", -+ (meminfo.memtotal - meminfo.memusage)); -+ } else if (STREQ(line, "Buffers")) { -+ virBufferAsprintf(new_meminfo, "Buffers: %8d kB\n", 0); -+ } else if (STREQ(line, "Cached")) { -+ virBufferAsprintf(new_meminfo, "Cached: %8llu kB\n", -+ meminfo.cached); -+ } else if (STREQ(line, "Active")) { -+ virBufferAsprintf(new_meminfo, "Active: %8llu kB\n", -+ (meminfo.active_anon + meminfo.active_file)); -+ } else if (STREQ(line, "Inactive")) { -+ virBufferAsprintf(new_meminfo, "Inactive: %8llu kB\n", -+ (meminfo.inactive_anon + meminfo.inactive_file)); -+ } else if (STREQ(line, "Active(anon)")) { -+ virBufferAsprintf(new_meminfo, "Active(anon): %8llu kB\n", -+ meminfo.active_anon); -+ } else if (STREQ(line, "Inactive(anon)")) { -+ virBufferAsprintf(new_meminfo, "Inactive(anon): %8llu kB\n", -+ meminfo.inactive_anon); -+ } else if (STREQ(line, "Active(file)")) { -+ virBufferAsprintf(new_meminfo, "Active(file): %8llu kB\n", -+ meminfo.active_file); -+ } else if (STREQ(line, "Inactive(file)")) { -+ virBufferAsprintf(new_meminfo, "Inactive(file): %8llu kB\n", -+ meminfo.inactive_file); -+ } else if (STREQ(line, "Unevictable")) { -+ virBufferAsprintf(new_meminfo, "Unevictable: %8llu kB\n", -+ meminfo.unevictable); -+ } else if (STREQ(line, "SwapTotal") && -+ virMemoryLimitIsSet(def->mem.swap_hard_limit)) { -+ virBufferAsprintf(new_meminfo, "SwapTotal: %8llu kB\n", -+ (meminfo.swaptotal - meminfo.memtotal)); -+ } else if (STREQ(line, "SwapFree") && -+ virMemoryLimitIsSet(def->mem.swap_hard_limit)) { -+ virBufferAsprintf(new_meminfo, "SwapFree: %8llu kB\n", -+ (meminfo.swaptotal - meminfo.memtotal - -+ meminfo.swapusage + meminfo.memusage)); -+ } else { -+ *ptr = ':'; -+ virBufferAdd(new_meminfo, line, -1); - } -+ -+ if (virBufferCheckError(new_meminfo) < 0) { -+ res = -errno; -+ goto cleanup; -+ } -+ -+ copied += strlen(line); -+ if (copied > size) -+ copied = size; - } - res = copied; - memcpy(buf, virBufferCurrentContent(new_meminfo), copied); diff --git a/0010-lxc-fuse-Fix-proc-meminfo-size-calculation.patch b/0010-lxc-fuse-Fix-proc-meminfo-size-calculation.patch deleted file mode 100644 index f2fa964..0000000 --- a/0010-lxc-fuse-Fix-proc-meminfo-size-calculation.patch +++ /dev/null @@ -1,55 +0,0 @@ -From: Cole Robinson -Date: Thu, 21 Jan 2016 13:14:54 -0500 -Subject: [PATCH] lxc: fuse: Fix /proc/meminfo size calculation - -We virtualize bits of /proc/meminfo by replacing host values with -values specific to the container. - -However for calculating the final size of the returned data, we are -using the size of the original file and not the altered copy, which -could give garbelled output. - -(cherry picked from commit 8418245a7e00f873594f1000c9606d08265088e0) ---- - src/lxc/lxc_fuse.c | 13 +++++-------- - 1 file changed, 5 insertions(+), 8 deletions(-) - -diff --git a/src/lxc/lxc_fuse.c b/src/lxc/lxc_fuse.c -index f9c02c0..e6369f8 100644 ---- a/src/lxc/lxc_fuse.c -+++ b/src/lxc/lxc_fuse.c -@@ -131,7 +131,6 @@ static int lxcProcHostRead(char *path, char *buf, size_t size, off_t offset) - static int lxcProcReadMeminfo(char *hostpath, virDomainDefPtr def, - char *buf, size_t size, off_t offset) - { -- int copied = 0; - int res; - FILE *fd = NULL; - char *line = NULL; -@@ -159,7 +158,7 @@ static int lxcProcReadMeminfo(char *hostpath, virDomainDefPtr def, - } - - res = -1; -- while (copied < size && getline(&line, &n, fd) > 0) { -+ while (getline(&line, &n, fd) > 0) { - char *ptr = strchr(line, ':'); - if (!ptr) - continue; -@@ -219,13 +218,11 @@ static int lxcProcReadMeminfo(char *hostpath, virDomainDefPtr def, - res = -errno; - goto cleanup; - } -- -- copied += strlen(line); -- if (copied > size) -- copied = size; - } -- res = copied; -- memcpy(buf, virBufferCurrentContent(new_meminfo), copied); -+ res = strlen(virBufferCurrentContent(new_meminfo)); -+ if (res > size) -+ res = size; -+ memcpy(buf, virBufferCurrentContent(new_meminfo), res); - - cleanup: - VIR_FREE(line); diff --git a/0011-lxc-fuse-Fill-in-MemAvailable-for-proc-meminfo.patch b/0011-lxc-fuse-Fill-in-MemAvailable-for-proc-meminfo.patch deleted file mode 100644 index 88e0955..0000000 --- a/0011-lxc-fuse-Fill-in-MemAvailable-for-proc-meminfo.patch +++ /dev/null @@ -1,34 +0,0 @@ -From: Cole Robinson -Date: Thu, 21 Jan 2016 13:18:04 -0500 -Subject: [PATCH] lxc: fuse: Fill in MemAvailable for /proc/meminfo - -'free' on Fedora 23 will use MemAvailable to calculate its 'available' -field, but we are passing through the host's value. Set it to match -MemFree, which is what 'free' will do for older linux that don't have -MemAvailable - -https://bugzilla.redhat.com/show_bug.cgi?id=1300781 -(cherry picked from commit c7be484d1136834614089c9a74a3818594852f24) ---- - src/lxc/lxc_fuse.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/src/lxc/lxc_fuse.c b/src/lxc/lxc_fuse.c -index e6369f8..691ddee 100644 ---- a/src/lxc/lxc_fuse.c -+++ b/src/lxc/lxc_fuse.c -@@ -174,6 +174,14 @@ static int lxcProcReadMeminfo(char *hostpath, virDomainDefPtr def, - virDomainDefGetMemoryActual(def))) { - virBufferAsprintf(new_meminfo, "MemFree: %8llu kB\n", - (meminfo.memtotal - meminfo.memusage)); -+ } else if (STREQ(line, "MemAvailable") && -+ (virMemoryLimitIsSet(def->mem.hard_limit) || -+ virDomainDefGetMemoryActual(def))) { -+ /* MemAvailable is actually MemFree + SRReclaimable + -+ some other bits, but MemFree is the closest approximation -+ we have */ -+ virBufferAsprintf(new_meminfo, "MemAvailable: %8llu kB\n", -+ (meminfo.memtotal - meminfo.memusage)); - } else if (STREQ(line, "Buffers")) { - virBufferAsprintf(new_meminfo, "Buffers: %8d kB\n", 0); - } else if (STREQ(line, "Cached")) { diff --git a/0012-lxc-fuse-Stub-out-Slab-bits-in-proc-meminfo.patch b/0012-lxc-fuse-Stub-out-Slab-bits-in-proc-meminfo.patch deleted file mode 100644 index 71f3d99..0000000 --- a/0012-lxc-fuse-Stub-out-Slab-bits-in-proc-meminfo.patch +++ /dev/null @@ -1,35 +0,0 @@ -From: Cole Robinson -Date: Thu, 21 Jan 2016 13:33:50 -0500 -Subject: [PATCH] lxc: fuse: Stub out Slab bits in /proc/meminfo - -'free' on fedora23 wants to use the Slab field for calculated used -memory. The equation is: - -used = MemTotal - MemFree - (Cached + Slab) - Buffers - -We already set Cached and Buffers to 0, do the same for Slab and its -related values - -https://bugzilla.redhat.com/show_bug.cgi?id=1300781 -(cherry picked from commit 81da8bc73b6bc6777632b65a0df45335f7caebe4) ---- - src/lxc/lxc_fuse.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/src/lxc/lxc_fuse.c b/src/lxc/lxc_fuse.c -index 691ddee..8c20a7d 100644 ---- a/src/lxc/lxc_fuse.c -+++ b/src/lxc/lxc_fuse.c -@@ -217,6 +217,12 @@ static int lxcProcReadMeminfo(char *hostpath, virDomainDefPtr def, - virBufferAsprintf(new_meminfo, "SwapFree: %8llu kB\n", - (meminfo.swaptotal - meminfo.memtotal - - meminfo.swapusage + meminfo.memusage)); -+ } else if (STREQ(line, "Slab")) { -+ virBufferAsprintf(new_meminfo, "Slab: %8d kB\n", 0); -+ } else if (STREQ(line, "SReclaimable")) { -+ virBufferAsprintf(new_meminfo, "SReclaimable: %8d kB\n", 0); -+ } else if (STREQ(line, "SUnreclaim")) { -+ virBufferAsprintf(new_meminfo, "SUnreclaim: %8d kB\n", 0); - } else { - *ptr = ':'; - virBufferAdd(new_meminfo, line, -1); diff --git a/0013-util-virfile-Clarify-setuid-usage-for-virFileRemove.patch b/0013-util-virfile-Clarify-setuid-usage-for-virFileRemove.patch deleted file mode 100644 index 8009df7..0000000 --- a/0013-util-virfile-Clarify-setuid-usage-for-virFileRemove.patch +++ /dev/null @@ -1,62 +0,0 @@ -From: Cole Robinson -Date: Wed, 9 Mar 2016 10:53:54 -0500 -Subject: [PATCH] util: virfile: Clarify setuid usage for virFileRemove - -Break these checks out into their own function, and clearly document -each one. This shouldn't change behavior - -(cherry picked from commit 7cf5343709935694b76af7b134447a2c555400b6) ---- - src/util/virfile.c | 32 +++++++++++++++++++++++++++----- - 1 file changed, 27 insertions(+), 5 deletions(-) - -diff --git a/src/util/virfile.c b/src/util/virfile.c -index d742645..45bb249 100644 ---- a/src/util/virfile.c -+++ b/src/util/virfile.c -@@ -2307,6 +2307,32 @@ virFileOpenAs(const char *path, int openflags, mode_t mode, - } - - -+/* virFileRemoveNeedsSetuid: -+ * @uid: file uid to check -+ * @gid: file gid to check -+ * -+ * Return true if we should use setuid/setgid before deleting a file -+ * owned by the passed uid/gid pair. Needed for NFS with root-squash -+ */ -+static bool -+virFileRemoveNeedsSetuid(uid_t uid, gid_t gid) -+{ -+ /* If running unprivileged, setuid isn't going to work */ -+ if (geteuid() != 0) -+ return false; -+ -+ /* uid/gid weren't specified */ -+ if ((uid == (uid_t) -1) && (gid == (gid_t) -1)) -+ return false; -+ -+ /* already running as proper uid/gid */ -+ if (uid == geteuid() && gid == getegid()) -+ return false; -+ -+ return true; -+} -+ -+ - /* virFileUnlink: - * @path: file to unlink - * @uid: uid that was used to create the file (not required) -@@ -2329,11 +2355,7 @@ virFileUnlink(const char *path, - gid_t *groups; - int ngroups; - -- /* If not running as root or if a non explicit uid/gid was being used for -- * the file/volume, then use unlink directly -- */ -- if ((geteuid() != 0) || -- ((uid == (uid_t) -1) && (gid == (gid_t) -1))) -+ if (!virFileRemoveNeedsSetuid(uid, gid)) - return unlink(path); - - /* Otherwise, we have to deal with the NFS root-squash craziness diff --git a/0014-util-virfile-Only-setuid-for-virFileRemove-if-on-NFS.patch b/0014-util-virfile-Only-setuid-for-virFileRemove-if-on-NFS.patch deleted file mode 100644 index a8217c7..0000000 --- a/0014-util-virfile-Only-setuid-for-virFileRemove-if-on-NFS.patch +++ /dev/null @@ -1,55 +0,0 @@ -From: Cole Robinson -Date: Wed, 9 Mar 2016 12:20:37 -0500 -Subject: [PATCH] util: virfile: Only setuid for virFileRemove if on NFS - -NFS with root-squash is the only reason we need to do setuid/setgid -crazyness in virFileRemove, so limit that behavior to the NFS case. - -(cherry picked from commit adefc561cc4c6a007529769c3df286f2ed461684) ---- - src/util/virfile.c | 11 +++++++++-- - 1 file changed, 9 insertions(+), 2 deletions(-) - -diff --git a/src/util/virfile.c b/src/util/virfile.c -index 45bb249..1dc6601 100644 ---- a/src/util/virfile.c -+++ b/src/util/virfile.c -@@ -2308,6 +2308,7 @@ virFileOpenAs(const char *path, int openflags, mode_t mode, - - - /* virFileRemoveNeedsSetuid: -+ * @path: file we plan to remove - * @uid: file uid to check - * @gid: file gid to check - * -@@ -2315,7 +2316,7 @@ virFileOpenAs(const char *path, int openflags, mode_t mode, - * owned by the passed uid/gid pair. Needed for NFS with root-squash - */ - static bool --virFileRemoveNeedsSetuid(uid_t uid, gid_t gid) -+virFileRemoveNeedsSetuid(const char *path, uid_t uid, gid_t gid) - { - /* If running unprivileged, setuid isn't going to work */ - if (geteuid() != 0) -@@ -2329,6 +2330,12 @@ virFileRemoveNeedsSetuid(uid_t uid, gid_t gid) - if (uid == geteuid() && gid == getegid()) - return false; - -+ /* Only perform the setuid stuff for NFS, which is the only case -+ that may actually need it. This can error, but just be safe and -+ only check for a clear negative result. */ -+ if (virFileIsSharedFSType(path, VIR_FILE_SHFS_NFS) == 0) -+ return false; -+ - return true; - } - -@@ -2355,7 +2362,7 @@ virFileUnlink(const char *path, - gid_t *groups; - int ngroups; - -- if (!virFileRemoveNeedsSetuid(uid, gid)) -+ if (!virFileRemoveNeedsSetuid(path, uid, gid)) - return unlink(path); - - /* Otherwise, we have to deal with the NFS root-squash craziness diff --git a/0015-rpc-wait-longer-for-session-daemon-to-start-up.patch b/0015-rpc-wait-longer-for-session-daemon-to-start-up.patch deleted file mode 100644 index 65c9035..0000000 --- a/0015-rpc-wait-longer-for-session-daemon-to-start-up.patch +++ /dev/null @@ -1,37 +0,0 @@ -From: Cole Robinson -Date: Tue, 15 Mar 2016 17:04:32 -0400 -Subject: [PATCH] rpc: wait longer for session daemon to start up - -https://bugzilla.redhat.com/show_bug.cgi?id=1271183 - -We only wait 0.5 seconds for the session daemon to start up and present -its socket, which isn't sufficient for many users. Bump up the sleep -interval and retry amount so we wait for a total of 5.0 seconds. - -(cherry picked from commit ca0c06f4008154de55e0b3109885facd0bf02d32) ---- - src/rpc/virnetsocket.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c -index b132532..ecedcf5 100644 ---- a/src/rpc/virnetsocket.c -+++ b/src/rpc/virnetsocket.c -@@ -614,7 +614,7 @@ int virNetSocketNewConnectUNIX(const char *path, - char *lockpath = NULL; - int lockfd = -1; - int fd = -1; -- int retries = 100; -+ int retries = 500; - virSocketAddr localAddr; - virSocketAddr remoteAddr; - char *rundir = NULL; -@@ -707,7 +707,7 @@ int virNetSocketNewConnectUNIX(const char *path, - daemonLaunched = true; - } - -- usleep(5000); -+ usleep(10000); - } - - localAddr.len = sizeof(localAddr.data); diff --git a/0016-driver-log-missing-modules-as-INFO-not-WARN.patch b/0016-driver-log-missing-modules-as-INFO-not-WARN.patch deleted file mode 100644 index 8c7d53e..0000000 --- a/0016-driver-log-missing-modules-as-INFO-not-WARN.patch +++ /dev/null @@ -1,27 +0,0 @@ -From: Jovanka Gulicoska -Date: Thu, 17 Mar 2016 20:02:20 +0100 -Subject: [PATCH] driver: log missing modules as INFO, not WARN - -Missing modules is a common expected scenario for most libvirt usage on -RPM distributions like Fedora, so it doesn't really warrant logging at -WARN level. Use INFO instead - -https://bugzilla.redhat.com/show_bug.cgi?id=1274849 -(cherry picked from commit 9a0c7f5f834185db9017c34aabc03ad99cf37bed) ---- - src/driver.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/driver.c b/src/driver.c -index 2985538..1514a3b 100644 ---- a/src/driver.c -+++ b/src/driver.c -@@ -62,7 +62,7 @@ virDriverLoadModule(const char *name) - return NULL; - - if (access(modfile, R_OK) < 0) { -- VIR_WARN("Module %s not accessible", modfile); -+ VIR_INFO("Module %s not accessible", modfile); - goto cleanup; - } - diff --git a/libvirt.spec b/libvirt.spec index f5eca10..1f2a977 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -377,8 +377,8 @@ Summary: Library providing a simple virtualization API Name: libvirt -Version: 1.2.18.2 -Release: 3%{?dist}%{?extra_release} +Version: 1.2.18.3 +Release: 1%{?dist}%{?extra_release} License: LGPLv2+ Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root @@ -389,34 +389,6 @@ URL: http://libvirt.org/ %endif Source: http://libvirt.org/sources/%{?mainturl}libvirt-%{version}.tar.gz -# Fix XML validation with qemu commandline passthrough (bz #1292131) -Patch0001: 0001-schema-interleave-domain-name-and-uuid-with-other-el.patch -# Fix crash in libvirt_leasehelper (bz #1202350) -Patch0002: 0002-leaseshelper-fix-crash-when-no-mac-is-specified.patch -# Generate consistent systemtap tapsets regardless of host arch (bz -# #1173641) -Patch0003: 0003-build-predictably-generate-systemtap-tapsets-bz-1173.patch -# Fix qemu:///session error 'Transport endpoint is not connected' (bz -# #1271183) -Patch0004: 0004-rpc-socket-Minor-cleanups.patch -Patch0005: 0005-rpc-socket-Explicitly-error-if-we-exceed-retry-count.patch -Patch0006: 0006-rpc-socket-Don-t-repeatedly-attempt-to-launch-daemon.patch -# Fix parallel VM start/top svirt errors on kernel/initrd (bz #1269975) -Patch0007: 0007-security-Do-not-restore-kernel-and-initrd-labels.patch -# Fix lxc /proc/meminfo virtualization (bz #1300781) -Patch0008: 0008-virfile-Fix-error-path-for-forked-virFileRemove.patch -Patch0009: 0009-lxc-fuse-Unindent-meminfo-logic.patch -Patch0010: 0010-lxc-fuse-Fix-proc-meminfo-size-calculation.patch -Patch0011: 0011-lxc-fuse-Fill-in-MemAvailable-for-proc-meminfo.patch -Patch0012: 0012-lxc-fuse-Stub-out-Slab-bits-in-proc-meminfo.patch -# Fix 'permission denied' errors trying to unlink disk images (bz #1289327) -Patch0013: 0013-util-virfile-Clarify-setuid-usage-for-virFileRemove.patch -Patch0014: 0014-util-virfile-Only-setuid-for-virFileRemove-if-on-NFS.patch -# Fix qemu:///session connect race failures (bz #1271183) -Patch0015: 0015-rpc-wait-longer-for-session-daemon-to-start-up.patch -# driver: log missing modules as INFO, not WARN (bz #1274849) -Patch0016: 0016-driver-log-missing-modules-as-INFO-not-WARN.patch - %if %{with_libvirtd} Requires: libvirt-daemon = %{version}-%{release} %if %{with_network} @@ -1221,7 +1193,6 @@ namespaces. Summary: Libraries, includes, etc. to compile with the libvirt library Group: Development/Libraries Requires: %{name}-client = %{version}-%{release} -Requires: %{name}-docs = %{version}-%{release} Requires: pkgconfig %description devel @@ -1828,6 +1799,14 @@ if test $1 -eq 1 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml ; < %{_datadir}/libvirt/networks/default.xml \ > %{_sysconfdir}/libvirt/qemu/networks/default.xml ln -s ../default.xml %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml + + # Make sure libvirt picks up the new network defininiton + %if %{with_systemd} + /bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 ||: + %else + /sbin/service libvirtd condrestart > /dev/null 2>&1 || : + %endif + fi %endif @@ -1925,7 +1904,8 @@ exit 0 %files docs %defattr(-, root, root) -%doc AUTHORS ChangeLog.gz NEWS README TODO libvirt-docs/* +%doc AUTHORS ChangeLog.gz NEWS README TODO +%doc libvirt-docs/* # API docs %dir %{_datadir}/gtk-doc/html/libvirt/ @@ -1933,6 +1913,15 @@ exit 0 %doc %{_datadir}/gtk-doc/html/libvirt/*.html %doc %{_datadir}/gtk-doc/html/libvirt/*.png %doc %{_datadir}/gtk-doc/html/libvirt/*.css +%doc examples/hellolibvirt +%doc examples/object-events +%doc examples/dominfo +%doc examples/domsuspend +%doc examples/dommigrate +%doc examples/openauth +%doc examples/xml +%doc examples/systemtap + %if %{with_libvirtd} %files daemon @@ -2345,20 +2334,14 @@ exit 0 %{_datadir}/libvirt/api/libvirt-api.xml %{_datadir}/libvirt/api/libvirt-qemu-api.xml %{_datadir}/libvirt/api/libvirt-lxc-api.xml - - -%doc docs/*.html docs/html docs/*.gif +# Needed building python bindings %doc docs/libvirt-api.xml -%doc examples/hellolibvirt -%doc examples/object-events -%doc examples/dominfo -%doc examples/domsuspend -%doc examples/dommigrate -%doc examples/openauth -%doc examples/xml -%doc examples/systemtap %changelog +* Wed May 04 2016 Cole Robinson - 1.2.18.3-1 +- Rebased to version 1.2.18.3 +- Start network after config-network RPM install (bz #867546) + * Thu Mar 17 2016 Cole Robinson - 1.2.18.2-3 - Fix lxc /proc/meminfo virtualization (bz #1300781) - Fix 'permission denied' errors trying to unlink disk images (bz #1289327) diff --git a/sources b/sources index ad328dd..475b795 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -b6c48b3073482a00bbae0e41e9548227 libvirt-1.2.18.2.tar.gz +bcb0738ff66972ddb25cfe0d086c5c37 libvirt-1.2.18.3.tar.gz