Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-stable
Commits
6546b21c
Commit
6546b21c
authored
Mar 07, 2017
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ack, got predicate wrong, broke snapshots.
parent
5b5a8834
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
7 deletions
+18
-7
db/Image.pm.in
db/Image.pm.in
+18
-7
No files found.
db/Image.pm.in
View file @
6546b21c
...
...
@@ -587,7 +587,8 @@ sub Refresh($)
my
$
version
=
$
self
->
version
();
my
$
query_result
=
DBQueryWarn
(
"select v.*,i.uuid as image_uuid,i.locked,i.locker_pid "
.
DBQueryWarn
(
"select i.*,v.*,i.uuid as image_uuid, "
.
" i.metadata_url as image_metadata_url "
.
" from image_versions as v "
.
"left join images as i on "
.
" v.imageid=i.imageid "
.
...
...
@@ -826,7 +827,18 @@ sub NewVersion($$$$)
my $ostablename = "os_info_versions" . $tableid;
my $imtablename = "image_versions" . $tableid;
if ($self->IsNewest()) {
#
# This should not happen but lets make sure.
#
if (defined($self->deleted())) {
print STDERR "Not allowed to clone deleted image $self\n";
return undef;
}
#
# We should always be called with the latest version. $baseimage is
# what we are actually basing the new image on.
#
if (!$self->IsNewest()) {
print STDERR "Image::NewVersion: $self is not the head version\n";
return undef;
}
...
...
@@ -2594,8 +2606,7 @@ sub SchedIMSDeletion($)
sub
IsNewest
($)
{
my
($
self
)
=
@
_
;
my
$
imageid
=
$
self
->
pid
();
my
$
imageid
=
$
self
->
imageid
();
my
$
query_result
=
DBQueryWarn
(
"select max(version) from image_versions "
.
...
...
Write
Preview
Markdown
is supported
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