mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
btrfs_subvolume_show: fix root/toplevel check w/ btrfs-progs >= 4.4
In trfs-progs 4.4 the error message has been changed, and our check did not work anymore. Yes, parsing user messages really sucks...
This commit is contained in:
@@ -1029,9 +1029,12 @@ do_btrfs_subvolume_show (const char *subvolume)
|
||||
}
|
||||
|
||||
/* If the path is the btrfs root, `btrfs subvolume show' reports:
|
||||
* <path> is btrfs root
|
||||
* <path> is btrfs root [in btrfs-progs < 4.4]
|
||||
* <path> is toplevel subvolume
|
||||
*/
|
||||
if (out && strstr (out, "is btrfs root") != NULL) {
|
||||
if (out &&
|
||||
(strstr (out, "is btrfs root") != NULL ||
|
||||
strstr (out, "is toplevel subvolume") != NULL)) {
|
||||
reply_with_error ("%s is btrfs root", subvolume);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user