mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
libvhost-user: Fix assignment in vring_set_avail_event
Since it was proposed to change the code in libvduse.c to use memcpy instead of an assignment, the code in libvhost-user.c should also be changed to use memcpy. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <502b22723264db064e4b05008233a9c1f2f8aaaa.1671741278.git.marcel@holtmann.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
86e61e4233
commit
950a2f2eff
1 changed files with 2 additions and 3 deletions
|
@ -2478,14 +2478,13 @@ vring_used_flags_unset_bit(VuVirtq *vq, int mask)
|
|||
static inline void
|
||||
vring_set_avail_event(VuVirtq *vq, uint16_t val)
|
||||
{
|
||||
uint16_t *avail;
|
||||
uint16_t val_le = htole16(val);
|
||||
|
||||
if (!vq->notification) {
|
||||
return;
|
||||
}
|
||||
|
||||
avail = (uint16_t *)&vq->vring.used->ring[vq->vring.num];
|
||||
*avail = htole16(val);
|
||||
memcpy(&vq->vring.used->ring[vq->vring.num], &val_le, sizeof(uint16_t));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue