[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Viryaos-discuss] [PATCH 1/2] uboot-script-gen: prevent user mistakes due to DOM0_KERNEL becoming optional


  • To: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Ayan Kumar Halder <ayankuma@xxxxxxx>
  • Date: Mon, 27 Jun 2022 10:12:37 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=akhsvOYGdoJ+diln81bTJZEySyGASwisIxxl8Q5BpCM=; b=VsWlUXLeXrAdMzSpng7ukvVVLCQBYrx+CdaUAiHwFDiMRm5oP1kw8nQxFoOVVvmZImdQbk9yPMpkedQG1D1zwQPDoL/zeGOaiqmj4JZr+KRBPXbiUsmIR+45sxW7/txtDe/NosvW3FXUzCf9Ps5S/08RE2gpNcN8LOh4hLrv6Ffrggs+ppi58Wr4Bwd3cKlbus6Rw5oyASndkCtC2uq5XNUVAky60fz/aj1hqlM+y7nrWT/hfBa/gXsHd0L+dFfrNP6/LVukWt5NbEI07FteAvbKrdA3tFt7U4F8Y9lAQKf0pkepIfg3TIm0hgl82O2FpJja13RUBw8qWavEQsx6Ow==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Cipr/Qr93yAE6mIczRhvbwlvkuykh2JziJdQRejBexHNOoT7Egb4RraD8R0OWGqI6EX376CVWSgeF5Q4A/Edt0X6siIR8xb98sjmqAiQ8t5/lUTF2IauKcJ2ouMsUbRT6zuMJ/H8bnnlYkTwV4GmhDM1qVuoFlnviUqhUlWwMeEbp0oZ1vI/EUAWeUIFoVUCgBcyNKZ2CqT5FuKABOYn5mwVCRrIkpJUW24Mb2VHkfj351Xuzg5YlrQWgAkyWoG8nkNj3tStGLBLAj45sxHymt32ZfmXIWeD27Y/JC41PdjT4YYVEesN8pe6ynJ/WKblq9ZBtEi+tx14UfDEXEChwg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: viryaos-discuss@xxxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 27 Jun 2022 09:13:10 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 26/06/2022 19:45, Xenia Ragiadakou wrote:
Before enabling true dom0less configuration, the script was failing instantly
if DOM0_KERNEL parameter was not specified. This behaviour has changed and
this needs to be communicated to the user.

Mention in README.md that for dom0less configurations, the parameter
DOM0_KERNEL is optional.

If DOM0_KERNEL is not set, check that no other dom0 specific parameters are
specified by the user. Fail the script early with an appropriate error
message, if it was invoked with erroneous configuration settings.

Change message "Dom0 kernel is not specified, continue with dom0less setup."
to "Dom0 kernel is not specified, continue with true dom0less setup."
to refer more accurately to a dom0less setup without dom0.

Signed-off-by: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
Reviewed-by: Ayan Kumar Halder <ayankuma@xxxxxxx>
---
  README.md                |  1 +
  scripts/uboot-script-gen | 21 ++++++++++++++-------
  2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/README.md b/README.md
index 17ff206..cb15ca5 100644
--- a/README.md
+++ b/README.md
@@ -100,6 +100,7 @@ Where:
    been specified in XEN_PASSTHROUGH_PATHS.
- DOM0_KERNEL specifies the Dom0 kernel file to load.
+  For dom0less configurations, the parameter is optional.
- DOM0_MEM specifies the amount of memory for Dom0 VM in MB. The default
    is 1024. This is only applicable when XEN_CMD is not specified.
diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
index e85c6ec..085e29f 100755
--- a/scripts/uboot-script-gen
+++ b/scripts/uboot-script-gen
@@ -410,6 +410,20 @@ function find_root_dev()
function xen_config()
  {
+    if test -z "$DOM0_KERNEL"
+    then
+        if test "$NUM_DOMUS" -eq "0"
+        then
+            echo "Neither dom0 or domUs are specified, exiting."
+            exit 1
+        elif test "$DOM0_MEM" || test "$DOM0_VCPUS" || test "$DOM0_COLORS" || test "$DOM0_CMD" || 
test "$DOM0_RAMDISK" || test "$DOM0_ROOTFS"
+        then
+            echo "For dom0less configuration without dom0, no dom0 specific 
parameters should be specified, exiting."
+            exit 1
+        fi
+        echo "Dom0 kernel is not specified, continue with true dom0less setup."
+    fi
+
      if [ -z "$XEN_CMD" ]
      then
          if [ -z "$DOM0_MEM" ]
@@ -457,13 +471,6 @@ function xen_config()
      fi
      if test -z "$DOM0_KERNEL"
      then
-        if test "$NUM_DOMUS" -eq "0"
-        then
-            echo "Neither dom0 or domUs are specified, exiting."
-            exit 1
-        fi
-        echo "Dom0 kernel is not specified, continue with dom0less setup."
-        unset DOM0_RAMDISK
          # Remove dom0 specific parameters from the XEN command line.
          local params=($XEN_CMD)
          XEN_CMD="${params[@]/dom0*/}"



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.