Skip to content

Commit

Permalink
this api change is killing me
Browse files Browse the repository at this point in the history
  • Loading branch information
voutilad committed Dec 5, 2024
1 parent 1dc7e00 commit f56985f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
8 changes: 4 additions & 4 deletions virtio_pci_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,18 @@ int vp_find_vqs(struct virtio_device *, unsigned nvqs,
{
return 0;
}
#elif LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0) && LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
int vp_find_vqs(struct virtio_device *vdev, unsigned int nvqs,
struct virtqueue *vqs[], vq_callback_t *callbacks[],
const char * const names[], const bool *ctx,
struct irq_affinity *desc)
{
return 0;
}
#else /* 6.11 changed the API...grrrrr. */
#elif LINUX_VERSION_CODE >= KERNEL_VERSION (6,11,0)
/* 6.11 changed the API...grrrrr. */
int vp_find_vqs(struct virtio_device *vdev, unsigned int nvqs,
struct virtqueue *vqs[],
struct virtqueue_info vqs_info[],
struct virtqueue *vqs[], struct virtqueue_info vqs_info[],
struct irq_affinity *desc)
{
return 0;
Expand Down
10 changes: 8 additions & 2 deletions virtio_pci_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,17 @@ int vp_find_vqs(struct virtio_device *vdev, unsigned nvqs,
int vp_find_vqs(struct virtio_device *, unsigned nvqs,
struct virtqueue *vqs[], vq_callback_t *callbacks[],
const char * const names[], struct irq_affinity *desc);
#else
int vp_find_vqs(struct virtio_device *, unsigned nvqs,
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0) && LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
int vp_find_vqs(struct virtio_device *, unsigned int nvqs,
struct virtqueue *vqs[], vq_callback_t *callbacks[],
const char * const names[], const bool *ctx,
struct irq_affinity *desc);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(6,11,0)
int vp_find_vqs(struct virtio_device *, unsigned int,
struct virtqueue *[], struct virtqueue_info [],
struct irq_affinity *);
#else
#error missing kernel version check
#endif

const char *vp_bus_name(struct virtio_device *vdev);
Expand Down

0 comments on commit f56985f

Please sign in to comment.