 46ce017167
			
		
	
	
		46ce017167
		
	
	
	
	
		
			
			virtio-vsock features, like VIRTIO_VSOCK_F_SEQPACKET, can be handled by vhost-vsock-common parent class. In this way, we can reuse the same code for all virtio-vsock backends (i.e. vhost-vsock, vhost-user-vsock). Let's move `seqpacket` property to vhost-vsock-common class, add vhost_vsock_common_get_features() used by children, and disable `seqpacket` for vhost-user-vsock device for machine types < 6.2. The behavior of vhost-vsock device doesn't change; vhost-user-vsock device now supports `seqpacket` property. Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Message-Id: <20210921161642.206461-3-sgarzare@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
		
			
				
	
	
		
			37 lines
		
	
	
		
			744 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			37 lines
		
	
	
		
			744 B
		
	
	
	
		
			C
		
	
	
	
	
	
| /*
 | |
|  * Vhost vsock virtio device
 | |
|  *
 | |
|  * Copyright 2015 Red Hat, Inc.
 | |
|  *
 | |
|  * Authors:
 | |
|  *  Stefan Hajnoczi <stefanha@redhat.com>
 | |
|  *
 | |
|  * This work is licensed under the terms of the GNU GPL, version 2 or
 | |
|  * (at your option) any later version.  See the COPYING file in the
 | |
|  * top-level directory.
 | |
|  */
 | |
| 
 | |
| #ifndef QEMU_VHOST_VSOCK_H
 | |
| #define QEMU_VHOST_VSOCK_H
 | |
| 
 | |
| #include "hw/virtio/vhost-vsock-common.h"
 | |
| #include "qom/object.h"
 | |
| 
 | |
| #define TYPE_VHOST_VSOCK "vhost-vsock-device"
 | |
| OBJECT_DECLARE_SIMPLE_TYPE(VHostVSock, VHOST_VSOCK)
 | |
| 
 | |
| typedef struct {
 | |
|     uint64_t guest_cid;
 | |
|     char *vhostfd;
 | |
| } VHostVSockConf;
 | |
| 
 | |
| struct VHostVSock {
 | |
|     /*< private >*/
 | |
|     VHostVSockCommon parent;
 | |
|     VHostVSockConf conf;
 | |
| 
 | |
|     /*< public >*/
 | |
| };
 | |
| 
 | |
| #endif /* QEMU_VHOST_VSOCK_H */
 |