Bug 530136

Summary: guestfwd option doesn't allow supplementary chardev options like server,nowait
Product: [Fedora] Fedora Reporter: Richard W.M. Jones <rjones>
Component: qemuAssignee: Glauber Costa <gcosta>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: berrange, dwmw2, gcosta, itamar, jaswinder, jforbes, kraxel, markmc, mbooth, quintela, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-10-23 07:56:46 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Richard W.M. Jones 2009-10-21 12:46:14 EDT
Description of problem:

The outline of the problem was described upstream here:


Essentially the new -net user,guestfwd... option doesn't
allow a full QEMU chardev to be set.

In QEMU from F12 you'll see this error:

$ /usr/bin/qemu-system-x86_64 -net user,guestfwd=tcp:,server,nowait
qemu: invalid parameter 'server,nowait' in 'guestfwd=tcp:,server,nowait'

In upstream QEMU (from git) the error is slightly different:

$ ./x86_64-softmmu/qemu-system-x86_64 -net user,guestfwd=tcp:,server,nowait
option "server" is not valid for net

Note also there is a way to do this which is in upstream QEMU
(but not in F12 QEMU).  The -chardev parameter lets you set up
and name a QEMU chardev separately from actually using it:

$ ./x86_64-softmmu/qemu-system-x86_64 -chardev socket,id=guestfsvmc,path=/tmp/t,server,nowait -net user,guestfwd=tcp:

With F12 QEMU, trying to use this option gives an error:
/usr/bin/qemu-system-x86_64: invalid option -- '-chardev'

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:

1. qemu-system-x86_64 -net user,guestfwd=tcp:,server,nowait
Actual results:

A variety of errors, see above.

Expected results:

No error, and qemu starts running.

Additional info:
Comment 1 Mark McLoughlin 2009-10-21 14:00:03 EDT
Thanks for filing the bz, I see what's going on now

-chardev socket,id=guestfsvmc,path=/tmp/t,server,nowait gets parsed as

    option = "chardev",
    params = { 
      "backend" = "socket", 
      "id" = "id=guestfsvmc", 
      "path" = "/tmp/t", 
      "server" = "on", 
      "nowait" = "on"

-net user,guestfwd=tcp:,server,nowait gets parsed as:

    option = "net",
    params = { 
      "type" = "user", 
      "guestfwd" = "tcp:", 
      "server" = "on", 
      "nowait" = "on"

and it barfs because "server" is not valid for -net

There's no easy way to fix this because you're making the tokenizing of the option dependent on the value of one of the parameters

I guess this went unnoticed because guestfwd to a chardev is a fairly obscure feature and passing 'server' and 'nowait' parameters to the guestfwd chardev is even more obscure.

Since the new way upstream is to use -chardev and you don't need this for libguestfs anymore, I think we should just closed this as resolved upstream?
Comment 2 Matthew Booth 2009-10-22 04:46:06 EDT
-chardev isn't documented (not in the man page at least), so isn't really usable yet.
Comment 3 Mark McLoughlin 2009-10-23 07:56:46 EDT
Gerd: mbooth points out -chardev isn't documented upstream

That doesn't prevent it being used, though, setting to CLOSED UPSTREAM