1 | The following changes since commit d8276573da58e8ce78dab8c46dd660efd664bcb7: | 1 | The following changes since commit 23895cbd82be95428e90168b12e925d0d3ca2f06: |
---|---|---|---|
2 | 2 | ||
3 | Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20190510' into staging (2019-05-16 13:15:08 +0100) | 3 | Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20201123.0' into staging (2020-11-23 18:51:13 +0000) |
4 | 4 | ||
5 | are available in the git repository at: | 5 | are available in the git repository at: |
6 | 6 | ||
7 | https://github.com/jasowang/qemu.git tags/net-pull-request | 7 | https://github.com/jasowang/qemu.git tags/net-pull-request |
8 | 8 | ||
9 | for you to fetch changes up to 78e4f446d2569210a8558946b2321f9ff2ef47f6: | 9 | for you to fetch changes up to 9925990d01a92564af55f6f69d0f5f59b47609b1: |
10 | 10 | ||
11 | net/colo-compare.c: Fix a crash in COLO Primary. (2019-05-17 17:00:12 +0800) | 11 | net: Use correct default-path macro for downscript (2020-11-24 10:40:17 +0800) |
12 | 12 | ||
13 | ---------------------------------------------------------------- | 13 | ---------------------------------------------------------------- |
14 | 14 | ||
15 | ---------------------------------------------------------------- | 15 | ---------------------------------------------------------------- |
16 | Chris Kenna (1): | 16 | Keqian Zhu (1): |
17 | e1000: Never increment the RX undersize count register | 17 | net: Use correct default-path macro for downscript |
18 | 18 | ||
19 | Jason Wang (1): | 19 | Paolo Bonzini (1): |
20 | vhost_net: don't set backend for the uninitialized virtqueue | 20 | net: do not exit on "netdev_add help" monitor command |
21 | 21 | ||
22 | Lukas Straub (1): | 22 | Prasad J Pandit (1): |
23 | net/colo-compare.c: Fix a crash in COLO Primary. | 23 | hw/net/e1000e: advance desc_offset in case of null descriptor |
24 | 24 | ||
25 | Stefano Garzarella (1): | 25 | Yuri Benditovich (1): |
26 | net/slirp: fix the IPv6 prefix length error message | 26 | net: purge queued rx packets on queue deletion |
27 | 27 | ||
28 | hw/net/e1000.c | 1 - | 28 | yuanjungong (1): |
29 | hw/net/vhost_net.c | 10 ++++++++++ | 29 | tap: fix a memory leak |
30 | hw/virtio/virtio.c | 5 +++++ | 30 | |
31 | include/hw/virtio/virtio.h | 1 + | 31 | hw/net/e1000e_core.c | 8 +++--- |
32 | net/colo-compare.c | 3 +-- | 32 | include/net/net.h | 1 + |
33 | net/slirp.c | 3 ++- | 33 | monitor/hmp-cmds.c | 6 ++++ |
34 | 6 files changed, 19 insertions(+), 4 deletions(-) | 34 | net/net.c | 80 +++++++++++++++++++++++++++------------------------- |
35 | net/tap.c | 5 +++- | ||
36 | 5 files changed, 57 insertions(+), 43 deletions(-) | ||
35 | 37 | ||
36 | 38 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Prasad J Pandit <pjp@fedoraproject.org> | ||
1 | 2 | ||
3 | While receiving packets via e1000e_write_packet_to_guest() routine, | ||
4 | 'desc_offset' is advanced only when RX descriptor is processed. And | ||
5 | RX descriptor is not processed if it has NULL buffer address. | ||
6 | This may lead to an infinite loop condition. Increament 'desc_offset' | ||
7 | to process next descriptor in the ring to avoid infinite loop. | ||
8 | |||
9 | Reported-by: Cheol-woo Myung <330cjfdn@gmail.com> | ||
10 | Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> | ||
11 | Signed-off-by: Jason Wang <jasowang@redhat.com> | ||
12 | --- | ||
13 | hw/net/e1000e_core.c | 8 ++++---- | ||
14 | 1 file changed, 4 insertions(+), 4 deletions(-) | ||
15 | |||
16 | diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c | ||
17 | index XXXXXXX..XXXXXXX 100644 | ||
18 | --- a/hw/net/e1000e_core.c | ||
19 | +++ b/hw/net/e1000e_core.c | ||
20 | @@ -XXX,XX +XXX,XX @@ e1000e_write_packet_to_guest(E1000ECore *core, struct NetRxPkt *pkt, | ||
21 | (const char *) &fcs_pad, e1000x_fcs_len(core->mac)); | ||
22 | } | ||
23 | } | ||
24 | - desc_offset += desc_size; | ||
25 | - if (desc_offset >= total_size) { | ||
26 | - is_last = true; | ||
27 | - } | ||
28 | } else { /* as per intel docs; skip descriptors with null buf addr */ | ||
29 | trace_e1000e_rx_null_descriptor(); | ||
30 | } | ||
31 | + desc_offset += desc_size; | ||
32 | + if (desc_offset >= total_size) { | ||
33 | + is_last = true; | ||
34 | + } | ||
35 | |||
36 | e1000e_write_rx_descr(core, desc, is_last ? core->rx_pkt : NULL, | ||
37 | rss_info, do_ps ? ps_hdr_len : 0, &bastate.written); | ||
38 | -- | ||
39 | 2.7.4 | ||
40 | |||
41 | diff view generated by jsdifflib |
1 | We used to set backend unconditionally, this won't work for some | 1 | From: Paolo Bonzini <pbonzini@redhat.com> |
---|---|---|---|
2 | guests (e.g windows driver) who may not initialize all virtqueues. For | ||
3 | kernel backend, this will fail since it may try to validate the rings | ||
4 | during setting backend. | ||
5 | 2 | ||
6 | Fixing this by simply skipping the backend set when we find desc is | 3 | "netdev_add help" is causing QEMU to exit because the code that |
7 | not ready. | 4 | invokes show_netdevs is shared between CLI and HMP processing. |
5 | Move the check to the callers so that exit(0) remains only | ||
6 | in the CLI flow. | ||
8 | 7 | ||
9 | Reviewed-by: Michael S. Tsirkin<mst@redhat.com> | 8 | "netdev_add help" is not fixed by this patch; that is left for |
9 | later work. | ||
10 | |||
11 | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> | ||
10 | Signed-off-by: Jason Wang <jasowang@redhat.com> | 12 | Signed-off-by: Jason Wang <jasowang@redhat.com> |
11 | --- | 13 | --- |
12 | hw/net/vhost_net.c | 10 ++++++++++ | 14 | include/net/net.h | 1 + |
13 | hw/virtio/virtio.c | 5 +++++ | 15 | monitor/hmp-cmds.c | 6 +++++ |
14 | include/hw/virtio/virtio.h | 1 + | 16 | net/net.c | 68 +++++++++++++++++++++++++++--------------------------- |
15 | 3 files changed, 16 insertions(+) | 17 | 3 files changed, 41 insertions(+), 34 deletions(-) |
16 | 18 | ||
17 | diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c | 19 | diff --git a/include/net/net.h b/include/net/net.h |
18 | index XXXXXXX..XXXXXXX 100644 | 20 | index XXXXXXX..XXXXXXX 100644 |
19 | --- a/hw/net/vhost_net.c | 21 | --- a/include/net/net.h |
20 | +++ b/hw/net/vhost_net.c | 22 | +++ b/include/net/net.h |
21 | @@ -XXX,XX +XXX,XX @@ static int vhost_net_start_one(struct vhost_net *net, | 23 | @@ -XXX,XX +XXX,XX @@ extern const char *host_net_devices[]; |
22 | qemu_set_fd_handler(net->backend, NULL, NULL, NULL); | 24 | |
23 | file.fd = net->backend; | 25 | /* from net.c */ |
24 | for (file.index = 0; file.index < net->dev.nvqs; ++file.index) { | 26 | int net_client_parse(QemuOptsList *opts_list, const char *str); |
25 | + if (!virtio_queue_enabled(dev, net->dev.vq_index + | 27 | +void show_netdevs(void); |
26 | + file.index)) { | 28 | int net_init_clients(Error **errp); |
27 | + /* Queue might not be ready for start */ | 29 | void net_check_clients(void); |
28 | + continue; | 30 | void net_cleanup(void); |
29 | + } | 31 | diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c |
30 | r = vhost_net_set_backend(&net->dev, &file); | 32 | index XXXXXXX..XXXXXXX 100644 |
31 | if (r < 0) { | 33 | --- a/monitor/hmp-cmds.c |
32 | r = -errno; | 34 | +++ b/monitor/hmp-cmds.c |
33 | @@ -XXX,XX +XXX,XX @@ fail: | 35 | @@ -XXX,XX +XXX,XX @@ |
34 | file.fd = -1; | 36 | #include "qemu/option.h" |
35 | if (net->nc->info->type == NET_CLIENT_DRIVER_TAP) { | 37 | #include "qemu/timer.h" |
36 | while (file.index-- > 0) { | 38 | #include "qemu/sockets.h" |
37 | + if (!virtio_queue_enabled(dev, net->dev.vq_index + | 39 | +#include "qemu/help_option.h" |
38 | + file.index)) { | 40 | #include "monitor/monitor-internal.h" |
39 | + /* Queue might not be ready for start */ | 41 | #include "qapi/error.h" |
40 | + continue; | 42 | #include "qapi/clone-visitor.h" |
41 | + } | 43 | @@ -XXX,XX +XXX,XX @@ void hmp_netdev_add(Monitor *mon, const QDict *qdict) |
42 | int r = vhost_net_set_backend(&net->dev, &file); | 44 | { |
43 | assert(r >= 0); | 45 | Error *err = NULL; |
46 | QemuOpts *opts; | ||
47 | + const char *type = qdict_get_try_str(qdict, "type"); | ||
48 | |||
49 | + if (type && is_help_option(type)) { | ||
50 | + show_netdevs(); | ||
51 | + return; | ||
52 | + } | ||
53 | opts = qemu_opts_from_qdict(qemu_find_opts("netdev"), qdict, &err); | ||
54 | if (err) { | ||
55 | goto out; | ||
56 | diff --git a/net/net.c b/net/net.c | ||
57 | index XXXXXXX..XXXXXXX 100644 | ||
58 | --- a/net/net.c | ||
59 | +++ b/net/net.c | ||
60 | @@ -XXX,XX +XXX,XX @@ | ||
61 | #include "qemu/config-file.h" | ||
62 | #include "qemu/ctype.h" | ||
63 | #include "qemu/iov.h" | ||
64 | +#include "qemu/qemu-print.h" | ||
65 | #include "qemu/main-loop.h" | ||
66 | #include "qemu/option.h" | ||
67 | #include "qapi/error.h" | ||
68 | @@ -XXX,XX +XXX,XX @@ static int net_client_init1(const Netdev *netdev, bool is_netdev, Error **errp) | ||
69 | return 0; | ||
70 | } | ||
71 | |||
72 | -static void show_netdevs(void) | ||
73 | +void show_netdevs(void) | ||
74 | { | ||
75 | int idx; | ||
76 | const char *available_netdevs[] = { | ||
77 | @@ -XXX,XX +XXX,XX @@ static void show_netdevs(void) | ||
78 | #endif | ||
79 | }; | ||
80 | |||
81 | - printf("Available netdev backend types:\n"); | ||
82 | + qemu_printf("Available netdev backend types:\n"); | ||
83 | for (idx = 0; idx < ARRAY_SIZE(available_netdevs); idx++) { | ||
84 | - puts(available_netdevs[idx]); | ||
85 | + qemu_printf("%s\n", available_netdevs[idx]); | ||
86 | } | ||
87 | } | ||
88 | |||
89 | @@ -XXX,XX +XXX,XX @@ static int net_client_init(QemuOpts *opts, bool is_netdev, Error **errp) | ||
90 | int ret = -1; | ||
91 | Visitor *v = opts_visitor_new(opts); | ||
92 | |||
93 | - const char *type = qemu_opt_get(opts, "type"); | ||
94 | - | ||
95 | - if (is_netdev && type && is_help_option(type)) { | ||
96 | - show_netdevs(); | ||
97 | - exit(0); | ||
98 | - } else { | ||
99 | - /* Parse convenience option format ip6-net=fec0::0[/64] */ | ||
100 | - const char *ip6_net = qemu_opt_get(opts, "ipv6-net"); | ||
101 | + /* Parse convenience option format ip6-net=fec0::0[/64] */ | ||
102 | + const char *ip6_net = qemu_opt_get(opts, "ipv6-net"); | ||
103 | |||
104 | - if (ip6_net) { | ||
105 | - char *prefix_addr; | ||
106 | - unsigned long prefix_len = 64; /* Default 64bit prefix length. */ | ||
107 | + if (ip6_net) { | ||
108 | + char *prefix_addr; | ||
109 | + unsigned long prefix_len = 64; /* Default 64bit prefix length. */ | ||
110 | |||
111 | - substrings = g_strsplit(ip6_net, "/", 2); | ||
112 | - if (!substrings || !substrings[0]) { | ||
113 | - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "ipv6-net", | ||
114 | - "a valid IPv6 prefix"); | ||
115 | - goto out; | ||
116 | - } | ||
117 | + substrings = g_strsplit(ip6_net, "/", 2); | ||
118 | + if (!substrings || !substrings[0]) { | ||
119 | + error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "ipv6-net", | ||
120 | + "a valid IPv6 prefix"); | ||
121 | + goto out; | ||
122 | + } | ||
123 | |||
124 | - prefix_addr = substrings[0]; | ||
125 | + prefix_addr = substrings[0]; | ||
126 | |||
127 | - /* Handle user-specified prefix length. */ | ||
128 | - if (substrings[1] && | ||
129 | - qemu_strtoul(substrings[1], NULL, 10, &prefix_len)) | ||
130 | - { | ||
131 | - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, | ||
132 | - "ipv6-prefixlen", "a number"); | ||
133 | - goto out; | ||
134 | - } | ||
135 | - | ||
136 | - qemu_opt_set(opts, "ipv6-prefix", prefix_addr, &error_abort); | ||
137 | - qemu_opt_set_number(opts, "ipv6-prefixlen", prefix_len, | ||
138 | - &error_abort); | ||
139 | - qemu_opt_unset(opts, "ipv6-net"); | ||
140 | + /* Handle user-specified prefix length. */ | ||
141 | + if (substrings[1] && | ||
142 | + qemu_strtoul(substrings[1], NULL, 10, &prefix_len)) | ||
143 | + { | ||
144 | + error_setg(errp, QERR_INVALID_PARAMETER_VALUE, | ||
145 | + "ipv6-prefixlen", "a number"); | ||
146 | + goto out; | ||
44 | } | 147 | } |
45 | diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c | 148 | + |
46 | index XXXXXXX..XXXXXXX 100644 | 149 | + qemu_opt_set(opts, "ipv6-prefix", prefix_addr, &error_abort); |
47 | --- a/hw/virtio/virtio.c | 150 | + qemu_opt_set_number(opts, "ipv6-prefixlen", prefix_len, |
48 | +++ b/hw/virtio/virtio.c | 151 | + &error_abort); |
49 | @@ -XXX,XX +XXX,XX @@ hwaddr virtio_queue_get_desc_addr(VirtIODevice *vdev, int n) | 152 | + qemu_opt_unset(opts, "ipv6-net"); |
50 | return vdev->vq[n].vring.desc; | 153 | } |
154 | |||
155 | /* Create an ID for -net if the user did not specify one */ | ||
156 | @@ -XXX,XX +XXX,XX @@ static int net_init_client(void *dummy, QemuOpts *opts, Error **errp) | ||
157 | |||
158 | static int net_init_netdev(void *dummy, QemuOpts *opts, Error **errp) | ||
159 | { | ||
160 | + const char *type = qemu_opt_get(opts, "type"); | ||
161 | + | ||
162 | + if (type && is_help_option(type)) { | ||
163 | + show_netdevs(); | ||
164 | + exit(0); | ||
165 | + } | ||
166 | return net_client_init(opts, true, errp); | ||
51 | } | 167 | } |
52 | 168 | ||
53 | +bool virtio_queue_enabled(VirtIODevice *vdev, int n) | ||
54 | +{ | ||
55 | + return virtio_queue_get_desc_addr(vdev, n) != 0; | ||
56 | +} | ||
57 | + | ||
58 | hwaddr virtio_queue_get_avail_addr(VirtIODevice *vdev, int n) | ||
59 | { | ||
60 | return vdev->vq[n].vring.avail; | ||
61 | diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h | ||
62 | index XXXXXXX..XXXXXXX 100644 | ||
63 | --- a/include/hw/virtio/virtio.h | ||
64 | +++ b/include/hw/virtio/virtio.h | ||
65 | @@ -XXX,XX +XXX,XX @@ typedef struct VirtIORNGConf VirtIORNGConf; | ||
66 | VIRTIO_F_IOMMU_PLATFORM, false) | ||
67 | |||
68 | hwaddr virtio_queue_get_desc_addr(VirtIODevice *vdev, int n); | ||
69 | +bool virtio_queue_enabled(VirtIODevice *vdev, int n); | ||
70 | hwaddr virtio_queue_get_avail_addr(VirtIODevice *vdev, int n); | ||
71 | hwaddr virtio_queue_get_used_addr(VirtIODevice *vdev, int n); | ||
72 | hwaddr virtio_queue_get_desc_size(VirtIODevice *vdev, int n); | ||
73 | -- | 169 | -- |
74 | 2.5.0 | 170 | 2.7.4 |
75 | 171 | ||
76 | 172 | diff view generated by jsdifflib |
1 | From: Lukas Straub <lukasstraub2@web.de> | 1 | From: Yuri Benditovich <yuri.benditovich@daynix.com> |
---|---|---|---|
2 | 2 | ||
3 | Because event_unhandled_count may be accessed concurrently, it needs | 3 | https://bugzilla.redhat.com/show_bug.cgi?id=1829272 |
4 | to be protected by taking the lock. However the assert is outside the | 4 | When deleting queue pair, purge pending RX packets if any. |
5 | lock, probably causing it to read garbage and aborting Qemu erroneously. | 5 | Example of problematic flow: |
6 | 1. Bring up q35 VM with tap (vhost off) and virtio-net or e1000e | ||
7 | 2. Run ping flood to the VM NIC ( 1 ms interval) | ||
8 | 3. Hot unplug the NIC device (device_del) | ||
9 | During unplug process one or more packets come, the NIC | ||
10 | can't receive, tap disables read_poll | ||
11 | 4. Hot plug the device (device_add) with the same netdev | ||
12 | The tap stays with read_poll disabled and does not receive | ||
13 | any packets anymore (tap_send never triggered) | ||
6 | 14 | ||
7 | The Bug only happens when running Qemu in COLO mode. | 15 | Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com> |
8 | |||
9 | This Patch fixes the following bug: https://bugs.launchpad.net/qemu/+bug/1824622 | ||
10 | |||
11 | Signed-off-by: Lukas Straub <lukasstraub2@web.de> | ||
12 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
13 | Reviewed-by: Zhang Chen <chen.zhang@intel.com> | ||
14 | Signed-off-by: Jason Wang <jasowang@redhat.com> | 16 | Signed-off-by: Jason Wang <jasowang@redhat.com> |
15 | --- | 17 | --- |
16 | net/colo-compare.c | 3 +-- | 18 | net/net.c | 12 ++++++++---- |
17 | 1 file changed, 1 insertion(+), 2 deletions(-) | 19 | 1 file changed, 8 insertions(+), 4 deletions(-) |
18 | 20 | ||
19 | diff --git a/net/colo-compare.c b/net/colo-compare.c | 21 | diff --git a/net/net.c b/net/net.c |
20 | index XXXXXXX..XXXXXXX 100644 | 22 | index XXXXXXX..XXXXXXX 100644 |
21 | --- a/net/colo-compare.c | 23 | --- a/net/net.c |
22 | +++ b/net/colo-compare.c | 24 | +++ b/net/net.c |
23 | @@ -XXX,XX +XXX,XX @@ static void colo_compare_handle_event(void *opaque) | 25 | @@ -XXX,XX +XXX,XX @@ void qemu_del_nic(NICState *nic) |
24 | break; | 26 | |
27 | qemu_macaddr_set_free(&nic->conf->macaddr); | ||
28 | |||
29 | - /* If this is a peer NIC and peer has already been deleted, free it now. */ | ||
30 | - if (nic->peer_deleted) { | ||
31 | - for (i = 0; i < queues; i++) { | ||
32 | - qemu_free_net_client(qemu_get_subqueue(nic, i)->peer); | ||
33 | + for (i = 0; i < queues; i++) { | ||
34 | + NetClientState *nc = qemu_get_subqueue(nic, i); | ||
35 | + /* If this is a peer NIC and peer has already been deleted, free it now. */ | ||
36 | + if (nic->peer_deleted) { | ||
37 | + qemu_free_net_client(nc->peer); | ||
38 | + } else if (nc->peer) { | ||
39 | + /* if there are RX packets pending, complete them */ | ||
40 | + qemu_purge_queued_packets(nc->peer); | ||
41 | } | ||
25 | } | 42 | } |
26 | 43 | ||
27 | - assert(event_unhandled_count > 0); | ||
28 | - | ||
29 | qemu_mutex_lock(&event_mtx); | ||
30 | + assert(event_unhandled_count > 0); | ||
31 | event_unhandled_count--; | ||
32 | qemu_cond_broadcast(&event_complete_cond); | ||
33 | qemu_mutex_unlock(&event_mtx); | ||
34 | -- | 44 | -- |
35 | 2.5.0 | 45 | 2.7.4 |
36 | 46 | ||
37 | 47 | diff view generated by jsdifflib |
1 | From: Chris Kenna <chris.kenna@oracle.com> | 1 | From: yuanjungong <ruc_gongyuanjun@163.com> |
---|---|---|---|
2 | 2 | ||
3 | In situations where e1000 receives an undersized Ethernet frame, | 3 | Close fd before returning. |
4 | QEMU increments the emulated "Receive Undersize Count (RUC)" | ||
5 | register when padding the frame. | ||
6 | 4 | ||
7 | This is incorrect because this an expected scenario (e.g. with | 5 | Buglink: https://bugs.launchpad.net/qemu/+bug/1904486 |
8 | VLAN tag stripping) and not an error. As such, QEMU should not | ||
9 | increment the emulated RUC. | ||
10 | 6 | ||
11 | Fixes: 3b2743017749 ("e1000: Implementing various counters") | 7 | Signed-off-by: yuanjungong <ruc_gongyuanjun@163.com> |
12 | 8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | |
13 | Reviewed-by: Mark Kanda <mark.kanda@oracle.com> | ||
14 | Reviewed-by: Bhavesh Davda <bhavesh.davda@oracle.com> | ||
15 | Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> | ||
16 | Signed-off-by: Chris Kenna <chris.kenna@oracle.com> | ||
17 | Signed-off-by: Jason Wang <jasowang@redhat.com> | 9 | Signed-off-by: Jason Wang <jasowang@redhat.com> |
18 | --- | 10 | --- |
19 | hw/net/e1000.c | 1 - | 11 | net/tap.c | 2 ++ |
20 | 1 file changed, 1 deletion(-) | 12 | 1 file changed, 2 insertions(+) |
21 | 13 | ||
22 | diff --git a/hw/net/e1000.c b/hw/net/e1000.c | 14 | diff --git a/net/tap.c b/net/tap.c |
23 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
24 | --- a/hw/net/e1000.c | 16 | --- a/net/tap.c |
25 | +++ b/hw/net/e1000.c | 17 | +++ b/net/tap.c |
26 | @@ -XXX,XX +XXX,XX @@ e1000_receive_iov(NetClientState *nc, const struct iovec *iov, int iovcnt) | 18 | @@ -XXX,XX +XXX,XX @@ int net_init_tap(const Netdev *netdev, const char *name, |
27 | if (size < sizeof(min_buf)) { | 19 | if (ret < 0) { |
28 | iov_to_buf(iov, iovcnt, 0, min_buf, size); | 20 | error_setg_errno(errp, -ret, "%s: Can't use file descriptor %d", |
29 | memset(&min_buf[size], 0, sizeof(min_buf) - size); | 21 | name, fd); |
30 | - e1000x_inc_reg_if_not_full(s->mac_reg, RUC); | 22 | + close(fd); |
31 | min_iov.iov_base = filter_buf = min_buf; | 23 | return -1; |
32 | min_iov.iov_len = size = sizeof(min_buf); | 24 | } |
33 | iovcnt = 1; | 25 | |
26 | @@ -XXX,XX +XXX,XX @@ int net_init_tap(const Netdev *netdev, const char *name, | ||
27 | vhostfdname, vnet_hdr, fd, &err); | ||
28 | if (err) { | ||
29 | error_propagate(errp, err); | ||
30 | + close(fd); | ||
31 | return -1; | ||
32 | } | ||
33 | } else if (tap->has_fds) { | ||
34 | -- | 34 | -- |
35 | 2.5.0 | 35 | 2.7.4 |
36 | 36 | ||
37 | 37 | diff view generated by jsdifflib |
1 | From: Stefano Garzarella <sgarzare@redhat.com> | 1 | From: Keqian Zhu <zhukeqian1@huawei.com> |
---|---|---|---|
2 | 2 | ||
3 | Reword and add a missing parentheses at the end of the | 3 | Fixes: 63c4db4c2e6d (net: relocate paths to helpers and scripts) |
4 | error message. | 4 | Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com> |
5 | |||
6 | Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> | ||
7 | Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> | ||
8 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
9 | Reviewed-by: Markus Armbruster <armbru@redhat.com> | ||
10 | Signed-off-by: Jason Wang <jasowang@redhat.com> | 5 | Signed-off-by: Jason Wang <jasowang@redhat.com> |
11 | --- | 6 | --- |
12 | net/slirp.c | 3 ++- | 7 | net/tap.c | 3 ++- |
13 | 1 file changed, 2 insertions(+), 1 deletion(-) | 8 | 1 file changed, 2 insertions(+), 1 deletion(-) |
14 | 9 | ||
15 | diff --git a/net/slirp.c b/net/slirp.c | 10 | diff --git a/net/tap.c b/net/tap.c |
16 | index XXXXXXX..XXXXXXX 100644 | 11 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/net/slirp.c | 12 | --- a/net/tap.c |
18 | +++ b/net/slirp.c | 13 | +++ b/net/tap.c |
19 | @@ -XXX,XX +XXX,XX @@ static int net_slirp_init(NetClientState *peer, const char *model, | 14 | @@ -XXX,XX +XXX,XX @@ free_fail: |
20 | } | 15 | script = default_script = get_relocated_path(DEFAULT_NETWORK_SCRIPT); |
21 | if (vprefix6_len < 0 || vprefix6_len > 126) { | 16 | } |
22 | error_setg(errp, | 17 | if (!downscript) { |
23 | - "Invalid prefix provided (prefix len must be in range 0-126"); | 18 | - downscript = default_downscript = get_relocated_path(DEFAULT_NETWORK_SCRIPT); |
24 | + "Invalid IPv6 prefix provided " | 19 | + downscript = default_downscript = |
25 | + "(IPv6 prefix length must be between 0 and 126)"); | 20 | + get_relocated_path(DEFAULT_NETWORK_DOWN_SCRIPT); |
26 | return -1; | 21 | } |
27 | } | 22 | |
28 | 23 | if (tap->has_ifname) { | |
29 | -- | 24 | -- |
30 | 2.5.0 | 25 | 2.7.4 |
31 | 26 | ||
32 | 27 | diff view generated by jsdifflib |