qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC v3 7/8] vhost-vdpa: introduce vhost-vdpa backend


From: Michael S. Tsirkin
Subject: Re: [RFC v3 7/8] vhost-vdpa: introduce vhost-vdpa backend
Date: Thu, 4 Jun 2020 07:33:50 -0400

On Thu, Jun 04, 2020 at 12:39:34PM +0200, Eugenio Perez Martin wrote:
> > +static int vhost_vdpa_set_config(struct vhost_dev *dev, const uint8_t 
> > *data,
> > +                                   uint32_t offset, uint32_t size,
> > +                                   uint32_t flags)
> > +{
> > +    struct vhost_vdpa_config config;
> > +    int ret;
> > +    if ((size > VHOST_VDPA_MAX_CONFIG_SIZE) || (data == NULL)) {
> 
> VHOST_VDPA_MAX_CONFIG_SIZE is currently undefined.
> 
> If we want to maintain this as a stack allocation (as proposed in
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg701744.html) I
> think that the best option is to decide which is the maximum value buf
> can hold, and set it in vhost_vdpa_config.buf declaration.

That depends on device features. qemu has logic to figure out
config size based on that and set config_size accordingly.
Why not reuse it? Sending more should be ok and extra
data just ignored.

-- 
MST




reply via email to

[Prev in Thread] Current Thread [Next in Thread]