mirror of https://github.com/xqemu/xqemu.git
Revert "Fix output of uninitialized strings"
This reverts commit8cf07dcbe7
. This is a sorry saga. This commit:8e4416af45
net: Add parameter checks for VLAN clients broken '-net socket' and this commit:ffad4116b9
net: Fix -net socket parameter checks fixed the problem but introduced another problem which this commit:8cf07dcbe7
Fix output of uninitialized strings fixed that final problem, but causing us to lose some error reporting information in the process. Meanwhile Jan posted a patch to mostly re-doffad4116b9
in a way that fixes the original issue, but without losing the error reporting information. So, let's revert8cf07dcbe7
and apply Jan's patch. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
This commit is contained in:
parent
7c3370d4fe
commit
cda94b2782
30
net.c
30
net.c
|
@ -1912,7 +1912,8 @@ int net_client_init(const char *device, const char *p)
|
||||||
int idx = nic_get_free_idx();
|
int idx = nic_get_free_idx();
|
||||||
|
|
||||||
if (check_params(nic_params, p) < 0) {
|
if (check_params(nic_params, p) < 0) {
|
||||||
fprintf(stderr, "qemu: invalid parameter in '%s'\n", p);
|
fprintf(stderr, "qemu: invalid parameter '%s' in '%s'\n",
|
||||||
|
buf, p);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (idx == -1 || nb_nics >= MAX_NICS) {
|
if (idx == -1 || nb_nics >= MAX_NICS) {
|
||||||
|
@ -1962,7 +1963,8 @@ int net_client_init(const char *device, const char *p)
|
||||||
"vlan", "name", "hostname", "restrict", "ip", NULL
|
"vlan", "name", "hostname", "restrict", "ip", NULL
|
||||||
};
|
};
|
||||||
if (check_params(slirp_params, p) < 0) {
|
if (check_params(slirp_params, p) < 0) {
|
||||||
fprintf(stderr, "qemu: invalid parameter in '%s'\n", p);
|
fprintf(stderr, "qemu: invalid parameter '%s' in '%s'\n",
|
||||||
|
buf, p);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (get_param_value(buf, sizeof(buf), "hostname", p)) {
|
if (get_param_value(buf, sizeof(buf), "hostname", p)) {
|
||||||
|
@ -2012,7 +2014,8 @@ int net_client_init(const char *device, const char *p)
|
||||||
char ifname[64];
|
char ifname[64];
|
||||||
|
|
||||||
if (check_params(tap_params, p) < 0) {
|
if (check_params(tap_params, p) < 0) {
|
||||||
fprintf(stderr, "qemu: invalid parameter in '%s'\n", p);
|
fprintf(stderr, "qemu: invalid parameter '%s' in '%s'\n",
|
||||||
|
buf, p);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (get_param_value(ifname, sizeof(ifname), "ifname", p) <= 0) {
|
if (get_param_value(ifname, sizeof(ifname), "ifname", p) <= 0) {
|
||||||
|
@ -2032,7 +2035,8 @@ int net_client_init(const char *device, const char *p)
|
||||||
vlan->nb_host_devs++;
|
vlan->nb_host_devs++;
|
||||||
if (get_param_value(buf, sizeof(buf), "fd", p) > 0) {
|
if (get_param_value(buf, sizeof(buf), "fd", p) > 0) {
|
||||||
if (check_params(fd_params, p) < 0) {
|
if (check_params(fd_params, p) < 0) {
|
||||||
fprintf(stderr, "qemu: invalid parameter in '%s'\n", p);
|
fprintf(stderr, "qemu: invalid parameter '%s' in '%s'\n",
|
||||||
|
buf, p);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
fd = strtol(buf, NULL, 0);
|
fd = strtol(buf, NULL, 0);
|
||||||
|
@ -2044,7 +2048,8 @@ int net_client_init(const char *device, const char *p)
|
||||||
"vlan", "name", "ifname", "script", "downscript", NULL
|
"vlan", "name", "ifname", "script", "downscript", NULL
|
||||||
};
|
};
|
||||||
if (check_params(tap_params, p) < 0) {
|
if (check_params(tap_params, p) < 0) {
|
||||||
fprintf(stderr, "qemu: invalid parameter in '%s'\n", p);
|
fprintf(stderr, "qemu: invalid parameter '%s' in '%s'\n",
|
||||||
|
buf, p);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (get_param_value(ifname, sizeof(ifname), "ifname", p) <= 0) {
|
if (get_param_value(ifname, sizeof(ifname), "ifname", p) <= 0) {
|
||||||
|
@ -2064,7 +2069,8 @@ int net_client_init(const char *device, const char *p)
|
||||||
if (get_param_value(buf, sizeof(buf), "fd", p) > 0) {
|
if (get_param_value(buf, sizeof(buf), "fd", p) > 0) {
|
||||||
int fd;
|
int fd;
|
||||||
if (check_params(fd_params, p) < 0) {
|
if (check_params(fd_params, p) < 0) {
|
||||||
fprintf(stderr, "qemu: invalid parameter in '%s'\n", p);
|
fprintf(stderr, "qemu: invalid parameter '%s' in '%s'\n",
|
||||||
|
buf, p);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
fd = strtol(buf, NULL, 0);
|
fd = strtol(buf, NULL, 0);
|
||||||
|
@ -2076,7 +2082,8 @@ int net_client_init(const char *device, const char *p)
|
||||||
"vlan", "name", "listen", NULL
|
"vlan", "name", "listen", NULL
|
||||||
};
|
};
|
||||||
if (check_params(listen_params, p) < 0) {
|
if (check_params(listen_params, p) < 0) {
|
||||||
fprintf(stderr, "qemu: invalid parameter in '%s'\n", p);
|
fprintf(stderr, "qemu: invalid parameter '%s' in '%s'\n",
|
||||||
|
buf, p);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
ret = net_socket_listen_init(vlan, device, name, buf);
|
ret = net_socket_listen_init(vlan, device, name, buf);
|
||||||
|
@ -2085,7 +2092,8 @@ int net_client_init(const char *device, const char *p)
|
||||||
"vlan", "name", "connect", NULL
|
"vlan", "name", "connect", NULL
|
||||||
};
|
};
|
||||||
if (check_params(connect_params, p) < 0) {
|
if (check_params(connect_params, p) < 0) {
|
||||||
fprintf(stderr, "qemu: invalid parameter in '%s'\n", p);
|
fprintf(stderr, "qemu: invalid parameter '%s' in '%s'\n",
|
||||||
|
buf, p);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
ret = net_socket_connect_init(vlan, device, name, buf);
|
ret = net_socket_connect_init(vlan, device, name, buf);
|
||||||
|
@ -2094,7 +2102,8 @@ int net_client_init(const char *device, const char *p)
|
||||||
"vlan", "name", "mcast", NULL
|
"vlan", "name", "mcast", NULL
|
||||||
};
|
};
|
||||||
if (check_params(mcast_params, p) < 0) {
|
if (check_params(mcast_params, p) < 0) {
|
||||||
fprintf(stderr, "qemu: invalid parameter in '%s'\n", p);
|
fprintf(stderr, "qemu: invalid parameter '%s' in '%s'\n",
|
||||||
|
buf, p);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
ret = net_socket_mcast_init(vlan, device, name, buf);
|
ret = net_socket_mcast_init(vlan, device, name, buf);
|
||||||
|
@ -2114,7 +2123,8 @@ int net_client_init(const char *device, const char *p)
|
||||||
int vde_port, vde_mode;
|
int vde_port, vde_mode;
|
||||||
|
|
||||||
if (check_params(vde_params, p) < 0) {
|
if (check_params(vde_params, p) < 0) {
|
||||||
fprintf(stderr, "qemu: invalid parameter in '%s'\n", p);
|
fprintf(stderr, "qemu: invalid parameter '%s' in '%s'\n",
|
||||||
|
buf, p);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
vlan->nb_host_devs++;
|
vlan->nb_host_devs++;
|
||||||
|
|
3
vl.c
3
vl.c
|
@ -2228,7 +2228,8 @@ int drive_init(struct drive_opt *arg, int snapshot, void *opaque)
|
||||||
NULL };
|
NULL };
|
||||||
|
|
||||||
if (check_params(params, str) < 0) {
|
if (check_params(params, str) < 0) {
|
||||||
fprintf(stderr, "qemu: unknown parameter in '%s'\n", str);
|
fprintf(stderr, "qemu: unknown parameter '%s' in '%s'\n",
|
||||||
|
buf, str);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue