@@ -469,6 +469,12 @@ static int vhost_user_get_u64(struct vhost_dev *dev, int request, uint64_t *u64)
return 0;
}
+ if (request == VHOST_USER_GET_FEATURES) {
+ vhost_user_features_init(u64);
+ return 0;
+ }
+
if (vhost_user_write(dev, &msg, NULL, 0) < 0) {
So, I guess the crash problem has relations with vhost user feature. Then
I tried a lot to find which features and finally I found following patch can
fix crash problem:
@@ -455,7 +455,8 @@ static int vhost_user_set_protocol_features(struct vhost_dev *dev,
static void vhost_user_features_init(void *arg)
{
#define VIRTIO_NET_F_MRG_RXBUF 15 /* Host can merge receive buffers. */
- *((__u64 *) arg) = ((1ULL << VIRTIO_NET_F_MRG_RXBUF) | (1ULL << VHOST_F_LOG_ALL));
+ *((__u64 *) arg) = ((1ULL << VIRTIO_NET_F_MRG_RXBUF) | (1ULL << VHOST_F_LOG_ALL)
+ |(1ULL << VHOST_USER_F_PROTOCOL_FEATURES));
}
static int vhost_user_get_u64(struct vhost_dev *dev, int request, uint64_t *u64)
@@ -469,6 +470,7 @@ static int vhost_user_get_u64(struct vhost_dev *dev, int request, uint64_t *u64)
if (vhost_user_write(dev, &msg, NULL, 0) < 0) {
+ if (request == VHOST_USER_GET_FEATURES) {
+ vhost_user_features_init(u64);
+ }
return 0;
}
Merely, I could not figure out why VHOST_USER_F_PROTOCOL_FEATURES feature could led to
crash. Hoping above information can help you to tell me the reason.