Implement disable default mounts via command line

Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
This commit is contained in:
Arthur Sengileyev
2024-07-08 18:52:50 +03:00
parent 7cc9b41e3d
commit d26f0ca90f
3 changed files with 37 additions and 3 deletions

View File

@@ -168,9 +168,13 @@ func (q *QEMUStubber) StartVM(mc *vmconfigs.MachineConfig) (func() error, func()
if err != nil {
return nil, nil, err
}
spawner, err := newVirtiofsdSpawner(runtime)
if err != nil {
return nil, nil, err
var spawner *virtiofsdSpawner
if len(mc.Mounts) > 0 {
spawner, err = newVirtiofsdSpawner(runtime)
if err != nil {
return nil, nil, err
}
}
for _, hostmnt := range mc.Mounts {