[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH 3/3] net: fix error reporting for some net param
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] Re: [PATCH 3/3] net: fix error reporting for some net parameter checks |
Date: |
Thu, 28 May 2009 17:56:18 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
Mark McLoughlin wrote:
> A small bit of confusion between buffers is causing errors like:
>
> qemu: invalid parameter '10' in 'script=/etc/qemu-ifup,fd=10'
>
> instead of:
>
> qemu: invalid parameter 'script' in 'script=/etc/qemu-ifup,fd=10'
>
> Signed-off-by: Mark McLoughlin <address@hidden>
> ---
> net.c | 12 ++++++------
> 1 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/net.c b/net.c
> index 723e934..2594ed7 100644
> --- a/net.c
> +++ b/net.c
> @@ -2036,7 +2036,7 @@ int net_client_init(const char *device, const char *p)
> if (get_param_value(buf, sizeof(buf), "fd", p) > 0) {
> if (check_params(chkbuf, sizeof(chkbuf), fd_params, p) < 0) {
> fprintf(stderr, "qemu: invalid parameter '%s' in '%s'\n",
> - buf, p);
> + chkbuf, p);
> return -1;
> }
> fd = strtol(buf, NULL, 0);
> @@ -2049,7 +2049,7 @@ int net_client_init(const char *device, const char *p)
> };
> if (check_params(chkbuf, sizeof(chkbuf), tap_params, p) < 0) {
> fprintf(stderr, "qemu: invalid parameter '%s' in '%s'\n",
> - buf, p);
> + chkbuf, p);
> return -1;
> }
> if (get_param_value(ifname, sizeof(ifname), "ifname", p) <= 0) {
> @@ -2071,7 +2071,7 @@ int net_client_init(const char *device, const char *p)
> int fd;
> if (check_params(chkbuf, sizeof(chkbuf), fd_params, p) < 0) {
> fprintf(stderr, "qemu: invalid parameter '%s' in '%s'\n",
> - buf, p);
> + chkbuf, p);
> return -1;
> }
> fd = strtol(buf, NULL, 0);
> @@ -2084,7 +2084,7 @@ int net_client_init(const char *device, const char *p)
> };
> if (check_params(chkbuf, sizeof(chkbuf), listen_params, p) < 0) {
> fprintf(stderr, "qemu: invalid parameter '%s' in '%s'\n",
> - buf, p);
> + chkbuf, p);
> return -1;
> }
> ret = net_socket_listen_init(vlan, device, name, buf);
> @@ -2094,7 +2094,7 @@ int net_client_init(const char *device, const char *p)
> };
> if (check_params(chkbuf, sizeof(chkbuf), connect_params, p) < 0)
> {
> fprintf(stderr, "qemu: invalid parameter '%s' in '%s'\n",
> - buf, p);
> + chkbuf, p);
> return -1;
> }
> ret = net_socket_connect_init(vlan, device, name, buf);
> @@ -2104,7 +2104,7 @@ int net_client_init(const char *device, const char *p)
> };
> if (check_params(chkbuf, sizeof(chkbuf), mcast_params, p) < 0) {
> fprintf(stderr, "qemu: invalid parameter '%s' in '%s'\n",
> - buf, p);
> + chkbuf, p);
> return -1;
> }
> ret = net_socket_mcast_init(vlan, device, name, buf);
Ack for all three.
(My dear. I promise to never touch these param checks again.)
Jan
--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
[Qemu-devel] [PATCH 06/11] slirp: Reorder initialization, Jan Kiszka, 2009/05/08
[Qemu-devel] [PATCH 02/11] net: Fix and improved ordered packet delivery, Jan Kiszka, 2009/05/08
[Qemu-devel] [PATCH 08/11] slirp: Move smb, redir, tftp and bootp parameters and -net channel, Jan Kiszka, 2009/05/08
- Re: [Qemu-devel] [PATCH 08/11] slirp: Move smb, redir, tftp and bootp parameters and -net channel, Mark McLoughlin, 2009/05/28
- Re: [Qemu-devel] [PATCH 08/11] slirp: Move smb, redir, tftp and bootp parameters and -net channel, Jan Kiszka, 2009/05/28
- Re: [Qemu-devel] [PATCH 08/11] slirp: Move smb, redir, tftp and bootp parameters and -net channel, Paul Brook, 2009/05/29
- Re: [Qemu-devel] [PATCH 08/11] slirp: Move smb, redir, tftp and bootp parameters and -net channel, Jan Kiszka, 2009/05/29
- Re: [Qemu-devel] [PATCH 08/11] slirp: Move smb, redir, tftp and bootp parameters and -net channel, Paul Brook, 2009/05/29