From f1ed6a32939717d89e7bc3f9c0934b7788f2708a Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
Date: Wed, 21 Jun 2017 16:34:05 +0200
Subject: [PATCH] resize: make sure the input disk is read-only
Fixes commit 8a2b0738d1b79f288b14fc35294567430d10b7ec.
(cherry picked from commit 1ca2a8b7ba41d7e4baf1aec5d65ace3b66f2dc37)
---
resize/resize.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/resize/resize.ml b/resize/resize.ml
index dc96b23..4028aa1 100644
--- a/resize/resize.ml
+++ b/resize/resize.ml
@@ -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);
--
2.9.4