projects
/
pintos-anon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ae20a83
)
Fix use of arbitrary files for disks with "get" and "put" commands.
author
Ben Pfaff
<blp@cs.stanford.edu>
Mon, 1 Nov 2004 06:25:09 +0000
(06:25 +0000)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Mon, 1 Nov 2004 06:25:09 +0000
(06:25 +0000)
src/utils/pintos
patch
|
blob
|
history
diff --git
a/src/utils/pintos
b/src/utils/pintos
index 798708ed912dd73a728773e66b0ec6ed477c707b..a27384ddf3f01cf1a7d74fdb6187756e92ec1a07 100755
(executable)
--- a/
src/utils/pintos
+++ b/
src/utils/pintos
@@
-110,26
+110,26
@@
if ($cmd eq 'run') {
# Create scratch disk big enough for any file in the filesystem
# (modulo sparse files).
# Create scratch disk big enough for any file in the filesystem
# (modulo sparse files).
- die "
fs.dsk: $!\n" if ! -e "fs.dsk"
;
+ die "
$disks[1]: $!\n" if ! -e $disks[1]
;
my ($fs_size) = -s _;
my ($fs_size) = -s _;
- my ($scratch_size) = -s
"scratch.dsk"
;
+ my ($scratch_size) = -s
$disks[2]
;
$scratch_size = 0 if !defined $scratch_size;
$scratch_size = 0 if !defined $scratch_size;
- create_disk (
"scratch.dsk"
, $fs_size / 1024 + 16)
+ create_disk (
$disks[2]
, $fs_size / 1024 + 16)
if $scratch_size < $fs_size + 16384;
# Do copy.
run_vm ("-co", $guestfn, "-q");
# Read out scratch disk.
if $scratch_size < $fs_size + 16384;
# Do copy.
run_vm ("-co", $guestfn, "-q");
# Read out scratch disk.
- print "copying $guestfn from
scratch.dsk
to $hostfn...\n";
- open (SRC, "<
scratch.dsk") or die "scratch.dsk
: open: $!\n";
+ print "copying $guestfn from
$disks[2]
to $hostfn...\n";
+ open (SRC, "<
$disks[2]") or die "$disks[2]
: open: $!\n";
open (DST, ">$hostfn") or die "$hostfn: create: $!\n";
my ($input);
open (DST, ">$hostfn") or die "$hostfn: create: $!\n";
my ($input);
- read (SRC, $input, 512) == 512 or die "
scratch.dsk
: read error\n";
+ read (SRC, $input, 512) == 512 or die "
$disks[2]
: read error\n";
my ($size) = unpack ("%V", $input);
my ($size) = unpack ("%V", $input);
- $size != 0xffffffff or die "$guestfn: too big for
scratch.dsk
?";
+ $size != 0xffffffff or die "$guestfn: too big for
$disks[2]
?";
my ($src);
my ($src);
- read (SRC, $src, $size) == $size or die "
scratch.dsk
: read error\n";
+ read (SRC, $src, $size) == $size or die "
$disks[2]
: read error\n";
print DST $src or die "$hostfn: write error\n";
close (DST);
close (SRC);
print DST $src or die "$hostfn: write error\n";
close (DST);
close (SRC);