Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:GA
salt.21019
virt-pass-emulator-when-getting-domain-capabili...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File virt-pass-emulator-when-getting-domain-capabilities-.patch of Package salt.21019
From 275ef63efc163f5ab7eb617d32e0396f8504c189 Mon Sep 17 00:00:00 2001 From: Cedric Bosdonnat <cedric.bosdonnat@free.fr> Date: Tue, 6 Jul 2021 09:10:16 +0200 Subject: [PATCH] virt: pass emulator when getting domain capabilities from libvirt (#393) On aarch64, for some emulated architectures like armv6l libvirt needs to have the emulator path to properly return the domain capabilities. Passing it will avoid virt.all_capabilities to fail on such architectures. --- changelog/60491.fixed | 1 + salt/modules/virt.py | 10 +++++++--- tests/unit/modules/test_virt.py | 4 ++++ 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 changelog/60491.fixed diff --git a/changelog/60491.fixed b/changelog/60491.fixed new file mode 100644 index 0000000000..256d29b5fb --- /dev/null +++ b/changelog/60491.fixed @@ -0,0 +1 @@ +Pass emulator path to get guest capabilities from libvirt diff --git a/salt/modules/virt.py b/salt/modules/virt.py index 29385ac64c..d680da612a 100644 --- a/salt/modules/virt.py +++ b/salt/modules/virt.py @@ -6670,7 +6670,11 @@ def all_capabilities(**kwargs): host_caps = ElementTree.fromstring(conn.getCapabilities()) domains = [ [ - (guest.get("arch", {}).get("name", None), key) + ( + guest.get("arch", {}).get("name", None), + key, + guest.get("arch", {}).get("emulator", None), + ) for key in guest.get("arch", {}).get("domains", {}).keys() ] for guest in [ @@ -6688,10 +6692,10 @@ def all_capabilities(**kwargs): "domains": [ _parse_domain_caps( ElementTree.fromstring( - conn.getDomainCapabilities(None, arch, None, domain) + conn.getDomainCapabilities(emulator, arch, None, domain) ) ) - for (arch, domain) in flattened + for (arch, domain, emulator) in flattened ], } finally: diff --git a/tests/unit/modules/test_virt.py b/tests/unit/modules/test_virt.py index 4d9ea2501a..f0bd956d73 100644 --- a/tests/unit/modules/test_virt.py +++ b/tests/unit/modules/test_virt.py @@ -5056,6 +5056,10 @@ class VirtTestCase(TestCase, LoaderModuleMockMixin): {"qemu", "kvm"}, {domainCaps["domain"] for domainCaps in caps["domains"]}, ) + self.mock_conn.getDomainCapabilities.assert_called_with( + "/usr/bin/qemu-system-x86_64", "x86_64", None, "kvm" + ) + def test_network_tag(self): """ Test virt._get_net_xml() with VLAN tag -- 2.32.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor