Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
platform/qemu: unexport Disk methods
Browse files Browse the repository at this point in the history
  • Loading branch information
bgilbert committed Nov 5, 2018
1 parent 980170e commit ccaf811
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions platform/machine/qemu/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func (qc *Cluster) NewMachineWithOptions(userdata *conf.UserData, options Machin
fdset := 1

for _, disk := range allDisks {
optionsDiskFile, err := disk.SetupFile()
optionsDiskFile, err := disk.setupFile()
if err != nil {
return nil, err
}
Expand All @@ -175,7 +175,7 @@ func (qc *Cluster) NewMachineWithOptions(userdata *conf.UserData, options Machin
id := fmt.Sprintf("d%d", fdnum)
qmCmd = append(qmCmd, "-add-fd", fmt.Sprintf("fd=%d,set=%d", fdnum, fdset),
"-drive", fmt.Sprintf("if=none,id=%s,format=qcow2,file=/dev/fdset/%d", id, fdset),
"-device", qc.virtio("blk", fmt.Sprintf("drive=%s%s", id, disk.GetOpts())))
"-device", qc.virtio("blk", fmt.Sprintf("drive=%s%s", id, disk.getOpts())))
fdnum += 1
fdset += 1
}
Expand Down
4 changes: 2 additions & 2 deletions platform/machine/qemu/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ func MakeDiskTemplate(inputPath, outputPath string) (result error) {
return
}

func (d Disk) GetOpts() string {
func (d Disk) getOpts() string {
if len(d.DeviceOpts) == 0 {
return ""
}
return "," + strings.Join(d.DeviceOpts, ",")
}

func (d Disk) SetupFile() (*os.File, error) {
func (d Disk) setupFile() (*os.File, error) {
if d.Size == "" && d.BackingFile == "" {
return nil, ErrNeedSizeOrFile
}
Expand Down

0 comments on commit ccaf811

Please sign in to comment.