Skip to content

Commit

Permalink
ref(core/remio): reanmed io_device to dev
Browse files Browse the repository at this point in the history
Signed-off-by: João Peixoto <[email protected]>
  • Loading branch information
joaopeixoto13 committed Sep 21, 2024
1 parent f6b868d commit 0c544f9
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/core/remio.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,9 @@ static size_t remio_get_request_event_count(struct remio_device* device)
static struct remio_device* remio_find_dev_by_id(remio_id_t id)
{
struct remio_device* device = NULL;
list_foreach (remio_device_list, struct remio_device, io_device) {
if (id == io_device->id) {
device = io_device;
list_foreach (remio_device_list, struct remio_device, dev) {
if (id == dev->id) {
device = dev;
break;
}
}
Expand Down Expand Up @@ -460,8 +460,7 @@ void remio_init(void)
device->config.frontend.vm_id = vm_id;
device->config.frontend.interrupt = dev->interrupt;
device->config.frontend.cpu_id = (cpuid_t)-1;
}
else {
} else {
ERROR("Unknown Remote I/O device type");
}
}
Expand All @@ -477,11 +476,11 @@ void remio_init(void)

void remio_assign_vm_cpus(struct vm* vm)
{
list_foreach (remio_device_list, struct remio_device, io_device) {
if (vm->id == io_device->config.backend.vm_id) {
io_device->config.backend.cpu_id = min(io_device->config.backend.cpu_id, cpu()->id);
} else if (vm->id == io_device->config.frontend.vm_id) {
io_device->config.frontend.cpu_id = min(io_device->config.frontend.cpu_id, cpu()->id);
list_foreach (remio_device_list, struct remio_device, dev) {
if (vm->id == dev->config.backend.vm_id) {
dev->config.backend.cpu_id = min(dev->config.backend.cpu_id, cpu()->id);
} else if (vm->id == dev->config.frontend.vm_id) {
dev->config.frontend.cpu_id = min(dev->config.frontend.cpu_id, cpu()->id);
}
}
}
Expand Down

0 comments on commit 0c544f9

Please sign in to comment.