Skip to content

Commit

Permalink
Rump libvirtio_ld: fix double-definition of struct cfdriver ld_cd
Browse files Browse the repository at this point in the history
When libvirtio_ld builds as module, it compiles in `ld_cd` twice.
Prevent CFDRIVER_DECL from redefining it in ld_at_virtio.c when
including ioconf.c, and keep the definition in sys/dev.ld.c.
  • Loading branch information
sundbry committed Sep 10, 2021
1 parent 201a0ea commit 9cb5c5e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sys/rump/dev/lib/libvirtio_ld/ld_at_virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,15 @@ __KERNEL_RCSID(0, "$NetBSD: ld_at_virtio.c,v 1.4 2017/05/10 06:22:15 sevan Exp $
#include <rump-sys/kern.h>
#include <rump-sys/vfs.h>

#ifdef _MODULE
/*
* XXX Don't allow ioconf.c to redefine the "struct cfdriver ld_cd"
* XXX it will be defined in the common-code module
*/
#undef CFDRIVER_DECL
#define CFDRIVER_DECL(name, class, attr)
#include "ioconf.c"
#endif

RUMP_COMPONENT(RUMP_COMPONENT_DEV)
{
Expand Down

0 comments on commit 9cb5c5e

Please sign in to comment.