Revision 704a76fc
b/hw/s390-virtio-bus.c | ||
---|---|---|
251 | 251 |
if (vdev->set_features) { |
252 | 252 |
vdev->set_features(vdev, features); |
253 | 253 |
} |
254 |
vdev->features = features; |
|
254 |
vdev->guest_features = features;
|
|
255 | 255 |
} |
256 | 256 |
|
257 | 257 |
VirtIOS390Device *s390_virtio_bus_console(VirtIOS390Bus *bus) |
b/hw/syborg_virtio.c | ||
---|---|---|
90 | 90 |
ret |= vdev->binding->get_features(s); |
91 | 91 |
break; |
92 | 92 |
case SYBORG_VIRTIO_GUEST_FEATURES: |
93 |
ret = vdev->features; |
|
93 |
ret = vdev->guest_features;
|
|
94 | 94 |
break; |
95 | 95 |
case SYBORG_VIRTIO_QUEUE_BASE: |
96 | 96 |
ret = virtio_queue_get_addr(vdev, vdev->queue_sel); |
... | ... | |
132 | 132 |
case SYBORG_VIRTIO_GUEST_FEATURES: |
133 | 133 |
if (vdev->set_features) |
134 | 134 |
vdev->set_features(vdev, value); |
135 |
vdev->features = value; |
|
135 |
vdev->guest_features = value;
|
|
136 | 136 |
break; |
137 | 137 |
case SYBORG_VIRTIO_QUEUE_BASE: |
138 | 138 |
if (value == 0) |
b/hw/virtio-net.c | ||
---|---|---|
768 | 768 |
if (n->has_vnet_hdr) { |
769 | 769 |
tap_using_vnet_hdr(n->nic->nc.peer, 1); |
770 | 770 |
tap_set_offload(n->nic->nc.peer, |
771 |
(n->vdev.features >> VIRTIO_NET_F_GUEST_CSUM) & 1,
|
|
772 |
(n->vdev.features >> VIRTIO_NET_F_GUEST_TSO4) & 1,
|
|
773 |
(n->vdev.features >> VIRTIO_NET_F_GUEST_TSO6) & 1,
|
|
774 |
(n->vdev.features >> VIRTIO_NET_F_GUEST_ECN) & 1,
|
|
775 |
(n->vdev.features >> VIRTIO_NET_F_GUEST_UFO) & 1);
|
|
771 |
(n->vdev.guest_features >> VIRTIO_NET_F_GUEST_CSUM) & 1,
|
|
772 |
(n->vdev.guest_features >> VIRTIO_NET_F_GUEST_TSO4) & 1,
|
|
773 |
(n->vdev.guest_features >> VIRTIO_NET_F_GUEST_TSO6) & 1,
|
|
774 |
(n->vdev.guest_features >> VIRTIO_NET_F_GUEST_ECN) & 1,
|
|
775 |
(n->vdev.guest_features >> VIRTIO_NET_F_GUEST_UFO) & 1);
|
|
776 | 776 |
} |
777 | 777 |
} |
778 | 778 |
|
b/hw/virtio-pci.c | ||
---|---|---|
181 | 181 |
} |
182 | 182 |
if (vdev->set_features) |
183 | 183 |
vdev->set_features(vdev, val); |
184 |
vdev->features = val; |
|
184 |
vdev->guest_features = val;
|
|
185 | 185 |
break; |
186 | 186 |
case VIRTIO_PCI_QUEUE_PFN: |
187 | 187 |
pa = (target_phys_addr_t)val << VIRTIO_PCI_QUEUE_ADDR_SHIFT; |
... | ... | |
239 | 239 |
ret |= vdev->binding->get_features(proxy); |
240 | 240 |
break; |
241 | 241 |
case VIRTIO_PCI_GUEST_FEATURES: |
242 |
ret = vdev->features; |
|
242 |
ret = vdev->guest_features;
|
|
243 | 243 |
break; |
244 | 244 |
case VIRTIO_PCI_QUEUE_PFN: |
245 | 245 |
ret = virtio_queue_get_addr(vdev, vdev->queue_sel) |
b/hw/virtio.c | ||
---|---|---|
445 | 445 |
if (vdev->reset) |
446 | 446 |
vdev->reset(vdev); |
447 | 447 |
|
448 |
vdev->features = 0; |
|
448 |
vdev->guest_features = 0;
|
|
449 | 449 |
vdev->queue_sel = 0; |
450 | 450 |
vdev->status = 0; |
451 | 451 |
vdev->isr = 0; |
... | ... | |
598 | 598 |
{ |
599 | 599 |
/* Always notify when queue is empty (when feature acknowledge) */ |
600 | 600 |
if ((vring_avail_flags(vq) & VRING_AVAIL_F_NO_INTERRUPT) && |
601 |
(!(vdev->features & (1 << VIRTIO_F_NOTIFY_ON_EMPTY)) || |
|
601 |
(!(vdev->guest_features & (1 << VIRTIO_F_NOTIFY_ON_EMPTY)) ||
|
|
602 | 602 |
(vq->inuse || vring_avail_idx(vq) != vq->last_avail_idx))) |
603 | 603 |
return; |
604 | 604 |
|
... | ... | |
625 | 625 |
qemu_put_8s(f, &vdev->status); |
626 | 626 |
qemu_put_8s(f, &vdev->isr); |
627 | 627 |
qemu_put_be16s(f, &vdev->queue_sel); |
628 |
qemu_put_be32s(f, &vdev->features); |
|
628 |
qemu_put_be32s(f, &vdev->guest_features);
|
|
629 | 629 |
qemu_put_be32(f, vdev->config_len); |
630 | 630 |
qemu_put_buffer(f, vdev->config, vdev->config_len); |
631 | 631 |
|
... | ... | |
670 | 670 |
features, supported_features); |
671 | 671 |
return -1; |
672 | 672 |
} |
673 |
vdev->features = features; |
|
673 |
vdev->guest_features = features;
|
|
674 | 674 |
vdev->config_len = qemu_get_be32(f); |
675 | 675 |
qemu_get_buffer(f, vdev->config, vdev->config_len); |
676 | 676 |
|
b/hw/virtio.h | ||
---|---|---|
100 | 100 |
uint8_t status; |
101 | 101 |
uint8_t isr; |
102 | 102 |
uint16_t queue_sel; |
103 |
uint32_t features; |
|
103 |
uint32_t guest_features;
|
|
104 | 104 |
size_t config_len; |
105 | 105 |
void *config; |
106 | 106 |
uint16_t config_vector; |
Also available in: Unified diff