qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

Fixed integer overflow in e1000e

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1737400
Fixed setting max_queue_num if there are no peers in
NICConf. qemu_new_nic() creates NICState with 1 NetClientState(index
0) without peers, set max_queue_num to 0 - It prevents undefined
behavior and possible crashes, especially during pcie hotplug.

Fixes: 6f3fbe4ed06 ("net: Introduce e1000e device emulation")
Signed-off-by: Andrew Melnychenko <andrew@daynix.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Dmitry Fleytman <dmitry.fleytman@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>

authored by

Andrew Melnychenko and committed by
Jason Wang
f22a57ac a43790f2

+1 -1
+1 -1
hw/net/e1000e.c
··· 328 328 s->nic = qemu_new_nic(&net_e1000e_info, &s->conf, 329 329 object_get_typename(OBJECT(s)), dev->id, s); 330 330 331 - s->core.max_queue_num = s->conf.peers.queues - 1; 331 + s->core.max_queue_num = s->conf.peers.queues ? s->conf.peers.queues - 1 : 0; 332 332 333 333 trace_e1000e_mac_set_permanent(MAC_ARG(macaddr)); 334 334 memcpy(s->core.permanent_mac, macaddr, sizeof(s->core.permanent_mac));