diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2013-06-03 14:17:19 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2013-07-04 17:42:30 +0200 |
commit | f487b677c2dc15786dbe7c61326cc49e7c64daea (patch) | |
tree | fedfbfc9a8476c8d76b8723a22e6dc0e4430bda3 /include | |
parent | cac3c384bb986f06a308e551641284586924813c (diff) |
dma: keep a device alive while it has SGLists
Reviewed-by: Anthony Liguori <aliguori@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/pci/pci.h | 2 | ||||
-rw-r--r-- | include/sysemu/dma.h | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 6ef1f97393..de406d690b 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -702,7 +702,7 @@ static inline void pci_dma_unmap(PCIDevice *dev, void *buffer, dma_addr_t len, static inline void pci_dma_sglist_init(QEMUSGList *qsg, PCIDevice *dev, int alloc_hint) { - qemu_sglist_init(qsg, alloc_hint, pci_get_address_space(dev)); + qemu_sglist_init(qsg, DEVICE(dev), alloc_hint, pci_get_address_space(dev)); } extern const VMStateDescription vmstate_pci_device; diff --git a/include/sysemu/dma.h b/include/sysemu/dma.h index 031d1f5fb3..00f21f3da2 100644 --- a/include/sysemu/dma.h +++ b/include/sysemu/dma.h @@ -29,6 +29,7 @@ struct QEMUSGList { int nsg; int nalloc; size_t size; + DeviceState *dev; AddressSpace *as; }; @@ -189,7 +190,8 @@ struct ScatterGatherEntry { dma_addr_t len; }; -void qemu_sglist_init(QEMUSGList *qsg, int alloc_hint, AddressSpace *as); +void qemu_sglist_init(QEMUSGList *qsg, DeviceState *dev, int alloc_hint, + AddressSpace *as); void qemu_sglist_add(QEMUSGList *qsg, dma_addr_t base, dma_addr_t len); void qemu_sglist_destroy(QEMUSGList *qsg); #endif |