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

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