[Bug 236922] Virtio fails as QEMU-KVM guest with Q35 chipset on Ubuntu 18.04.2 LTS

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Jan 9 01:07:05 UTC 2020


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236922

--- Comment #22 from Tommy P <tommyhp2 at gmail.com> ---
(In reply to Bryan Venteicher from comment #13)

Hi Bryan,

I tried the method you've suggested to use the modules/virtio and dev/virtio
from your repo on 12.0-RELEASE-p12 r356482 and encountered the following
issues:

1) /usr/src/sys/dev/virtio/random/virtio_random.c:241:6: error: too many
arguments to function call, expected 3, have 4
            RANDOM_PURE_VIRTIO);
            ^~~~~~~~~~~~~~~~~~
I changed it from:
    random_harvest_queue(&value, sizeof(value), sizeof(value) * NBBY / 2,
          RANDOM_PURE_VIRTIO);
to:
    random_harvest_queue(&value, sizeof(value), RANDOM_PURE_VIRTIO);

2) /usr/src/sys/dev/virtio/pci/virtio_pci.c:54:10: fatal error:
'virtio_pci_if.h' file not found

I used sys/tools/makeobjops.awk to generate the missing virtio_pci_if.h from
virtio_pci_if.m

3) A lot of "ld: error: undefined symbol"
--- kernel ---
linking kernel
ld: error: undefined symbol: virtio_pci_disable_vq_desc
>>> referenced by virtio_pci.c
>>>               virtio_pci.o:(vtpci_release_child_resources)

They appear to all from virtio_pci_if.h 's "extern struct kobjop_desc "

---------------------------------------------------------
I also compared the compile object files between your repo and the src r356482.
 I think there are some missing (virtio_pci_if, virtio_pci_legacy,
virtio_pci_modern):

root at d-build-fbsd12:/usr/obj # ll usr/src_virtio/amd64.amd64/sys/Custom/virt*
-rw-r--r--  1 root  wheel  11312 Jan  8 06:11
usr/src_virtio/amd64.amd64/sys/Custom/virtio.o
-rw-r--r--  1 root  wheel  12480 Jan  8 06:11
usr/src_virtio/amd64.amd64/sys/Custom/virtio_balloon.o
-rw-r--r--  1 root  wheel  24608 Jan  8 06:11
usr/src_virtio/amd64.amd64/sys/Custom/virtio_blk.o
-rw-r--r--  1 root  wheel   2232 Jan  8 06:11
usr/src_virtio/amd64.amd64/sys/Custom/virtio_bus_if.c
-rw-r--r--  1 root  wheel   7531 Jan  8 06:09
usr/src_virtio/amd64.amd64/sys/Custom/virtio_bus_if.h
-rw-r--r--  1 root  wheel   2720 Jan  8 06:11
usr/src_virtio/amd64.amd64/sys/Custom/virtio_bus_if.o
-rw-r--r--  1 root  wheel    797 Jan  8 06:11
usr/src_virtio/amd64.amd64/sys/Custom/virtio_if.c
-rw-r--r--  1 root  wheel   1226 Jan  8 06:09
usr/src_virtio/amd64.amd64/sys/Custom/virtio_if.h
-rw-r--r--  1 root  wheel   1272 Jan  8 06:11
usr/src_virtio/amd64.amd64/sys/Custom/virtio_if.o
-rw-r--r--  1 root  wheel  17632 Jan  8 06:11
usr/src_virtio/amd64.amd64/sys/Custom/virtio_pci.o
-rw-r--r--  1 root  wheel   1283 Jan  8 06:11
usr/src_virtio/amd64.amd64/sys/Custom/virtio_pci_if.c
-rw-r--r--  1 root  wheel   4088 Jan  8 06:09
usr/src_virtio/amd64.amd64/sys/Custom/virtio_pci_if.h
-rw-r--r--  1 root  wheel   1792 Jan  8 06:11
usr/src_virtio/amd64.amd64/sys/Custom/virtio_pci_if.o
-rw-r--r--  1 root  wheel  15312 Jan  8 06:11
usr/src_virtio/amd64.amd64/sys/Custom/virtio_pci_legacy.o
-rw-r--r--  1 root  wheel  26664 Jan  8 06:11
usr/src_virtio/amd64.amd64/sys/Custom/virtio_pci_modern.o
-rw-r--r--  1 root  wheel  41248 Jan  8 06:11
usr/src_virtio/amd64.amd64/sys/Custom/virtio_scsi.o
-rw-r--r--  1 root  wheel   8904 Jan  8 06:11
usr/src_virtio/amd64.amd64/sys/Custom/virtqueue.o
root at d-build-fbsd12:/usr/obj # ll usr/src12.0/amd64.amd64/sys/Custom/virt*
-rw-r--r--  1 root  wheel  11312 Jan  8 14:34
usr/src12.0/amd64.amd64/sys/Custom/virtio.o
-rw-r--r--  1 root  wheel  12480 Jan  8 14:34
usr/src12.0/amd64.amd64/sys/Custom/virtio_balloon.o
-rw-r--r--  1 root  wheel  24608 Jan  8 14:34
usr/src12.0/amd64.amd64/sys/Custom/virtio_blk.o
-rw-r--r--  1 root  wheel   2229 Jan  8 14:34
usr/src12.0/amd64.amd64/sys/Custom/virtio_bus_if.c
-rw-r--r--  1 root  wheel   7528 Jan  8 14:33
usr/src12.0/amd64.amd64/sys/Custom/virtio_bus_if.h
-rw-r--r--  1 root  wheel   2720 Jan  8 14:34
usr/src12.0/amd64.amd64/sys/Custom/virtio_bus_if.o
-rw-r--r--  1 root  wheel    794 Jan  8 14:34
usr/src12.0/amd64.amd64/sys/Custom/virtio_if.c
-rw-r--r--  1 root  wheel   1223 Jan  8 14:33
usr/src12.0/amd64.amd64/sys/Custom/virtio_if.h
-rw-r--r--  1 root  wheel   1272 Jan  8 14:34
usr/src12.0/amd64.amd64/sys/Custom/virtio_if.o
-rw-r--r--  1 root  wheel  17632 Jan  8 14:34
usr/src12.0/amd64.amd64/sys/Custom/virtio_pci.o
-rw-r--r--  1 root  wheel  41248 Jan  8 14:34
usr/src12.0/amd64.amd64/sys/Custom/virtio_scsi.o
-rw-r--r--  1 root  wheel   8904 Jan  8 14:34
usr/src12.0/amd64.amd64/sys/Custom/virtqueue.o

The module's virtio/pci/Makefile does include those source files but they
didn't appear to be compiled:

pci/Makefile:25:
pci/Makefile:26:.PATH: ${SRCTOP}/sys/dev/virtio/pci
pci/Makefile:27:
pci/Makefile:28:KMOD=   virtio_pci
pci/Makefile:29:SRCS=   virtio_pci.c virtio_pci_legacy.c virtio_pci_modern.c
pci/Makefile:30:SRCS+=  virtio_pci_if.c virtio_pci_if.h
pci/Makefile:31:SRCS+=  virtio_bus_if.h virtio_if.h
pci/Makefile:32:SRCS+=  bus_if.h device_if.h pci_if.h
pci/Makefile:33:
pci/Makefile:34:.include <bsd.kmod.mk>



Do you have any suggestion to resolve #3 in order to proceed?  Thanks.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-virtualization mailing list