Blame SOURCES/virt-manager-cli-introduce-resource-fibrechannel.appid-option.patch

01947c
From c1da35159c20e0d633f6c568bb984311a4fed861 Mon Sep 17 00:00:00 2001
01947c
From: Pavel Hrdina <phrdina@redhat.com>
01947c
Date: Tue, 14 Sep 2021 17:08:35 +0200
01947c
Subject: [PATCH] cli: introduce --resource fibrechannel.appid option
01947c
01947c
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
01947c
(cherry picked from commit 0953e1aea1fd16cd1825c03f3b032c7f12f3322f)
01947c
01947c
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2011327
01947c
01947c
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
01947c
---
01947c
 tests/data/cli/compare/virt-install-singleton-config-1.xml | 1 +
01947c
 tests/test_cli.py                                          | 2 +-
01947c
 virtinst/cli.py                                            | 1 +
01947c
 virtinst/domain/resource.py                                | 3 ++-
01947c
 4 files changed, 5 insertions(+), 2 deletions(-)
01947c
01947c
diff --git a/tests/data/cli/compare/virt-install-singleton-config-1.xml b/tests/data/cli/compare/virt-install-singleton-config-1.xml
01947c
index 518a0099..b50d806e 100644
01947c
--- a/tests/data/cli/compare/virt-install-singleton-config-1.xml
01947c
+++ b/tests/data/cli/compare/virt-install-singleton-config-1.xml
01947c
@@ -19,6 +19,7 @@
01947c
   </numatune>
01947c
   <resource>
01947c
     <partition>/virtualmachines/production</partition>
01947c
+    <fibrechannel appid="myapplication"/>
01947c
   </resource>
01947c
   <os>
01947c
     <type arch="x86_64" machine="q35">hvm</type>
01947c
diff --git a/tests/test_cli.py b/tests/test_cli.py
01947c
index 5e69a135..5b174933 100644
01947c
--- a/tests/test_cli.py
01947c
+++ b/tests/test_cli.py
01947c
@@ -480,7 +480,7 @@ c.add_compare("""
01947c
 --memorybacking hugepages=on
01947c
 --features apic=off
01947c
 --clock offset=localtime
01947c
---resource /virtualmachines/production
01947c
+--resource /virtualmachines/production,fibrechannel.appid=myapplication
01947c
 --events on_crash=restart
01947c
 --metadata genid_enable=yes
01947c
 --sysinfo host
01947c
diff --git a/virtinst/cli.py b/virtinst/cli.py
01947c
index 8e5b13cd..e1a988f9 100644
01947c
--- a/virtinst/cli.py
01947c
+++ b/virtinst/cli.py
01947c
@@ -1999,6 +1999,7 @@ class ParserResource(VirtCLIParser):
01947c
     def _init_class(cls, **kwargs):
01947c
         VirtCLIParser._init_class(**kwargs)
01947c
         cls.add_arg("partition", "partition")
01947c
+        cls.add_arg("fibrechannel.appid", "fibrechannel_appid", can_comma=True)
01947c
 
01947c
 
01947c
 ######################
01947c
diff --git a/virtinst/domain/resource.py b/virtinst/domain/resource.py
01947c
index d0962db9..8ad3df54 100644
01947c
--- a/virtinst/domain/resource.py
01947c
+++ b/virtinst/domain/resource.py
01947c
@@ -14,6 +14,7 @@ class DomainResource(XMLBuilder):
01947c
     """
01947c
 
01947c
     XML_NAME = "resource"
01947c
-    _XML_PROP_ORDER = ["partition"]
01947c
+    _XML_PROP_ORDER = ["partition", "fibrechannel_appid"]
01947c
 
01947c
     partition = XMLProperty("./partition")
01947c
+    fibrechannel_appid = XMLProperty("./fibrechannel/@appid")
01947c
-- 
01947c
2.31.1
01947c