mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
sysprep: fix btrfs subvolume processing in fs-uuids
guestfs_set_uuid wants device as argument. Moreover, btrfstune -U is unable to set uuid for subvolumes, only unmounted partitions are supported. Here we skip btrfs subvolumes.
This commit is contained in:
committed by
Richard W.M. Jones
parent
f90185dfdf
commit
4e0dbf94e7
@@ -30,13 +30,15 @@ let rec fs_uuids_perform g root side_effects =
|
||||
List.iter (function
|
||||
| _, "unknown" -> ()
|
||||
| dev, typ ->
|
||||
let new_uuid = Common_utils.uuidgen () in
|
||||
try
|
||||
g#set_uuid dev new_uuid
|
||||
with
|
||||
G.Error msg ->
|
||||
warning (f_"cannot set random UUID on filesystem %s type %s: %s")
|
||||
dev typ msg
|
||||
if not (is_btrfs_subvolume g dev) then (
|
||||
let new_uuid = Common_utils.uuidgen () in
|
||||
try
|
||||
g#set_uuid dev new_uuid
|
||||
with
|
||||
G.Error msg ->
|
||||
warning (f_"cannot set random UUID on filesystem %s type %s: %s")
|
||||
dev typ msg
|
||||
)
|
||||
) fses
|
||||
|
||||
let op = {
|
||||
|
||||
Reference in New Issue
Block a user