ACRN: DM: Fix the vsock Guest Cid overflow issue

The vsock cid type is u64, redefine the cid type to u64, and use
dm_strtoul API replace dm_strtoi.

Tracked-On: #7456
Signed-off-by: Liu Long <long.liu@linux.intel.com>
This commit is contained in:
Liu Long 2022-05-31 10:12:57 +08:00 committed by acrnsi-robot
parent 9ec81eb9e6
commit 32af0abe0a

View File

@ -238,7 +238,8 @@ static int
virtio_vhost_vsock_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
{
struct virtio_vsock *vsock;
int rc, cid;
int rc;
uint64_t cid;
pthread_mutexattr_t attr;
char *devopts = NULL;
char *tmp = NULL;
@ -254,7 +255,7 @@ virtio_vhost_vsock_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
}
if (!strncmp(tmp, "cid=", 4)) {
strsep(&tmp, "=");
dm_strtoi(tmp, NULL, 10, &cid);
dm_strtoul(tmp, NULL, 10, &cid);
}
free(devopts);