virt-manager/005-7768eb17-cli-Add-check-if-device-boot-order-is-supported.patch
Charles Arnold 2677655bda - jsc#SLE-6262, fate#327048: KVM: Boot Configuration Override
001-adf30349-cli-refactor-get_prop.patch
  002-60c7e778-xmlapi-add-set_prop.patch
  003-5bad22e8-tests-Use-get-set_prop.patch
  004-ee5f3eab-support-Add-SUPPORT_CONN_DEVICE_BOOT_ORDER.patch
  005-7768eb17-cli-Add-check-if-device-boot-order-is-supported.patch
  006-ecc0861c-tests-xmlparse-refactor-method-for-generating-out-file-path.patch
  007-c9d070da-guest-Add-reorder_boot_order-method.patch
  008-1b535940-tests-Add-test-case-for-reorder_boot_order-method.patch
  009-b83a0a61-cli-Use-reorder_boot_order-for-setting-the-boot-order.patch
  010-c896d19d-tests-cli-Add-boot.order-tests.patch
  011-29f9f2ac-virt-xml-Add-no-define-argument.patch
  012-c2bff509-tests-cli-Add-test-case-for-no-define-argument.patch
  013-90b1a3ab-virt-xml-Add-support-for-starting-the-domain.patch
  014-908b8e8d-tests-virt-xml-Add-test-cases-for-start-option.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=468
2019-05-23 15:40:50 +00:00

81 lines
3.0 KiB
Diff

References: jsc#SLE-6262, fate#327048: KVM: Boot Configuration Override (virt-manager)
Subject: cli: Add check if device boot order is supported
From: Marc Hartmayer mhartmay@linux.ibm.com Tue Feb 26 10:56:35 2019 +0100
Date: Wed Mar 6 13:15:38 2019 -0500:
Git: 7768eb17d98352a29f2e5b62035630483d1f3b63
Add a check if device boot order is supported to
Parser(Network|Disk|Redirdev|...) and throw an exception if not.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Index: virt-manager-2.1.0/virtinst/cli.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/cli.py
+++ virt-manager-2.1.0/virtinst/cli.py
@@ -20,6 +20,7 @@ import types
import libvirt
+from virtinst import support
from virtcli import CLIConfig
from . import util, xmlapi
@@ -2154,6 +2155,18 @@ def _add_device_address_args(cls):
cls.add_arg("address.base", "address.base")
+def _add_device_boot_order_arg(cls):
+ def set_boot_order_cb(self, inst, val, virtarg):
+ val = int(val)
+ guest = self.guest
+ if not guest.conn.check_support(support.SUPPORT_CONN_DEVICE_BOOT_ORDER):
+ raise NotImplementedError('Device boot order isn\'t supported by the connection')
+
+ inst.boot.order = val
+ cls.set_boot_order_cb = set_boot_order_cb
+ cls.add_arg("boot.order", "boot_order", cb=cls.set_boot_order_cb)
+
+
##################
# --disk parsing #
##################
@@ -2323,7 +2336,7 @@ class ParserDisk(VirtCLIParser):
cls.add_arg("startup_policy", "startup_policy")
cls.add_arg("read_only", "readonly", is_onoff=True)
cls.add_arg("shareable", "shareable", is_onoff=True)
- cls.add_arg("boot.order", "boot_order")
+ _add_device_boot_order_arg(cls)
cls.add_arg("iotune_rbs", "read_bytes_sec")
cls.add_arg("iotune_wbs", "write_bytes_sec")
@@ -2419,7 +2432,7 @@ class ParserNetwork(VirtCLIParser):
cls.add_arg("model", "model")
cls.add_arg("macaddr", "mac", cb=cls.set_mac_cb)
cls.add_arg("filterref", "filterref")
- cls.add_arg("boot.order", "boot_order")
+ _add_device_boot_order_arg(cls)
cls.add_arg("link_state", "link_state",
cb=cls.set_link_state)
@@ -2637,7 +2650,7 @@ class ParserRedir(VirtCLIParser):
_add_device_address_args(cls)
cls.add_arg("bus", "bus", ignore_default=True)
cls.add_arg("type", "type", ignore_default=True)
- cls.add_arg("boot.order", "boot_order")
+ _add_device_boot_order_arg(cls)
cls.add_arg(None, "server", cb=cls.set_server_cb)
@@ -3048,7 +3061,7 @@ class ParserHostdev(VirtCLIParser):
cb=cls.set_name_cb,
lookup_cb=cls.name_lookup_cb)
cls.add_arg("driver_name", "driver_name")
- cls.add_arg("boot.order", "boot_order")
+ _add_device_boot_order_arg(cls)
cls.add_arg("rom_bar", "rom_bar", is_onoff=True)