[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH RFC v2 14/16] vfio-user: dma read/write operations
From: |
John Levon |
Subject: |
Re: [PATCH RFC v2 14/16] vfio-user: dma read/write operations |
Date: |
Wed, 8 Sep 2021 11:03:10 +0000 |
On Wed, Sep 08, 2021 at 10:51:11AM +0100, Stefan Hajnoczi wrote:
> > +
> > + buf = g_malloc0(size);
> > + memcpy(buf, msg, sizeof(*msg));
> > +
> > + pci_dma_read(pdev, msg->offset, buf + sizeof(*msg), msg->count);
>
> The vfio-user spec doesn't go into errors but pci_dma_read() can return
> errors. Hmm...
It's certainly under-specified in the spec, but in terms of the library, we do
return EINVAL if we decide something invalid happened...
regards
john