mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
vhost: use a function for each call
Replace the generic vhost_call() by specific functions for each function call to help with type safety and changing arguments. While doing this, I found that "unsigned long long" and "uint64_t" were used interchangeably and causing compilation warnings, using uint64_t instead, as the vhost & protocol specifies. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> [Fix enum usage and MQ - Thibaut Collet] Signed-off-by: Thibaut Collet <thibaut.collet@6wind.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Thibaut Collet <thibaut.collet@6wind.com>
This commit is contained in:
parent
d2fc4402cb
commit
21e704256d
7 changed files with 511 additions and 281 deletions
|
@ -46,7 +46,7 @@ static int vhost_scsi_set_endpoint(VHostSCSI *s)
|
|||
|
||||
memset(&backend, 0, sizeof(backend));
|
||||
pstrcpy(backend.vhost_wwpn, sizeof(backend.vhost_wwpn), vs->conf.wwpn);
|
||||
ret = vhost_ops->vhost_call(&s->dev, VHOST_SCSI_SET_ENDPOINT, &backend);
|
||||
ret = vhost_ops->vhost_scsi_set_endpoint(&s->dev, &backend);
|
||||
if (ret < 0) {
|
||||
return -errno;
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ static void vhost_scsi_clear_endpoint(VHostSCSI *s)
|
|||
|
||||
memset(&backend, 0, sizeof(backend));
|
||||
pstrcpy(backend.vhost_wwpn, sizeof(backend.vhost_wwpn), vs->conf.wwpn);
|
||||
vhost_ops->vhost_call(&s->dev, VHOST_SCSI_CLEAR_ENDPOINT, &backend);
|
||||
vhost_ops->vhost_scsi_clear_endpoint(&s->dev, &backend);
|
||||
}
|
||||
|
||||
static int vhost_scsi_start(VHostSCSI *s)
|
||||
|
@ -77,8 +77,7 @@ static int vhost_scsi_start(VHostSCSI *s)
|
|||
return -ENOSYS;
|
||||
}
|
||||
|
||||
ret = vhost_ops->vhost_call(&s->dev,
|
||||
VHOST_SCSI_GET_ABI_VERSION, &abi_version);
|
||||
ret = vhost_ops->vhost_scsi_get_abi_version(&s->dev, &abi_version);
|
||||
if (ret < 0) {
|
||||
return -errno;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue