The previous definitions does not cover config space read/write
and only cover general message as below:
A vhost-user message consists of 3 header fields and a payload.
+---------+-------+------+---------+
| request | flags | size | payload |
+---------+-------+------+---------+
but for config space, the payload include:
Virtio device config space
^^^^^^^^^^^^^^^^^^^^^^^^^^
+--------+------+-------+---------+
| offset | size | flags | payload |
+--------+------+-------+---------+
:offset: a 32-bit offset of virtio device's configuration space
:size: a 32-bit configuration space access size in bytes
🎏 a 32-bit value:
- 0: Vhost master messages used for writeable fields
- 1: Vhost master messages used for live migration
:payload: Size bytes array holding the contents of the virtio
device's configuration space
This patch add specific functions for config message, which can
get/set config space from/to backend.
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
There is one definition in message.rs file as below:
pub const VHOST_USER_CONFIG_OFFSET: u32 = 0x100
This definition is only for virtio mmio config space
and we will add this offset in virtio-mmio side and
not vhost user protocl side.
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
Use acked_protocol_features to replace acked_virtio_features in
get_config()/set_config() for protocol features like CONFIG.
This patch also fix wrong GET_CONFIG setting for set_config().
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
The latest vhost user spec only define two members in
VhostSetConfigType, master and live migration. These
changes can make rust-vmm compatible with vhost user backend.
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
The recvmsg syscall can split a request in multiple packets unless we
use the flag MSG_WAITALL to make sure the request will wait for the
whole data to be transferred before returning.
This flag is needed to prevent the vhost crate from returning the error
PartialMessage, which occured sporadically when using virtio-fs, and
which was detected as part of our continuous integration testing.
Fixes#182
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
No matter if the communication is coming from the master or the slave,
it should always reply with an ack if the message header specifies that
it expects a reply.
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
The structure of the vmm-sys-util crate has changed with lots of code
moving to submodules.
This change adjusts the use of the imported structs to reference the
submodules.
Fixes: #145
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
Update all dependencies with "cargo upgrade" with the exception of
vmm-sys-utils which needs some extra porting work.
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
In order to avoid cloud-hypervisor to rely on a pending PR for the empty
crate "vhost", this commit temporarily copies the content of the crate
based on branch jiangliu/v1 18b5081d9199c76eca49da1971c9d1a65e53e5ff.
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>