mrc0mmand / rpms / libguestfs

Forked from rpms/libguestfs 3 years ago
Clone

Blame SOURCES/0036-blockdev-Deprecate-blockdev_setbsz-and-make-it-do-no.patch

022f11
From 756e6cd77aa2fe0089f3ae66696b467d86996883 Mon Sep 17 00:00:00 2001
022f11
From: "Richard W.M. Jones" <rjones@redhat.com>
022f11
Date: Tue, 8 Oct 2013 10:00:33 +0100
022f11
Subject: [PATCH] blockdev: Deprecate blockdev_setbsz and make it do nothing
022f11
 (RHBZ#624334).
022f11
022f11
This call never did anything.  Don't use it.  Also I have submitted a
022f11
patch upstream to remove the corresponding option from blockdev.
022f11
022f11
See RHBZ#1002825 for an explanation of why this call was always
022f11
useless.
022f11
022f11
Thanks: Masayoshi Mizuma
022f11
(cherry picked from commit 4fc44a0157a1bcd4c618e0eb8afd7c553ed0f31d)
022f11
---
022f11
 daemon/blockdev.c    |  7 ++-----
022f11
 generator/actions.ml | 17 ++++++++++-------
022f11
 2 files changed, 12 insertions(+), 12 deletions(-)
022f11
022f11
diff --git a/daemon/blockdev.c b/daemon/blockdev.c
022f11
index 04cede9..8a7b1a8 100644
022f11
--- a/daemon/blockdev.c
022f11
+++ b/daemon/blockdev.c
022f11
@@ -121,11 +121,8 @@ do_blockdev_getbsz (const char *device)
022f11
 int
022f11
 do_blockdev_setbsz (const char *device, int blocksize)
022f11
 {
022f11
-  if (blocksize <= 0 /* || blocksize >= what? */) {
022f11
-    reply_with_error ("blocksize must be > 0");
022f11
-    return -1;
022f11
-  }
022f11
-  return (int) call_blockdev (device, "--setbsz", blocksize, 0);
022f11
+  /* Do nothing.  See https://bugzilla.redhat.com/show_bug.cgi?id=1002825 */
022f11
+  return 0;
022f11
 }
022f11
 
022f11
 int64_t
022f11
diff --git a/generator/actions.ml b/generator/actions.ml
022f11
index 8bc37de..24f4468 100644
022f11
--- a/generator/actions.ml
022f11
+++ b/generator/actions.ml
022f11
@@ -4265,8 +4265,11 @@ This uses the L<blockdev(8)> command." };
022f11
     longdesc = "\
022f11
 This returns the block size of a device.
022f11
 
022f11
-(Note this is different from both I<size in blocks> and
022f11
-I<filesystem block size>).
022f11
+Note: this is different from both I<size in blocks> and
022f11
+I<filesystem block size>.  Also this setting is not really
022f11
+used by anything.  You should probably not use it for
022f11
+anything.  Filesystems have their own idea about what
022f11
+block size to choose.
022f11
 
022f11
 This uses the L<blockdev(8)> command." };
022f11
 
022f11
@@ -4274,14 +4277,14 @@ This uses the L<blockdev(8)> command." };
022f11
     name = "blockdev_setbsz";
022f11
     style = RErr, [Device "device"; Int "blocksize"], [];
022f11
     proc_nr = Some 61;
022f11
+    deprecated_by = Some "mkfs";
022f11
     shortdesc = "set blocksize of block device";
022f11
     longdesc = "\
022f11
-This sets the block size of a device.
022f11
-
022f11
-(Note this is different from both I<size in blocks> and
022f11
-I<filesystem block size>).
022f11
+This call does nothing and has never done anything
022f11
+because of a bug in blockdev.  B<Do not use it.>
022f11
 
022f11
-This uses the L<blockdev(8)> command." };
022f11
+If you need to set the filesystem block size, use the
022f11
+C<blocksize> option of C<guestfs_mkfs>." };
022f11
 
022f11
   { defaults with
022f11
     name = "blockdev_getsz";
022f11
-- 
022f11
1.8.3.1
022f11