X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=perl%2Flib%2FSys%2FGuestfs%2FLib.pm;h=00a9bdb87a8891787ed47bc1db9b124812d4252e;hp=5d48ba81190a43e5a3226bae8b3b2609f7438d87;hb=22eb7fc966bafebedfde437c9b9c9fb903a8bc35;hpb=3385d7a1bf6afb8508ce334c6231c35cbe2fbae0 diff --git a/perl/lib/Sys/Guestfs/Lib.pm b/perl/lib/Sys/Guestfs/Lib.pm index 5d48ba8..00a9bdb 100644 --- a/perl/lib/Sys/Guestfs/Lib.pm +++ b/perl/lib/Sys/Guestfs/Lib.pm @@ -1067,14 +1067,22 @@ sub mount_operating_system local $_; my $g = shift; my $os = shift; + my $ro = shift; # Read-only? + + $ro = 1 unless(defined($ro)); # ro defaults to 1 if unspecified my $mounts = $os->{mounts}; # Have to mount / first. Luckily '/' is early in the ASCII # character set, so this should be OK. foreach (sort keys %$mounts) { - $g->mount_ro ($mounts->{$_}, $_) - if $_ ne "swap" && $_ ne "none" && ($_ eq '/' || $g->is_dir ($_)); + if($_ ne "swap" && $_ ne "none" && ($_ eq '/' || $g->is_dir ($_))) { + if($ro) { + $g->mount_ro ($mounts->{$_}, $_) + } else { + $g->mount ($mounts->{$_}, $_) + } + } } }