resize: make sure the input disk is read-only

Fixes commit 8a2b0738d1.
This commit is contained in:
Pino Toscano
2017-06-21 16:34:05 +02:00
parent 713243b3cb
commit 1ca2a8b7ba

View File

@@ -348,7 +348,7 @@ read the man page virt-resize(1).
(* Add in and out disks to the handle and launch. *)
let connect_both_disks () =
let g = open_guestfs () in
add_drive_uri g ?format (snd infile);
add_drive_uri g ?format ~readonly:true (snd infile);
(* The output disk is being created, so use cache=unsafe here. *)
add_drive_uri g ?format:output_format ~readonly:false ~cachemode:"unsafe"
(snd outfile);