Bug 530136 - guestfwd option doesn't allow supplementary chardev options like server,nowait
guestfwd option doesn't allow supplementary chardev options like server,nowait
Product: Fedora
Classification: Fedora
Component: qemu (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Glauber Costa
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2009-10-21 12:46 EDT by Richard W.M. Jones
Modified: 2009-10-23 07:56 EDT (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-10-23 07:56:46 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
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

Note You need to log in before you can comment on or make changes to this bug.