Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Secure solution for nexus infrastructure
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
flg_masters
TM
Secure solution for nexus infrastructure
Commits
745e0215
Commit
745e0215
authored
2 years ago
by
Florent Gluck
Browse files
Options
Downloads
Patches
Plain Diff
vms.setDiskBusy/clearDiskBusy were public, doh!
parent
54abb099
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/vms/template.go
+2
-2
2 additions, 2 deletions
src/vms/template.go
src/vms/vms.go
+2
-2
2 additions, 2 deletions
src/vms/vms.go
with
4 additions
and
4 deletions
src/vms/template.go
+
2
−
2
View file @
745e0215
...
@@ -32,11 +32,11 @@ var dummyTemplate = Template{}
...
@@ -32,11 +32,11 @@ var dummyTemplate = Template{}
// Creates a template from a VM's disk.
// Creates a template from a VM's disk.
func
NewTemplateFromVM
(
name
string
,
owner
string
,
access
string
,
vm
*
VM
)
(
*
Template
,
error
)
{
func
NewTemplateFromVM
(
name
string
,
owner
string
,
access
string
,
vm
*
VM
)
(
*
Template
,
error
)
{
// Marks the VM to copy from as being busy.
// Marks the VM to copy from as being busy.
if
err
:=
vms
.
S
etDiskBusy
(
vm
);
err
!=
nil
{
if
err
:=
vms
.
s
etDiskBusy
(
vm
);
err
!=
nil
{
return
nil
,
errors
.
New
(
"Failed setting disk busy flag during template creation: "
+
err
.
Error
())
return
nil
,
errors
.
New
(
"Failed setting disk busy flag during template creation: "
+
err
.
Error
())
}
}
// Clears the VM from being busy.
// Clears the VM from being busy.
defer
vms
.
C
learDiskBusy
(
vm
)
defer
vms
.
c
learDiskBusy
(
vm
)
// Creates the template.
// Creates the template.
template
,
err
:=
newTemplate
(
name
,
owner
,
access
)
template
,
err
:=
newTemplate
(
name
,
owner
,
access
)
...
...
This diff is collapsed.
Click to expand it.
src/vms/vms.go
+
2
−
2
View file @
745e0215
...
@@ -364,7 +364,7 @@ func (vms *VMs)DeleteVMAccess(vmID uuid.UUID, loggedUserEmail string, userEmail
...
@@ -364,7 +364,7 @@ func (vms *VMs)DeleteVMAccess(vmID uuid.UUID, loggedUserEmail string, userEmail
}
}
// Marks a VM as "busy", meaning its disk file is being accessed for a possibly long time.
// Marks a VM as "busy", meaning its disk file is being accessed for a possibly long time.
func
(
vms
*
VMs
)
S
etDiskBusy
(
vm
*
VM
)
error
{
func
(
vms
*
VMs
)
s
etDiskBusy
(
vm
*
VM
)
error
{
vm
.
mutex
.
Lock
()
vm
.
mutex
.
Lock
()
defer
vm
.
mutex
.
Unlock
()
defer
vm
.
mutex
.
Unlock
()
...
@@ -382,7 +382,7 @@ func (vms *VMs)SetDiskBusy(vm *VM) error {
...
@@ -382,7 +382,7 @@ func (vms *VMs)SetDiskBusy(vm *VM) error {
return
nil
return
nil
}
}
func
(
vms
*
VMs
)
C
learDiskBusy
(
vm
*
VM
)
error
{
func
(
vms
*
VMs
)
c
learDiskBusy
(
vm
*
VM
)
error
{
vm
.
mutex
.
Lock
()
vm
.
mutex
.
Lock
()
defer
vm
.
mutex
.
Unlock
()
defer
vm
.
mutex
.
Unlock
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment