@@ -223,11 +223,10 @@ func (d *Driver) Create() error {
223
223
224
224
func (d * Driver ) extractKernel () error {
225
225
log .Info ("Extracting bzimage and initrd..." )
226
- isoPath := d .ResolveStorePath (isoFilename )
227
- if err := pkgdrivers .ExtractFile (isoPath , "/boot/bzimage" , d .kernelPath ()); err != nil {
226
+ if err := pkgdrivers .ExtractFile (d .isoPath (), "/boot/bzimage" , d .kernelPath ()); err != nil {
228
227
return err
229
228
}
230
- return pkgdrivers .ExtractFile (isoPath , "/boot/initrd" , d .initrdPath ())
229
+ return pkgdrivers .ExtractFile (d . isoPath () , "/boot/initrd" , d .initrdPath ())
231
230
}
232
231
233
232
func (d * Driver ) Start () error {
@@ -258,8 +257,6 @@ func (d *Driver) Start() error {
258
257
// startVfkit starts the vfkit child process. If socketPath is not empty, vfkit
259
258
// is connected to the vmnet network via the socket instead of "nat" network.
260
259
func (d * Driver ) startVfkit (socketPath string ) error {
261
- machineDir := filepath .Join (d .StorePath , "machines" , d .GetMachineName ())
262
-
263
260
var startCmd []string
264
261
265
262
startCmd = append (startCmd ,
@@ -296,9 +293,8 @@ func (d *Driver) startVfkit(socketPath string) error {
296
293
startCmd = append (startCmd ,
297
294
"--device" , "virtio-rng" )
298
295
299
- var isoPath = filepath .Join (machineDir , isoFilename )
300
296
startCmd = append (startCmd ,
301
- "--device" , fmt .Sprintf ("virtio-blk,path=%s" , isoPath ))
297
+ "--device" , fmt .Sprintf ("virtio-blk,path=%s" , d . isoPath () ))
302
298
303
299
startCmd = append (startCmd ,
304
300
"--device" , fmt .Sprintf ("virtio-blk,path=%s" , d .diskPath ()))
@@ -516,6 +512,10 @@ func (d *Driver) publicSSHKeyPath() string {
516
512
return d .sshKeyPath () + ".pub"
517
513
}
518
514
515
+ func (d * Driver ) isoPath () string {
516
+ return d .ResolveStorePath (isoFilename )
517
+ }
518
+
519
519
func (d * Driver ) kernelPath () string {
520
520
return d .ResolveStorePath ("bzimage" )
521
521
}
0 commit comments