Net patches
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJTWmwjAAoJEJykq7OBq3PI32kH+gMZlANje8MPlPn0rjuQC3Eb 9dt5Oz7dbRbEbRJQHvadbKSvV0beeIdSBxVe8vD3IOyPwGQQg0LqwTnUfXadwNYD SGYwOXMNgKe/+o9NRAcZonRxNLoU9J+cSCfLnqXUPdhLzlPF1uuaglBBjlcrhOOE YQfDIEe3UcPLpehl6ALrgtiF6+ZrjDnvFnL0KZcMKomQlCnMHvBuzVJ26lQ0m+38 JxYYc99q6qGvBleH/tHMT7jRWPdEud5rEINKAFnb/OB82YL44fbVTboDFmGVW5WI keWiWbs2BwpxXjOwyf7ZunmSMLWIdSVLiSja+WE0YUMiNh+DFxdO7I9YVNlYK4Q= =0oRs -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/stefanha/tags/net-pull-request' into staging Net patches # gpg: Signature made Fri 25 Apr 2014 15:07:31 BST using RSA key ID 81AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" * remotes/stefanha/tags/net-pull-request: net: Don't use error_is_set() to suppress additional errors net: Make qmp_query_rx_filter() with name argument more obvious net: xilinx_axienet.c: Add phy soft reset bit clearing net/net.c: Remove unnecessary semicolon pcnet: remove duplicate assignment tap: Avoid extra iterations while closing file fd Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
d09a18d44d
@ -718,7 +718,6 @@ static void pcnet_s_reset(PCNetState *s)
|
||||
s->csr[94] = 0x0000;
|
||||
s->csr[100] = 0x0200;
|
||||
s->csr[103] = 0x0105;
|
||||
s->csr[103] = 0x0105;
|
||||
s->csr[112] = 0x0000;
|
||||
s->csr[114] = 0x0000;
|
||||
s->csr[122] = 0x0000;
|
||||
|
@ -142,6 +142,9 @@ tdk_write(struct PHY *phy, unsigned int req, unsigned int data)
|
||||
phy->regs[regnum] = data;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Unconditionally clear regs[BMCR][BMCR_RESET] */
|
||||
phy->regs[0] &= ~0x8000;
|
||||
}
|
||||
|
||||
static void
|
||||
|
10
net/net.c
10
net/net.c
@ -473,7 +473,7 @@ ssize_t qemu_deliver_packet(NetClientState *sender,
|
||||
|
||||
if (ret == 0) {
|
||||
nc->receive_disabled = 1;
|
||||
};
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -1045,7 +1045,7 @@ RxFilterInfoList *qmp_query_rx_filter(bool has_name, const char *name,
|
||||
if (nc->info->type != NET_CLIENT_OPTIONS_KIND_NIC) {
|
||||
if (has_name) {
|
||||
error_setg(errp, "net client(%s) isn't a NIC", name);
|
||||
break;
|
||||
return NULL;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@ -1064,11 +1064,15 @@ RxFilterInfoList *qmp_query_rx_filter(bool has_name, const char *name,
|
||||
} else if (has_name) {
|
||||
error_setg(errp, "net client(%s) doesn't support"
|
||||
" rx-filter querying", name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (has_name) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (filter_list == NULL && !error_is_set(errp) && has_name) {
|
||||
if (filter_list == NULL && has_name) {
|
||||
error_setg(errp, "invalid net client name: %s", name);
|
||||
}
|
||||
|
||||
|
14
net/tap.c
14
net/tap.c
@ -367,11 +367,8 @@ static int launch_script(const char *setup_script, const char *ifname, int fd)
|
||||
if (pid == 0) {
|
||||
int open_max = sysconf(_SC_OPEN_MAX), i;
|
||||
|
||||
for (i = 0; i < open_max; i++) {
|
||||
if (i != STDIN_FILENO &&
|
||||
i != STDOUT_FILENO &&
|
||||
i != STDERR_FILENO &&
|
||||
i != fd) {
|
||||
for (i = 3; i < open_max; i++) {
|
||||
if (i != fd) {
|
||||
close(i);
|
||||
}
|
||||
}
|
||||
@ -452,11 +449,8 @@ static int net_bridge_run_helper(const char *helper, const char *bridge)
|
||||
char br_buf[6+IFNAMSIZ] = {0};
|
||||
char helper_cmd[PATH_MAX + sizeof(fd_buf) + sizeof(br_buf) + 15];
|
||||
|
||||
for (i = 0; i < open_max; i++) {
|
||||
if (i != STDIN_FILENO &&
|
||||
i != STDOUT_FILENO &&
|
||||
i != STDERR_FILENO &&
|
||||
i != sv[1]) {
|
||||
for (i = 3; i < open_max; i++) {
|
||||
if (i != sv[1]) {
|
||||
close(i);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user