Skip to content
Snippets Groups Projects
Commit 745e0215 authored by Florent Gluck's avatar Florent Gluck
Browse files

vms.setDiskBusy/clearDiskBusy were public, doh!

parent 54abb099
No related branches found
No related tags found
No related merge requests found
...@@ -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.SetDiskBusy(vm); err != nil { if err := vms.setDiskBusy(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.ClearDiskBusy(vm) defer vms.clearDiskBusy(vm)
// Creates the template. // Creates the template.
template, err := newTemplate(name, owner, access) template, err := newTemplate(name, owner, access)
......
...@@ -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)SetDiskBusy(vm *VM) error { func (vms *VMs)setDiskBusy(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)ClearDiskBusy(vm *VM) error { func (vms *VMs)clearDiskBusy(vm *VM) error {
vm.mutex.Lock() vm.mutex.Lock()
defer vm.mutex.Unlock() defer vm.mutex.Unlock()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment