mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
dma: keep a device alive while it has SGLists
Reviewed-by: Anthony Liguori <aliguori@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user