Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
145fb4c5
Commit
145fb4c5
authored
Dec 07, 2009
by
Mike Hibler
Browse files
Add an argument to downloadImage to say it is loading a disk rather than
writing into a file.
parent
d60b9acd
Changes
2
Hide whitespace changes
Inline
Side-by-side
tmcd/linux/libvnode.pm
View file @
145fb4c5
...
...
@@ -372,23 +372,28 @@ sub findBridgeIfaces($) {
# mechanism. Caller provides an imagepath for frisbee, and a hash of args that
# comes directly from loadinfo.
#
sub
downloadImage
($$)
{
my
(
$imagepath
,
$reload_args_ref
)
=
@_
;
sub
downloadImage
($$
$
)
{
my
(
$imagepath
,
$
todisk
,
$
reload_args_ref
)
=
@_
;
return
-
1
if
(
!
defined
(
$imagepath
)
||
!
defined
(
$reload_args_ref
));
my
$addr
=
$reload_args_ref
->
{"
ADDR
"};
my
$FRISBEE
=
"
/usr/local/etc/emulab/frisbee
";
my
$IMAGEUNZIP
=
"
/usr/local/bin/imageunzip
";
if
(
$addr
=~
/^(\d+\.\d+\.\d+\.\d+):(\d+)$/
)
{
my
$mcastaddr
=
$
1
;
my
$mcastport
=
$
2
;
mysystem
("
$FRISBEE
-m
$mcastaddr
-p
$mcastport
$imagepath
");
mysystem
("
$FRISBEE
-m
$mcastaddr
-p
$mcastport
$imagepath
");
}
elsif
(
$addr
=~
/^http/
)
{
mysystem
("
wget -nv -N -P -O
$imagepath
'
$addr
'
");
if
(
$todisk
)
{
mysystem
("
wget -nv -N -P -O - '
$addr
' |
$IMAGEUNZIP
-
$imagepath
");
}
else
{
mysystem
("
wget -nv -N -P -O
$imagepath
'
$addr
'
");
}
}
return
0
;
...
...
tmcd/linux/openvz/libvnode_openvz.pm
View file @
145fb4c5
...
...
@@ -549,7 +549,7 @@ sub vz_vnodeCreate {
if
(
!
$incache
)
{
# Now we just download the file, then let create do its normal thing
my
$dret
=
libvnode::
downloadImage
(
$imagepath
,
$reload_args_ref
);
my
$dret
=
libvnode::
downloadImage
(
$imagepath
,
0
,
$reload_args_ref
);
# reload has finished, file is written... so let's set its mtime
utime
(
time
(),
$reload_args
{"
IMAGEMTIME
"},
$imagepath
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment