[Pkg-libvirt-commits] [libguestfs] 19/36: resize: make available expand method warnings more prominent

Hilko Bengen bengen at moszumanska.debian.org
Sun Nov 1 17:13:43 UTC 2015


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag upstream/1.29.47
in repository libguestfs.

commit 99dc53bba773d083b52d3f4005b16b8edaf615cb
Author: Pino Toscano <ptoscano at redhat.com>
Date:   Mon Jun 15 15:53:14 2015 +0200

    resize: make available expand method warnings more prominent
    
    When hitting a filesystem which we cannot or don't know how to expand,
    instead of print a warning in verbose mode only, print it always when
    showing the summary of the changes.
    
    In the virt-resize documentation, add a paragraph about this warning.
    
    Thanks to: Luigi Toscano.
---
 resize/resize.ml       | 32 ++++++++++++++++++++++++--------
 resize/virt-resize.pod | 39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+), 8 deletions(-)

diff --git a/resize/resize.ml b/resize/resize.ml
index 602a583..101b303 100644
--- a/resize/resize.ml
+++ b/resize/resize.ml
@@ -575,11 +575,7 @@ read the man page virt-resize(1).
       | ContentFS (("ntfs"), _) when !ntfs_available -> true
       | ContentFS (("btrfs"), _) when !btrfs_available -> true
       | ContentFS (("xfs"), _) when !xfs_available -> true
-      | ContentFS (fs, _) ->
-        if verbose () then
-          warning (f_"unknown/unavailable method for expanding filesystem %s")
-            fs;
-        false
+      | ContentFS _ -> false
       | ContentExtendedPartition -> false
     else
       fun _ -> false
@@ -593,7 +589,7 @@ read the man page virt-resize(1).
       | ContentFS (("ntfs"), _) when !ntfs_available -> NTFSResize
       | ContentFS (("btrfs"), _) when !btrfs_available -> BtrfsFilesystemResize
       | ContentFS (("xfs"), _) when !xfs_available -> XFSGrowFS
-      | ContentFS (_, _) -> assert false
+      | ContentFS _ -> assert false
       | ContentExtendedPartition -> assert false
     else
       fun _ -> assert false
@@ -863,7 +859,17 @@ read the man page virt-resize(1).
                 p.p_name
                 (string_of_expand_content_method
                    (expand_content_method p.p_type))
-            ) else "" in
+            ) else (
+              (match p.p_type with
+              | ContentUnknown
+              | ContentPV _
+              | ContentExtendedPartition -> ()
+              | ContentFS (fs, _) ->
+                warning (f_"unknown/unavailable method for expanding the %s filesystem on %s")
+                  fs p.p_name;
+              );
+              ""
+            ) in
 
       wrap (text ^ "\n\n") in
 
@@ -883,7 +889,17 @@ read the man page virt-resize(1).
                   name
                   (string_of_expand_content_method
                      (expand_content_method lv.lv_type))
-              ) else "" in
+              ) else (
+                (match lv.lv_type with
+                | ContentUnknown
+                | ContentPV _
+                | ContentExtendedPartition -> ()
+                | ContentFS (fs, _) ->
+                  warning (f_"unknown/unavailable method for expanding the %s filesystem on %s")
+                    fs name;
+                );
+                ""
+              ) in
 
             wrap (text ^ "\n\n")
     ) lvs;
diff --git a/resize/virt-resize.pod b/resize/virt-resize.pod
index a7620e0..db282b4 100644
--- a/resize/virt-resize.pod
+++ b/resize/virt-resize.pod
@@ -727,6 +727,45 @@ the disk before.
 If you have to reuse a target which contains data already, you should
 use the I<--no-sparse> option.  Note this can be much slower.
 
+=head2 "unknown/unavailable method for expanding the TYPE filesystem on DEVICE/LV"
+
+Virt-resize was asked to expand a partition or a logical volume
+containing a filesystem with the type C<TYPE>, but there is no
+available nor known expanding method for that filesystem.
+
+This may be due to either of the following:
+
+=over 4
+
+=item 1.
+
+There corresponding filesystem is not available in libguestfs,
+because there is no proper package in the host with utilities for it.
+This is usually the case for C<btrfs>, C<ntfs>, and C<xfs>
+filesystems.
+
+Check the results of:
+
+ virt-resize --machine-readable
+ guestfish -a /dev/null run : available
+ guestfish -a /dev/null run : filesystem_available TYPE
+
+In this case, it is enough to install the proper packages
+adding support for them.  For example, C<libguestfs-xfs> on
+Red Hat Enterprise Linux, CentOS, Debian, Ubuntu, and distributions
+derived from them, for supporting the C<xfs> filesystem.
+
+=item 2.
+
+Virt-resize has no support for expanding that type of filesystem.
+
+In this case, there's nothing that can be done to let virt-resize
+expand that type of filesystem.
+
+=back
+
+In both cases, virt-resize will not expand the mentioned filesystem.
+
 =head1 ALTERNATIVE TOOLS
 
 There are several proprietary tools for resizing partitions.  We

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list