mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
vdpa: do not set virtio status bits if unneeded
Next commits will set DRIVER and ACKNOWLEDGE flags repeatedly in the case of a migration destination. Let's save ioctls with this. Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Message-Id: <20231215172830.2540987-2-eperezma@redhat.com>
This commit is contained in:
parent
410cefbd5c
commit
bc865bfe2d
1 changed files with 4 additions and 0 deletions
|
@ -511,6 +511,10 @@ static int vhost_vdpa_add_status(struct vhost_dev *dev, uint8_t status)
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
if ((s & status) == status) {
|
||||||
|
/* Don't set bits already set */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
s |= status;
|
s |= status;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue