vhost: add hint on how to add or remove device to a data core
Let's make sure people will not forget to set and unset VIRTIO_DEV_RUNNING. Signed-off-by: Benoît Canet <benoit.canet@nodalink.com> Acked-by: Huawei Xie <huawei.xie@intel.com>
This commit is contained in:
parent
01fa1d6215
commit
45db8927a8
@ -58,7 +58,8 @@ Vhost API Overview
|
||||
register two callbacks, new_destory and destroy_device.
|
||||
When virtio device is activated or deactivated by guest virtual machine,
|
||||
the callback will be called, then vSwitch could put the device onto data
|
||||
core or remove the device from data core.
|
||||
core or remove the device from data core by setting or unsetting
|
||||
VIRTIO_DEV_RUNNING on the device flags.
|
||||
|
||||
* Read/write packets from/to guest virtual machine
|
||||
|
||||
|
@ -130,6 +130,10 @@ struct virtio_memory {
|
||||
|
||||
/**
|
||||
* Device operations to add/remove device.
|
||||
*
|
||||
* Make sure to set VIRTIO_DEV_RUNNING to the device flags in new_device and
|
||||
* remove it in destroy_device.
|
||||
*
|
||||
*/
|
||||
struct virtio_net_device_ops {
|
||||
int (*new_device)(struct virtio_net *); /**< Add device. */
|
||||
|
Loading…
Reference in New Issue
Block a user