linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomas Racek <tracek@redhat.com>
To: linux-ext4@vger.kernel.org
Cc: Tomas Racek <tracek@redhat.com>
Subject: [PATCH 3/3] e2image: require that -a option is used only with raw or QCOW2 image
Date: Sat, 16 Mar 2013 10:13:25 +0100	[thread overview]
Message-ID: <1363425205-10970-3-git-send-email-tracek@redhat.com> (raw)
In-Reply-To: <1363425205-10970-1-git-send-email-tracek@redhat.com>

All data cannot be included in normal image file so e2image should exit
in this case.

Signed-off-by: Tomas Racek <tracek@redhat.com>
---
 misc/e2image.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/misc/e2image.c b/misc/e2image.c
index 6988c4d..b4e4cf9 100644
--- a/misc/e2image.c
+++ b/misc/e2image.c
@@ -1295,6 +1295,13 @@ int main (int argc, char ** argv)
 		}
 	if (optind != argc - 2 )
 		usage();
+
+	if(all_data && !img_type) {
+		com_err(program_name, 0, "-a option can only be used "
+					 "with raw or QCOW2 images.");
+		exit(1);
+	}
+
 	device_name = argv[optind];
 	image_fn = argv[optind+1];
 
-- 
1.7.11.7


  parent reply	other threads:[~2013-03-16  9:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-16  9:13 [PATCH 1/3] e2image: Remove useless exit call Tomas Racek
2013-03-16  9:13 ` [PATCH 2/3] e2image: man: fix typo Tomas Racek
2013-04-22  3:23   ` Theodore Ts'o
2013-03-16  9:13 ` Tomas Racek [this message]
2013-03-18 15:42   ` [PATCH 3/3] e2image: require that -a option is used only with raw or QCOW2 image Eric Sandeen
2013-04-22  3:23   ` Theodore Ts'o
2013-04-22  3:23 ` [PATCH 1/3] e2image: Remove useless exit call Theodore Ts'o

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=1363425205-10970-3-git-send-email-tracek@redhat.com \
    --to=tracek@redhat.com \
    --cc=linux-ext4@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).