Compare commits

...
Sign in to create a new pull request.

2 commits

Author SHA1 Message Date
Cole Robinson
bc35747c40 virt-manager-3.2.0-2
Fix 'domain not found' race (bz #1901081)
2021-01-11 13:51:56 -05:00
Cole Robinson
5414a9de30 virt-manager-3.2.0-1
Update to version 3.2.0
Slim down filesystem device editor UI
Fix TOCTTOU virt-install bugs (Martin Pitt)
Several other bug fixes
2020-11-14 16:22:08 -05:00
3 changed files with 59 additions and 3 deletions

View file

@ -0,0 +1,44 @@
From 4d0e323227f18e58283c45be4d240b506faacb22 Mon Sep 17 00:00:00 2001
Message-Id: <4d0e323227f18e58283c45be4d240b506faacb22.1610391095.git.crobinso@redhat.com>
From: Martin Pitt <martin@piware.de>
Date: Tue, 24 Nov 2020 14:24:06 +0100
Subject: [PATCH virt-manager] virtinst: Fix TOCTOU in domain enumeration
Similar to commit 49a01b5482, _fetch_all_domains_raw() has a race
condition where a domain may disappear (from parallel libvirt
operations) in between enumerating and inspecting the objects.
Ignore these missing domains instead of crashing.
https://bugzilla.redhat.com/show_bug.cgi?id=1901081
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
virtinst/connection.py | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/virtinst/connection.py b/virtinst/connection.py
index fec273b7..06bc60ad 100644
--- a/virtinst/connection.py
+++ b/virtinst/connection.py
@@ -182,8 +182,16 @@ class VirtinstConnection(object):
def _fetch_all_domains_raw(self):
dummy1, dummy2, ret = pollhelpers.fetch_vms(
self, {}, lambda obj, ignore: obj)
- return [Guest(weakref.proxy(self), parsexml=obj.XMLDesc(0))
- for obj in ret]
+ domains = []
+ for obj in ret:
+ # TOCTOU race: a domain may go away in between enumeration and inspection
+ try:
+ xml = obj.XMLDesc(0)
+ except libvirt.libvirtError as e: # pragma: no cover
+ log.debug("Fetching domain XML failed: %s", e)
+ continue
+ domains.append(Guest(weakref.proxy(self), parsexml=xml))
+ return domains
def _build_pool_raw(self, poolobj):
return StoragePool(weakref.proxy(self),
--
2.29.2

View file

@ -1 +1 @@
SHA512 (virt-manager-3.1.0.tar.gz) = 185e34d8ebb2f9755bf9732bdafdbe9d0924d8c3b69758947252cce5deeac2042f473ba63673eea2bf36beb1f216a856938650f86e2c86eb5618e8f8522df53d
SHA512 (virt-manager-3.2.0.tar.gz) = 90cd98fe6b269007cd30f628490c65df440abe39b4925c65dc80667e7d80d059752695353ccf6ac3e2436206da311bc402eda50df31874d82ef8fe115966e1ec

View file

@ -7,8 +7,8 @@
# End local config
Name: virt-manager
Version: 3.1.0
Release: 1%{?dist}
Version: 3.2.0
Release: 2%{?dist}
%global verrel %{version}-%{release}
Summary: Desktop tool for managing virtual machines via libvirt
@ -17,6 +17,9 @@ BuildArch: noarch
URL: https://virt-manager.org/
Source0: https://virt-manager.org/download/sources/%{name}/%{name}-%{version}.tar.gz
# Fix 'domain not found' race (bz #1901081)
Patch0001: 0001-virtinst-Fix-TOCTOU-in-domain-enumeration.patch
Requires: virt-manager-common = %{verrel}
Requires: python3-gobject
@ -167,6 +170,15 @@ done
%changelog
* Mon Jan 11 2021 Cole Robinson <crobinso@redhat.com> - 3.2.0-2
- Fix 'domain not found' race (bz #1901081)
* Sat Nov 14 2020 Cole Robinson <crobinso@redhat.com> - 3.2.0-1
- Update to version 3.2.0
- Slim down filesystem device editor UI
- Fix TOCTTOU virt-install bugs (Martin Pitt)
- Several other bug fixes
* Wed Sep 30 2020 Cole Robinson <crobinso@redhat.com> - 3.1.0-1
- Update to version 3.1.0