virt-manager/backport-virt-install-unattended-and-cloud-init-conflict.patch
yanjianqing 7eef83f602 virt-manager upgrade to version 4.1.0-8
- diskbackend: Drop support for sheepdog
- cli: support --boot loader.stateless=
- virt-install: Reuse cli.fail_conflicting
- virt-install: --unattended and --cloud-init conflict
- cloner: Sync and system uuid
- virt-install: --help required options are wrong
- cli: --cpu: Add maxphysaddr.{mode,bits} options
- tests: Add a compat check for linux2020 in amd-sev test case
- virtinstall: fix regression with --boot and no install method
- virtinstall: split no_install conditional apart to track code coverage

(cherry picked from commit 4f34c95ba5fb8bffd8c4bd183506972a7cbf2828)
2024-08-21 10:14:22 +08:00

46 lines
1.8 KiB
Diff

From 999ccb85e3e4189386786256cdf70cf5238cf785 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Sun, 21 Aug 2022 16:47:26 -0400
Subject: [PATCH] virt-install: --unattended and --cloud-init conflict
Make it an explicit error, otherwise unattended is preferred and
cloud-init is ignored
https://bugzilla.redhat.com/show_bug.cgi?id=2117157
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
tests/test_cli.py | 1 +
virtinst/virtinstall.py | 3 +++
2 files changed, 4 insertions(+)
diff --git a/tests/test_cli.py b/tests/test_cli.py
index ef27276a..cbeebd46 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -1116,6 +1116,7 @@ c.add_invalid("--disk none --boot network --machine foobar", grep="domain type N
c.add_invalid("--nodisks --boot network --arch mips --virt-type kvm", grep="any virtualization options for architecture 'mips'")
c.add_invalid("--nodisks --boot network --paravirt --arch mips", grep=" 'xen' for architecture 'mips'")
c.add_invalid("--osinfo generic --launchSecurity sev --connect " + utils.URIs.kvm_amd_sev, grep="SEV launch security requires a Q35 UEFI machine")
+c.add_invalid("--disk none --cloud-init --unattended --install fedora30", grep="--unattended and --cloud-init can not")
diff --git a/virtinst/virtinstall.py b/virtinst/virtinstall.py
index 37eef1fc..8260628d 100644
--- a/virtinst/virtinstall.py
+++ b/virtinst/virtinstall.py
@@ -411,6 +411,9 @@ def build_installer(options, guest, installdata):
else:
extra_args = [installdata.kernel_args]
+ if options.unattended and options.cloud_init:
+ fail("--unattended and --cloud-init can not be specified together.")
+
if options.unattended:
unattended_data = cli.parse_unattended(options.unattended)
--
2.37.2.windows.2