Commit 25d5f66b authored by Julien Muchembled's avatar Julien Muchembled

vm.run: new 'drives' option

parent 6b0ff18d
...@@ -730,6 +730,9 @@ vm ...@@ -730,6 +730,9 @@ vm
dist dist
VM image to use inside the `vm` folder. VM image to use inside the `vm` folder.
drives
Extra drives. Each line is passed with -drive
commands commands
List of <command> options, each one being a shell script to execute via List of <command> options, each one being a shell script to execute via
SSH. They are processed in sequence. This is usually only required if you SSH. They are processed in sequence. This is usually only required if you
......
...@@ -122,12 +122,15 @@ class BaseRecipe(EnvironMixin): ...@@ -122,12 +122,15 @@ class BaseRecipe(EnvironMixin):
except KeyError: except KeyError:
if mem is None: if mem is None:
raise raise
return ['qemu-system-' + ARCH, '-enable-kvm', '-drive', drive, args = ['qemu-system-' + ARCH, '-enable-kvm', '-drive', drive,
'-smp', self.options.get('smp', '1'), '-m', str(mem), '-smp', self.options.get('smp', '1'), '-m', str(mem),
'-net', 'nic,model=virtio', '-net', net, '-net', 'nic,model=virtio', '-net', net,
# https://daniel-lange.com/archives/152-hello-buster.html # https://daniel-lange.com/archives/152-hello-buster.html
'-object', 'rng-random,filename=/dev/urandom,id=rng0', '-object', 'rng-random,filename=/dev/urandom,id=rng0',
'-device', 'virtio-rng-pci,rng=rng0'] '-device', 'virtio-rng-pci,rng=rng0']
for drive in self.options.get('drives', '').splitlines():
args += '-drive', drive
return args
@property @property
def ssh_key(self): def ssh_key(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment