All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Serbinenko <phcoder@gmail.com>
To: grub-devel@gnu.org
Cc: Vladimir Serbinenko <phcoder@gmail.com>
Subject: [PATCH 2/2] Support qcow in grub-fstest
Date: Thu, 16 May 2024 21:57:48 +0300	[thread overview]
Message-ID: <20240516185748.3051-2-phcoder@gmail.com> (raw)
In-Reply-To: <20240516185748.3051-1-phcoder@gmail.com>

Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
---
 util/grub-fstest.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/util/grub-fstest.c b/util/grub-fstest.c
index 7ff9037b8..3c4fa26c6 100644
--- a/util/grub-fstest.c
+++ b/util/grub-fstest.c
@@ -383,12 +383,14 @@ static int cmd = 0;
 static char *debug_str = NULL;
 static char **args = NULL;
 static int mount_crypt = 0;
+static int mount_qcow = 0;
 
 static void
 fstest (int n)
 {
   char *host_file;
   char *loop_name;
+  const char *loopback_cmd = mount_qcow ? "qcow" : "loopback";
   int i;
 
   for (i = 0; i < num_disks; i++)
@@ -405,8 +407,8 @@ fstest (int n)
       argv[0] = loop_name;
       argv[1] = host_file;
 
-      if (execute_command ("loopback", 2, argv))
-        grub_util_error (_("`loopback' command fails: %s"), grub_errmsg);
+      if (execute_command (loopback_cmd, 2, argv))
+        grub_util_error (_("`%s' command fails: %s"), loopback_cmd, grub_errmsg);
 
       grub_free (loop_name);
       grub_free (host_file);
@@ -530,6 +532,7 @@ static struct argp_option options[] = {
   {"diskcount", 'c', N_("NUM"),           0, N_("Specify the number of input files."),                   2},
   {"debug",     'd', N_("STRING"),           0, N_("Set debug environment variable."),  2},
   {"crypto",   'C', NULL, 0, N_("Mount crypto devices."), 2},
+  {"qcow",      'q', NULL, 0, N_("Mount qcow images."), 2},
   {"zfs-key",      'K',
    /* TRANSLATORS: "prompt" is a keyword.  */
    N_("FILE|prompt"), 0, N_("Load zfs crypto key."),                 2},
@@ -597,6 +600,10 @@ argp_parser (int key, char *arg, struct argp_state *state)
       mount_crypt = 1;
       return 0;
 
+    case 'q':
+      mount_qcow = 1;
+      return 0;
+
     case 's':
       skip = grub_strtoul (arg, &p, 0);
       if (*p == 's')
-- 
2.39.2


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

      reply	other threads:[~2024-05-16 18:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-16 18:57 [PATCH 1/2] Support qcow disks in GRUB Vladimir Serbinenko
2024-05-16 18:57 ` Vladimir Serbinenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240516185748.3051-2-phcoder@gmail.com \
    --to=phcoder@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.