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

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