On Tue, Dec 05, 2017 at 11:33:13AM +0800, Wei Wang wrote: > The vhost-pci slave implementation is added to support the creation of > the vhost-pci-net device. It follows the vhost-user protocol to get the > master VM's info (e.g. memory regions, vring address). How does the guest know when the QEMU vhost-user slave has finished initializing everything? It seems like a guest driver could access the device before things are initialized. How will reconnection work? > +static int vp_slave_get_features(VhostPCINet *vpnet, CharBackend *chr_be, > + VhostUserMsg *msg) > +{ > + /* Offer the initial features, which have the protocol feature bit set */ > + msg->payload.u64 = (uint64_t)vpnet->host_features | > + (1 << VHOST_USER_F_PROTOCOL_FEATURES); How can the vhost-user slave inside the guest participate in feature negotiation? It must be able to participate, otherwise slaves cannot disable features that QEMU supports but they don't want to support. It's not feasible to pass in host_features as a QEMU parameter because that would require libvirt, OpenStack, cloud providers, etc to add support so users can manually set the bits for their slave implementation. > +static int vp_slave_get_queue_num(CharBackend *chr_be, VhostUserMsg *msg) > +{ > + msg->payload.u64 = VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX; The guest cannot limit the number of virtqueues?