qemu: remove control vector save
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v2 1/2 fix segfault in msix_save
This fixes segfault reported by Kevin Wolf,
and simplifies the code in msix_save.
Reported-by Kevin Wolf <[email protected]>
Signed-off-by Michael S. Tsirkin <[email protected]>
--- hw/msix.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-)
hw/msix.c +7 -5
@@ -284,11 +284,13 @@ int msix_uninit(PCIDevice *dev)void msix_save (PCIDevice *dev,QEMUFile *f) { -unsigned nentries = (pci_get_word (dev->config +PCI_MSIX_FLAGS ) & -PCI_MSIX_FLAGS_QSIZE ) +1 ; -qemu_put_buffer (f, dev->msix_table_page, nentries *MSIX_ENTRY_SIZE ); -qemu_put_buffer (f, dev->msix_table_page +MSIX_PAGE_PENDING , - (nentries +7 ) /8 ); +unsigned n = dev->msix_entries_nr; + +if (!dev->cap_present &QEMU_PCI_CAP_MSIX ) +return ; + +qemu_put_buffer (f, dev->msix_table_page, n *MSIX_ENTRY_SIZE ); +qemu_put_buffer (f, dev->msix_table_page +MSIX_PAGE_PENDING , (n +7 ) /8 ); }/* Should be called after restoring the config space. */
Signature · 1 line
1.6.2.2
PATCH v2 2/2 qemu: remove control vector save
In reply to a message not in the archivecontrol vector is saved/restored by virtio-pci,
it does not belong in virtio.
Signed-off-by Michael S. Tsirkin <[email protected]>
--- hw/virtio.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
hw/virtio.c +0 -3
@@ -626,9 +626,6 @@ void virtio_save(VirtIODevice *vdev, QEMUFile *f)qemu_put_be32 (f, vdev->config_len);qemu_put_buffer (f, vdev->config, vdev->config_len); -if (vdev->nvectors) -qemu_put_be16s (f, &vdev->config_vector); -for (i =0 ; i <VIRTIO_PCI_QUEUE_MAX ; i++) {if (vdev->vq[i].vring.num ==0 )break ;
Signature · 1 line
1.6.2.2