Home
last modified time | relevance | path

Searched hist:"37352 df3" (Results 1 – 1 of 1) sorted by relevance

/qemu/hw/usb/
H A Dhcd-xhci.c3afca1d6 Tue Jul 22 15:26:41 GMT 2014 Laszlo Ersek <lersek@redhat.com> vmstate_xhci_event: fix unterminated field list

"vmstate_xhci_event" was introduced in commit 37352df3 ("xhci: add live
migration support"), and first released in v1.6.0. The field list in this
VMSD is not terminated with the VMSTATE_END_OF_LIST() macro.

During normal use (ie. migration), the issue is practically invisible,
because the "vmstate_xhci_event" object (with the unterminated field list)
is only ever referenced -- via "vmstate_xhci_intr" -- if xhci_er_full()
returns true, for the "ev_buffer" test. Since that field_exists() check
(apparently) almost always returns false, we almost never traverse
"vmstate_xhci_event" during migration, which hides the bug.

However, Amit's vmstate checker forces recursion into this VMSD as well,
and the lack of VMSTATE_END_OF_LIST() breaks the field list terminator
check (field->name != NULL) in dump_vmstate_vmsd(). The result is
undefined behavior, which in my case translates to infinite recursion
(because the loop happens to overflow into "vmstate_xhci_intr", which then
links back to "vmstate_xhci_event").

Add the missing terminator.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
37352df3 Thu Mar 21 09:55:35 GMT 2013 Gerd Hoffmann <kraxel@redhat.com> xhci: add live migration support

With all preparing pieces in place we can finally drop in
the vmstate structs and the postload function.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>