[dts] [PATCH 1/5] add vhost-cuse implementations for virtio pci device

Liu, Yong yong.liu at intel.com
Mon Jul 13 03:26:35 CEST 2015


No more comments on this patch. Just need use pep8 to check the format.

> -----Original Message-----
> From: Xu, Qian Q
> Sent: Monday, July 13, 2015 9:18 AM
> To: Liu, Yong; dts at dpdk.org
> Subject: RE: [dts] [PATCH 1/5] add vhost-cuse implementations for virtio
> pci device
> 
> OK, I can comment them, any other changes needed?
> 
> Thanks
> Qian
> 
> 
> -----Original Message-----
> From: Liu, Yong
> Sent: Monday, July 13, 2015 9:17 AM
> To: Xu, Qian Q; dts at dpdk.org
> Subject: RE: [dts] [PATCH 1/5] add vhost-cuse implementations for virtio
> pci device
> 
> Qian, please remove debug function in your patch.
> 
> > -----Original Message-----
> > From: dts [mailto:dts-bounces at dpdk.org] On Behalf Of Qian Xu
> > Sent: Monday, July 13, 2015 9:14 AM
> > To: dts at dpdk.org
> > Subject: [dts] [PATCH 1/5] add vhost-cuse implementations for virtio
> > pci device
> >
> > Signed-off-by: Qian Xu <qian.q.xu at intel.com>
> >
> > diff --git a/framework/qemu_kvm.py b/framework/qemu_kvm.py index
> > 4ccce81..44db411 100644
> > --- a/framework/qemu_kvm.py
> > +++ b/framework/qemu_kvm.py
> > @@ -85,7 +85,7 @@ class QEMUKvm(VirtBase):
> >          self.char_idx = 0
> >          self.netdev_idx = 0
> >          self.pt_idx = 0
> > -
> > +	self.cuse_id = 0
> >          # devices pass-through into vm
> >          self.pt_devices = []
> >          self.pci_maps = []
> > @@ -569,6 +569,8 @@ class QEMUKvm(VirtBase):
> >                  self.__add_vm_virtio_net_pci(**options)
> >              elif options['driver'] == 'vhost-user':
> >                  self.__add_vm_virtio_user_pci(**options)
> > +	    elif options['driver'] == 'vhost-cuse':
> > +                self.__add_vm_virtio_cuse_pci(**options)
> >
> >      def __add_vm_pci_assign(self, **options):
> >          """
> > @@ -620,6 +622,25 @@ class QEMUKvm(VirtBase):
> >
> >              self.__add_vm_virtio_net_pci(**opts)
> >
> > +    def __add_vm_virtio_cuse_pci(self, **options):
> > +        """
> > +        driver virtio-net-pci
> > +        opt_mac: 52:54:00:00:00:01
> > +        """
> > +        separator = ','
> > +        dev_boot_line = '-netdev tap'
> > +        cuse_id = 'vhost%d' %self.cuse_id
> > +        dev_boot_line += separator + 'id=%s' %cuse_id + separator
> > +'ifname=tap_%s' %cuse_id + separator +"vhost=on" +separator
> +"script=no"
> > +        self.cuse_id += 1
> > +        self.__add_boot_line(dev_boot_line)
> > +        # device parameter
> > +        opts = {'opt_netdev': '%s' % cuse_id ,
> > +                'opt_id': '%s_net' % cuse_id}
> > +        if 'opt_mac' in options.keys() and options['opt_mac']:
> > +                opts['opt_mac'] = options['opt_mac']
> > +	print "debug info: add cuse info:", dev_boot_line
> > +        self.__add_vm_virtio_net_pci(**opts)
> > +
> >      def __add_vm_virtio_net_pci(self, **options):
> >          """
> >          driver: virtio-net-pci
> > --
> > 2.1.0



More information about the dts mailing list