qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 6a8b4a: net: Change help text to list -netdev


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 6a8b4a: net: Change help text to list -netdev instead of -...
Date: Thu, 28 May 2015 04:30:08 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 6a8b4a5be21ad4941c8a6a5db1d355a522aea2fb
      
https://github.com/qemu/qemu/commit/6a8b4a5be21ad4941c8a6a5db1d355a522aea2fb
  Author: Thomas Huth <address@hidden>
  Date:   2015-05-27 (Wed, 27 May 2015)

  Changed paths:
    M qemu-options.hx

  Log Message:
  -----------
  net: Change help text to list -netdev instead of -net by default

Looking at the output of "qemu-system-xxx -help", you easily get
the impression that "-net" is the preferred way instead of "-netdev"
to specify host network interface, since the "-net" option is
omnipresent but the "-netdev" option is only listed as a one-liner
at the end. This is ugly since "-net" is considered as legacy and
even might be removed one day. Thus, this patch switches the output
to explain the host network interfaces with the "-netdev" option
instead, moving the old "-net" option into some few lines at
the end.

Signed-off-by: Thomas Huth <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: ca7eb1848bb06d9b75784d7760b83c7b0beb1102
      
https://github.com/qemu/qemu/commit/ca7eb1848bb06d9b75784d7760b83c7b0beb1102
  Author: Markus Armbruster <address@hidden>
  Date:   2015-05-27 (Wed, 27 May 2015)

  Changed paths:
    M net/hub.c
    M net/net.c

  Log Message:
  -----------
  net: Improve error message for -net hubport a bit

Type "hubport" is valid only with -netdev.  Unfortunately, that's
detected late and the error message doesn't explain why:

    $ qemu-system-i386 -net hubport,id=foo,hubid=0
    qemu-system-i386: -net hubport,id=foo,hubid=0: Device 'hubport' could not 
be initialized

Improve the error message to "Parameter 'type' expects a net type".

Not fixed: -net hubport without the parameters required by -netdev
hubport still asks for those parameters:

    $ qemu-system-i386 -net hubport
    qemu-system-i386: -net hubport: Parameter 'hubid' is missing

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: a30ecde6e795682d1473c45acae66a60a76fca2f
      
https://github.com/qemu/qemu/commit/a30ecde6e795682d1473c45acae66a60a76fca2f
  Author: Markus Armbruster <address@hidden>
  Date:   2015-05-27 (Wed, 27 May 2015)

  Changed paths:
    M net/clients.h
    M net/dump.c
    M net/hub.c
    M net/l2tpv3.c
    M net/net.c
    M net/netmap.c
    M net/slirp.c
    M net/socket.c
    M net/tap-win32.c
    M net/tap.c
    M net/vde.c
    M net/vhost-user.c

  Log Message:
  -----------
  net: Permit incremental conversion of init functions to Error

Error reporting for netdev_add is broken: the net_client_init_fun[]
report the actual errors with (at best) error_report(), and their
caller net_client_init1() makes up a generic error on top.

For command line and HMP, this produces an mildly ugly error cascade.

In QMP, the actual errors go to stderr, and the generic error becomes
the command's error reply.

To fix this, we need to convert the net_client_init_fun[] to Error.

To permit fixing them one by one, add an Error ** parameter to the
net_client_init_fun[].  If the call fails without returning an Error,
make up the same generic Error as before.  But if it returns one, use
that instead.  Since none of them does so far, no functional change.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 6630886863d4a9b3b7bcb3b0e2895d83eb269c75
      
https://github.com/qemu/qemu/commit/6630886863d4a9b3b7bcb3b0e2895d83eb269c75
  Author: Markus Armbruster <address@hidden>
  Date:   2015-05-27 (Wed, 27 May 2015)

  Changed paths:
    M net/net.c

  Log Message:
  -----------
  net: Improve -net nic error reporting

When -net nic fails, it first reports a specific error, then a generic
one, like this:

    $ qemu-system-x86_64 -net nic,netdev=nonexistent
    qemu-system-x86_64: -net nic,netdev=nonexistent: netdev 'nonexistent' not 
found
    qemu-system-x86_64: -net nic,netdev=nonexistent: Device 'nic' could not be 
initialized

Convert net_init_nic() to Error to get rid of the unwanted second
error message.

While there, tidy up an Overcapitalized Error Message.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 3791f83ca999edc2d11eb2006ccc1091cd712c15
      
https://github.com/qemu/qemu/commit/3791f83ca999edc2d11eb2006ccc1091cd712c15
  Author: Markus Armbruster <address@hidden>
  Date:   2015-05-27 (Wed, 27 May 2015)

  Changed paths:
    M net/dump.c

  Log Message:
  -----------
  net/dump: Improve -net/host_net_add dump error reporting

When -net dump fails, it first reports a specific error, then a
generic one, like this:

    $ qemu-system-x86_64 -net dump,id=foo,file=/eperm
    qemu-system-x86_64: -net dump,id=foo,file=/eperm: -net dump: can't open 
/eperm
    qemu-system-x86_64: -net dump,id=foo,file=/eperm: Device 'dump' could not 
be initialized

Convert net_init_tap() to Error.  This suppresses the unwanted second
message.

Improve the error messages to include strerror(errno) where
appropriate.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: da4a4eac26381c7fce3f147f3c8a7e7bb483be1e
      
https://github.com/qemu/qemu/commit/da4a4eac26381c7fce3f147f3c8a7e7bb483be1e
  Author: Markus Armbruster <address@hidden>
  Date:   2015-05-27 (Wed, 27 May 2015)

  Changed paths:
    M net/tap.c

  Log Message:
  -----------
  tap: net_tap_fd_init() can't fail, drop dead error handling

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: a8a21be9855e0bb0947a7325d0d1741a8814f21e
      
https://github.com/qemu/qemu/commit/a8a21be9855e0bb0947a7325d0d1741a8814f21e
  Author: Markus Armbruster <address@hidden>
  Date:   2015-05-27 (Wed, 27 May 2015)

  Changed paths:
    M net/tap.c

  Log Message:
  -----------
  tap: Improve -netdev/netdev_add/-net/... bridge error reporting

When -netdev bridge fails, it first reports a specific error, then a
generic one, like this:

    $ qemu-system-x86_64 -netdev bridge,id=foo
    failed to launch bridge helper
    qemu-system-x86_64: -netdev bridge,id=foo: Device 'bridge' could not be 
initialized

The first message goes to stderr.  Wrong for HMP, because errors need
to go to the monitor there.

The second message goes to stderr for -netdev, to the monitor for HMP
netdev_add, and becomes the error reply for QMP netdev_add.

Convert net_bridge_run_helper() to Error, and propagate its errors
through net_init_bridge().  This ensures the error gets reported where
the user is, and suppresses the unwanted second message.

While there, improve the error messages a bit.

The above example becomes:

    $ qemu-system-x86_64 -netdev bridge,id=foo
    qemu-system-x86_64: -netdev bridge,id=foo: bridge helper failed

net_init_tap() also uses net_bridge_run_helper().  Propagate its
errors there as well.  Improves reporting these errors with -netdev
tap & friends.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 80b832c300c2fc39c68e0ab095d408cb9199cfa0
      
https://github.com/qemu/qemu/commit/80b832c300c2fc39c68e0ab095d408cb9199cfa0
  Author: Markus Armbruster <address@hidden>
  Date:   2015-05-27 (Wed, 27 May 2015)

  Changed paths:
    M net/tap-aix.c
    M net/tap-bsd.c
    M net/tap-haiku.c
    M net/tap-linux.c
    M net/tap-solaris.c
    M net/tap.c
    M net/tap_int.h

  Log Message:
  -----------
  tap: Convert tap_set_sndbuf() to Error

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 445f116cabe0c4435590244741ac3d0b8f08d91d
      
https://github.com/qemu/qemu/commit/445f116cabe0c4435590244741ac3d0b8f08d91d
  Author: Markus Armbruster <address@hidden>
  Date:   2015-05-27 (Wed, 27 May 2015)

  Changed paths:
    M net/tap.c

  Log Message:
  -----------
  tap: Convert net_init_tap_one() to Error

[Dropped %s from "tap: open vhost char device failed: %s" since
error_setg_errno() already prints a human-readable error string and
there is no format string argument.
--Stefan]

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: ac4fcf5639f44f7d863a35eaa2ad07ff31aabc01
      
https://github.com/qemu/qemu/commit/ac4fcf5639f44f7d863a35eaa2ad07ff31aabc01
  Author: Markus Armbruster <address@hidden>
  Date:   2015-05-27 (Wed, 27 May 2015)

  Changed paths:
    M net/tap.c

  Log Message:
  -----------
  tap: Convert launch_script() to Error

Fixes inappropriate use of stderr in monitor command handler.

While there, improve the messages some.

[Fixed Error **err -> Error *err local variable that broke the build.
--Stefan]

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 468dd82408e950d48def28f87e4cffabfd592ace
      
https://github.com/qemu/qemu/commit/468dd82408e950d48def28f87e4cffabfd592ace
  Author: Markus Armbruster <address@hidden>
  Date:   2015-05-27 (Wed, 27 May 2015)

  Changed paths:
    M net/tap-aix.c
    M net/tap-bsd.c
    M net/tap-haiku.c
    M net/tap-linux.c
    M net/tap-solaris.c
    M net/tap.c
    M net/tap_int.h

  Log Message:
  -----------
  tap: Permit incremental conversion of tap_open() to Error

Convert the trivial ones immediately: tap-aix and tap-haiku.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 47896e2fd3dd80685434b320cb0e10164995e31c
      
https://github.com/qemu/qemu/commit/47896e2fd3dd80685434b320cb0e10164995e31c
  Author: Markus Armbruster <address@hidden>
  Date:   2015-05-27 (Wed, 27 May 2015)

  Changed paths:
    M net/tap-linux.c

  Log Message:
  -----------
  tap-linux: Convert tap_open() to Error

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 4bce487e14bf8949a91883a3213c2b7fa9d668bc
      
https://github.com/qemu/qemu/commit/4bce487e14bf8949a91883a3213c2b7fa9d668bc
  Author: Markus Armbruster <address@hidden>
  Date:   2015-05-27 (Wed, 27 May 2015)

  Changed paths:
    M net/tap-bsd.c

  Log Message:
  -----------
  tap-bsd: Convert tap_open() to Error

Fixes inappropriate use of stderr in monitor command handler.

While there, improve some of the messages a bit.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 576c6eb6700d241c9d4a6883d25720c7bbaaeccd
      
https://github.com/qemu/qemu/commit/576c6eb6700d241c9d4a6883d25720c7bbaaeccd
  Author: Markus Armbruster <address@hidden>
  Date:   2015-05-27 (Wed, 27 May 2015)

  Changed paths:
    M net/tap-solaris.c

  Log Message:
  -----------
  tap-solaris: Convert tap_open() to Error

Fixes inappropriate use of syslog().

Not fixed: leaks on error paths, suspicious non-fatal errors.  FIXMEs
added instead.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 95c35a74fea51e307f6a3967e465a22776056b7e
      
https://github.com/qemu/qemu/commit/95c35a74fea51e307f6a3967e465a22776056b7e
  Author: Markus Armbruster <address@hidden>
  Date:   2015-05-27 (Wed, 27 May 2015)

  Changed paths:
    M net/tap.c

  Log Message:
  -----------
  tap: Finish conversion of tap_open() to Error

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: a308817743be5cc051d3379477f54027deb0befb
      
https://github.com/qemu/qemu/commit/a308817743be5cc051d3379477f54027deb0befb
  Author: Markus Armbruster <address@hidden>
  Date:   2015-05-27 (Wed, 27 May 2015)

  Changed paths:
    M net/tap.c

  Log Message:
  -----------
  tap: Improve -netdev/netdev_add/-net/... tap error reporting

When -netdev tap fails, it first reports a specific error, then a
generic one, like this:

    $ qemu-system-x86_64 -netdev tap,id=foo
    qemu-system-x86_64: -netdev tap,id=foo: could not configure /dev/net/tun: 
Operation not permitted
    qemu-system-x86_64: -netdev tap,id=foo: Device 'tap' could not be 
initialized

With the command line, the messages go to stderr.  In HMP, they go to
the monitor.  In QMP, the second one becomes the error reply, and the
first one goes to stderr.

Convert net_init_tap() to Error.  This suppresses the unwanted second
message, and makes the specific error the QMP error reply.

[Dropped duplicate "and" from error message as suggested by Eric Blake:
"ifname=, script=, downscript=, and vnet_hdr=, "
"queues=, and vhostfds= are invalid with helper="
--Stefan]

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 2bc22a58e16f0650e56dccfac9495e5aef58e2ef
      
https://github.com/qemu/qemu/commit/2bc22a58e16f0650e56dccfac9495e5aef58e2ef
  Author: Shannon Zhao <address@hidden>
  Date:   2015-05-27 (Wed, 27 May 2015)

  Changed paths:
    M net/net.c

  Log Message:
  -----------
  net/net: Record usage status of mac address

Currently QEMU dynamically generates mac address for the NIC which
doesn't specify the mac address. But when we hotplug a NIC without
specifying mac address, the mac address will increase for the same NIC
along with hotplug and hot-unplug, and at last it will overflow. And if
we codeplug one NIC with mac address e.g. "52:54:00:12:34:56", then
hotplug one NIC without specifying mac address and the mac address of
the hotplugged NIC is duplicate of "52:54:00:12:34:56".

This patch add a mac_table to record the usage status and free the mac
address when the NIC is unrealized.

Signed-off-by: Shannon Zhao <address@hidden>
Signed-off-by: Shannon Zhao <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: bc3004f0bb28d36b97eea5ff48922d16b4df7a1f
      
https://github.com/qemu/qemu/commit/bc3004f0bb28d36b97eea5ff48922d16b4df7a1f
  Author: Peter Maydell <address@hidden>
  Date:   2015-05-28 (Thu, 28 May 2015)

  Changed paths:
    M net/clients.h
    M net/dump.c
    M net/hub.c
    M net/l2tpv3.c
    M net/net.c
    M net/netmap.c
    M net/slirp.c
    M net/socket.c
    M net/tap-aix.c
    M net/tap-bsd.c
    M net/tap-haiku.c
    M net/tap-linux.c
    M net/tap-solaris.c
    M net/tap-win32.c
    M net/tap.c
    M net/tap_int.h
    M net/vde.c
    M net/vhost-user.c
    M qemu-options.hx

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/stefanha/tags/net-pull-request' into 
staging

# gpg: Signature made Wed May 27 11:02:55 2015 BST using RSA key ID 81AB73C8
# gpg: Good signature from "Stefan Hajnoczi <address@hidden>"
# gpg:                 aka "Stefan Hajnoczi <address@hidden>"

* remotes/stefanha/tags/net-pull-request:
  net/net: Record usage status of mac address
  tap: Improve -netdev/netdev_add/-net/... tap error reporting
  tap: Finish conversion of tap_open() to Error
  tap-solaris: Convert tap_open() to Error
  tap-bsd: Convert tap_open() to Error
  tap-linux: Convert tap_open() to Error
  tap: Permit incremental conversion of tap_open() to Error
  tap: Convert launch_script() to Error
  tap: Convert net_init_tap_one() to Error
  tap: Convert tap_set_sndbuf() to Error
  tap: Improve -netdev/netdev_add/-net/... bridge error reporting
  tap: net_tap_fd_init() can't fail, drop dead error handling
  net/dump: Improve -net/host_net_add dump error reporting
  net: Improve -net nic error reporting
  net: Permit incremental conversion of init functions to Error
  net: Improve error message for -net hubport a bit
  net: Change help text to list -netdev instead of -net by default

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/0915aed5842b...bc3004f0bb28

reply via email to

[Prev in Thread] Current Thread [Next in Thread]