if (!(dev->status & VIRTIO_CONFIG_STATUS_FEATURES_OK) ||
(!(dev->protocol_features &
(1ULL << VHOST_USER_PROTOCOL_F_STATUS))))
- return 0;
+ return -ENOTSUP;
/* Fallthrough */
case VHOST_USER_GET_FEATURES:
case VHOST_USER_GET_PROTOCOL_FEATURES:
if (!(dev->status & VIRTIO_CONFIG_STATUS_FEATURES_OK) ||
(!(dev->protocol_features &
(1ULL << VHOST_USER_PROTOCOL_F_STATUS))))
- return 0;
+ return -ENOTSUP;
if (has_reply_ack)
msg.flags |= VHOST_USER_NEED_REPLY_MASK;
ret = dev->ops->send_request(dev,
VHOST_USER_SET_STATUS, &status);
else
- return 0;
+ ret = -ENOTSUP;
- if (ret) {
+ if (ret && ret != -ENOTSUP) {
PMD_INIT_LOG(ERR, "VHOST_USER_SET_STATUS failed (%d): %s", ret,
strerror(errno));
- return -1;
}
-
- return 0;
+ return ret;
}
int
err = dev->ops->send_request(dev, VHOST_USER_GET_STATUS,
&status);
} else {
- return 0;
- }
-
- if (err) {
- PMD_INIT_LOG(ERR, "VHOST_USER_GET_STATUS failed (%d): %s", err,
- strerror(errno));
- return -1;
+ err = -ENOTSUP;
}
- dev->status = status;
- PMD_INIT_LOG(DEBUG, "Updated Device Status(0x%08x):\n"
+ if (!err) {
+ dev->status = status;
+ PMD_INIT_LOG(DEBUG, "Updated Device Status(0x%08x):\n"
"\t-RESET: %u\n"
"\t-ACKNOWLEDGE: %u\n"
"\t-DRIVER: %u\n"
!!(dev->status & VIRTIO_CONFIG_STATUS_FEATURES_OK),
!!(dev->status & VIRTIO_CONFIG_STATUS_DEV_NEED_RESET),
!!(dev->status & VIRTIO_CONFIG_STATUS_FAILED));
- return 0;
+ } else if (err != -ENOTSUP) {
+ PMD_INIT_LOG(ERR, "VHOST_USER_GET_STATUS failed (%d): %s", err,
+ strerror(errno));
+ }
+
+ return err;
}