Skip to content
GitLab
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
e446488a
Commit
e446488a
authored
Jul 10, 2014
by
Leigh B Stoller
Browse files
Another checkpoint.
parent
48e85114
Changes
5
Hide whitespace changes
Inline
Side-by-side
db/Image.pm.in
View file @
e446488a
...
...
@@ -619,7 +619,7 @@ sub NewVersion($$$$)
or goto bad;
DBQueryWarn("update $imtablename set ".
" uuid=uuid(),ready=0,path='
$
path
', ".
" uuid=uuid(),ready=0,path='
$
path
',
released=0
".
" $part_vers, default_vers='
$
clone_vers
', ".
" version='
$
clone_vers
',".
" created=now(), ".
...
...
sql/database-create.sql
View file @
e446488a
...
...
@@ -1954,6 +1954,7 @@ CREATE TABLE `image_versions` (
`noexport`
tinyint
(
1
)
NOT
NULL
default
'0'
,
`ready`
tinyint
(
1
)
NOT
NULL
default
'0'
,
`isdelta`
tinyint
(
1
)
NOT
NULL
default
'0'
,
`released`
tinyint
(
1
)
NOT
NULL
default
'0'
,
PRIMARY
KEY
(
`imageid`
,
`version`
),
KEY
`pid`
(
`pid`
,
`imagename`
,
`version`
),
KEY
`gid`
(
`gid`
),
...
...
sql/updates/4/
400
→
sql/updates/4/
397
View file @
e446488a
...
...
@@ -64,6 +64,12 @@ sub DoUpdate($$$)
" `isdelta` tinyint(1) NOT NULL default '0' ".
" AFTER ready");
}
if (!DBSlotExists("image_versions", "released")) {
DBQueryFatal("ALTER TABLE image_versions ADD ".
" `released` tinyint(1) NOT NULL default '0' ".
" AFTER isdelta");
DBQueryFatal("update image_versions set released=1");
}
if (!DBTableExists("os_info_versions")) {
DBQueryFatal("rename table os_info to os_info_versions");
}
...
...
utils/clone_image.in
View file @
e446488a
...
...
@@ -224,7 +224,7 @@ if (defined($image)) {
my
$needclone
=
1
;
#
# Does the most version in the table
has
its ready bit
not
set? If so
# Does the most version in the table
not have
its ready bit set? If so
# it means something went wrong with a previous image creation. We can
# reuse it, but reset the provenance just in case the node got reloaded.
#
...
...
@@ -279,7 +279,7 @@ if (defined($image)) {
#
if
(
$image
->
path
()
=~
/^\/usr\/testbed/
)
{
my
$path
=
$PROJROOT
.
"
/
"
.
$image
->
pid
()
.
"
/images/
"
.
basename
(
$image
->
path
())
.
"
:
"
.
$image
->
version
()
;
basename
(
$image
->
path
());
if
(
$image
->
Update
({"
path
"
=>
$path
}))
{
$image
->
DeleteVersion
();
...
...
www/imageid_defs.php
View file @
e446488a
...
...
@@ -122,8 +122,10 @@ class Image
" deleted is null "
.
"order by version desc limit 1"
);
# If no unreleased version, just return $this. Might mean that
# provenance is not turned on for the project cause of a feature.
if
(
mysql_num_rows
(
$query_result
)
==
0
)
{
return
null
;
return
$this
;
}
$row
=
mysql_fetch_array
(
$query_result
);
return
Image
::
Lookup
(
$imageid
,
$row
[
"version"
]);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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