Page MenuHomeFreeBSD

bhyve: Defer virtio-console PORT_NAME until the guest is ready
AcceptedPublic

Authored by hayzam_gmail.com on Sat, Sep 19, 5:53 PM.
Tags
None
Referenced Files
F173613024: D59847.id187242.diff
Sun, Sep 27, 4:45 AM
F173601970: D59847.id187423.diff
Sun, Sep 27, 3:01 AM
F173597717: D59847.diff
Sun, Sep 27, 2:20 AM
Unknown Object (File)
Sat, Sep 26, 5:17 PM
Unknown Object (File)
Fri, Sep 25, 6:57 PM
Unknown Object (File)
Fri, Sep 25, 7:29 AM
Unknown Object (File)
Fri, Sep 25, 6:46 AM
Unknown Object (File)
Thu, Sep 24, 11:30 PM
Subscribers

Details

Reviewers
markj
Group Reviewers
bhyve
Summary

pci_vtcon_announce_port() sends VIRTIO_CONSOLE_PORT_NAME immediately
after VIRTIO_CONSOLE_DEVICE_ADD, without waiting for the guest to
initialize the port. The Windows virtio-serial driver ignores the
name if the port is not yet available, which can prevent the QEMU
guest agent from finding org.qemu.guest_agent.0.

Send the name after the guest reports successful port initialization
with VIRTIO_CONSOLE_PORT_READY, as QEMU does.

While here, validate the guest-supplied port ID before forming a
pointer into vsc_ports[].

This ports the PORT_NAME ordering fix from illumos change 18082.

Obtained from: illumos 643ee887be44404b690eeaff14f20a27ad3c715c

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 77096
Build 73979: arc lint + arc unit

Event Timeline

usr.sbin/bhyve/pci_virtio_console.c
530

How is it possible to have tmp->vsp_name == NULL?

usr.sbin/bhyve/pci_virtio_console.c
530

Ah it can't be NULL here since name= is mandatory for a virtio-console port, I'll drop the check. It came in verbatim with the illumos change, which mirrors QEMU, where port names really seem to be optional.

This revision is now accepted and ready to land.Tue, Sep 22, 2:40 PM