[dpdk-dev] [PATCH v1] dpdk-devbind.py: Virtio interface issue.

Dey, Souvik sodey at sonusnet.com
Sat Aug 27 02:20:31 CEST 2016


Hi ,
	I have already updated it and have re submitted the patch v3. Can you please check that http://dpdk.org/dev/patchwork/patch/15378/
--
Regards,
Souvik

-----Original Message-----
From: Stephen Hemminger [mailto:stephen at networkplumber.org] 
Sent: Friday, August 26, 2016 11:55 AM
To: Dey, Souvik <sodey at sonusnet.com>
Cc: nhorman at tuxdriver.com; dev at dpdk.org
Subject: Re: [dpdk-dev] [PATCH v1] dpdk-devbind.py: Virtio interface issue.

On Wed, 24 Aug 2016 22:25:46 -0400
souvikdey33 <sodey at sonusnet.com> wrote:

> +    #The path for virtio devices are different. Get the correct path.
> +	virtio = "/sys/bus/pci/devices/%s/" % dev_id
> +    cmd = " ls %s | grep 'virt' " %virtio
> +    virtio = commands.getoutput(cmd)
> +    virtio_sys_path = "/sys/bus/pci/devices/%s/%s/net/" % 
> +(dev_id,virtio)
>      if exists(sys_path):
>          device["Interface"] = ",".join(os.listdir(sys_path))

There should be a way to do this in python without going out to shell.
This would be safer and more secure.

The code already uses os.listdir() (which is the python library version of ls) in later section. Why not use that here to check for virtio bus.


More information about the dev mailing list