Skip to content

Commit

Permalink
[common] ivshmem: default to /dev/kvmfr0 if it's found
Browse files Browse the repository at this point in the history
  • Loading branch information
gnif committed Sep 5, 2024
1 parent 6a0a635 commit 4e8201d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion common/src/platform/linux/ivshmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ static StringList ivshmemDeviceGetValues(struct Option * option)

void ivshmemOptionsInit(void)
{
char * shmFile;
struct stat st;

// if there is a kvmfr device, default to using it instead
if (stat("/dev/kvmfr0", &st) == 0)
shmFile = "/dev/kvmfr0";
else
shmFile = "/dev/shm/looking-glass";

struct Option options[] =
{
{
Expand All @@ -94,7 +103,7 @@ void ivshmemOptionsInit(void)
.shortopt = 'f',
.description = "The path to the shared memory file, or the name of the kvmfr device to use, e.g. kvmfr0",
.type = OPTION_TYPE_STRING,
.value.x_string = "/dev/shm/looking-glass",
.value.x_string = shmFile,
.validator = ivshmemDeviceValidator,
.getValues = ivshmemDeviceGetValues
},
Expand Down

2 comments on commit 4e8201d

@Interpause
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi, while the upstream qemu bug (https://gitlab.com/qemu-project/qemu/-/issues/1877) between virtiofsd and kvmfr hasn't been resolved yet, maybe a warning on the documentation might be a good idea? virtiofsd is commonly used to share a folder between linux host and windows guest, so im guessing a lot of ppl might run into their folder shares not working without knowing why.

@gnif
Copy link
Owner Author

@gnif gnif commented on 4e8201d Sep 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you posting this here? Either create an issue and post the suggestion there, or better, join our discord (https://looking-glass.io/discord) where we can discuss this.

Please sign in to comment.