diff mbox

[09/10] vm: Honor 'QEMU_FLAGS' and 'QEMU_NET_FLAGS'.

Message ID 20160718165552.1480-9-david@craven.ch
State New
Headers show

Commit Message

David Craven July 18, 2016, 4:55 p.m. UTC
* gnu/system/vm.scm (common-qemu-options): Add 'QEMU_FLAGS' and
'QEMU_NET_FLAGS'.
---
 gnu/system/vm.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Ludovic Courtès July 19, 2016, 8:35 p.m. UTC | #1
David Craven <david@craven.ch> skribis:

> * gnu/system/vm.scm (common-qemu-options): Add 'QEMU_FLAGS' and
> 'QEMU_NET_FLAGS'.
> ---
>  gnu/system/vm.scm | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
> index c31e3a8..9f52909 100644
> --- a/gnu/system/vm.scm
> +++ b/gnu/system/vm.scm
> @@ -462,11 +462,11 @@ with '-virtfs' options for the host file systems listed in SHARED-FS."
>             "")
>       " -no-reboot -net nic,model=virtio \
>    " #$@(map virtfs-option shared-fs) " \
> -  -net user \
> +  -net user,$QEMU_NET_FLAGS \
>    -vga std \
>    -drive file=" #$image
>    ",if=virtio,cache=writeback,werror=report,readonly \
> -  -m 256"))
> +  -m 256 $QEMU_FLAGS"))

When is this needed?  ‘guix system vm’ returns a script that appends its
arguments, so you can do:

  $(guix system vm foo.scm) -m 1024 -net foo,bar

Ludo’.
David Craven July 19, 2016, 8:38 p.m. UTC | #2
It's to avoid having to keep retyping them, it's nice to be able to
source qemu-flags.sh

Maybe there is a better way.
David Craven July 19, 2016, 8:41 p.m. UTC | #3
And I don't think appending -net foo,bar overrides the earlier one.
Maybe something else was the problem, I'll have to retry that.
David Craven July 21, 2016, 1 p.m. UTC | #4
Yep this patch is not needed, your solution is much better thanks...
David Craven July 27, 2016, 1:20 p.m. UTC | #5
Hmm, I sometimes get an 'ssh_exchange_identification: read: Connection
reset by peer' when I just append a new -net user, flag. It never
happens when I remove -net user from gnu system vm. Just thought I'd
mention it.
diff mbox

Patch

diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index c31e3a8..9f52909 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -462,11 +462,11 @@  with '-virtfs' options for the host file systems listed in SHARED-FS."
            "")
      " -no-reboot -net nic,model=virtio \
   " #$@(map virtfs-option shared-fs) " \
-  -net user \
+  -net user,$QEMU_NET_FLAGS \
   -vga std \
   -drive file=" #$image
   ",if=virtio,cache=writeback,werror=report,readonly \
-  -m 256"))
+  -m 256 $QEMU_FLAGS"))
 
 (define* (system-qemu-image/shared-store-script os
                                                 #:key