Re: [ovs-dev] [PATCH] ovs-vsctl: check if the device name is valid

2012-11-02 Thread Ben Pfaff
On Fri, Nov 02, 2012 at 03:28:03PM +0800, Cong Wang wrote: > On Fri, Nov 2, 2012 at 12:44 AM, Ben Pfaff wrote: > > Stepping back: I support your basic proposal, that "ovs-vsctl > > add-port" should report a problem if the port cannot successfully be > > added. The issue is that, so far, the appro

Re: [ovs-dev] [PATCH] ovs-vsctl: check if the device name is valid

2012-11-02 Thread Cong Wang
On Fri, Nov 2, 2012 at 12:44 AM, Ben Pfaff wrote: > Stepping back: I support your basic proposal, that "ovs-vsctl > add-port" should report a problem if the port cannot successfully be > added. The issue is that, so far, the approaches I've seen don't fit > well with the overall Open vSwitch desi

Re: [ovs-dev] [PATCH] ovs-vsctl: check if the device name is valid

2012-11-01 Thread Thomas Graf
On 11/01/12 at 11:01am, Ben Pfaff wrote: > On Thu, Nov 1, 2012 at 10:47 AM, Thomas Graf wrote: > > I was considering to add a notification bus allowing for ovs-vsctl > > to sleep and wait for a success or error notification and thus block > > until the operation has been carried out by vswitchd or

Re: [ovs-dev] [PATCH] ovs-vsctl: check if the device name is valid

2012-11-01 Thread Ben Pfaff
On Thu, Nov 1, 2012 at 10:47 AM, Thomas Graf wrote: > I was considering to add a notification bus allowing for ovs-vsctl > to sleep and wait for a success or error notification and thus block > until the operation has been carried out by vswitchd or a timeout is > reached. It would be more flexibl

Re: [ovs-dev] [PATCH] ovs-vsctl: check if the device name is valid

2012-11-01 Thread Thomas Graf
On 11/01/12 at 09:44am, Ben Pfaff wrote: > ovs-vsctl does not make Netlink calls. It only updates the database, > via ovsdb-server. ovs-vswitchd does make the Netlink calls, but it > doesn't talk directly to ovs-vsctl. It only monitors the database. > > > Currently the logfile has to be consult

Re: [ovs-dev] [PATCH] ovs-vsctl: check if the device name is valid

2012-11-01 Thread Ben Pfaff
On Thu, Nov 01, 2012 at 02:30:29PM +, Thomas Graf wrote: > On 10/26/12 at 07:44am, Ben Pfaff wrote: > > On Fri, Oct 26, 2012 at 09:22:35PM +0800, Cong Wang wrote: > > > On 10/25/2012 11:20 PM, Ben Pfaff wrote: > > > >Furthermore, ovs-vsctl is meant to be generic in the sense that you can > > >

Re: [ovs-dev] [PATCH] ovs-vsctl: check if the device name is valid

2012-11-01 Thread Thomas Graf
On 10/26/12 at 07:44am, Ben Pfaff wrote: > On Fri, Oct 26, 2012 at 09:22:35PM +0800, Cong Wang wrote: > > On 10/25/2012 11:20 PM, Ben Pfaff wrote: > > >Furthermore, ovs-vsctl is meant to be generic in the sense that you can > > >use an ovs-vsctl built in one place (on one OS) to control a switch an

Re: [ovs-dev] [PATCH] ovs-vsctl: check if the device name is valid

2012-10-26 Thread Ben Pfaff
On Fri, Oct 26, 2012 at 09:22:35PM +0800, Cong Wang wrote: > On 10/25/2012 11:20 PM, Ben Pfaff wrote: > >Furthermore, ovs-vsctl is meant to be generic in the sense that you can > >use an ovs-vsctl built in one place (on one OS) to control a switch and > >database running elsewhere (on another OS).

Re: [ovs-dev] [PATCH] ovs-vsctl: check if the device name is valid

2012-10-26 Thread Cong Wang
On 10/25/2012 11:20 PM, Ben Pfaff wrote: Furthermore, ovs-vsctl is meant to be generic in the sense that you can use an ovs-vsctl built in one place (on one OS) to control a switch and database running elsewhere (on another OS). You don't want to apply the local host's restrictions to changes to

Re: [ovs-dev] [PATCH] ovs-vsctl: check if the device name is valid

2012-10-25 Thread Ben Pfaff
On Thu, Oct 25, 2012 at 04:24:37PM +0800, Cong Wang wrote: > On Wed, Oct 24, 2012 at 11:54 PM, Ben Pfaff wrote: > > On Wed, Oct 24, 2012 at 05:45:36PM +0800, Cong Wang wrote: > >> Before waiting for the kernel to reject an invalid name, we > >> can actually check it before going into the kernel. T

Re: [ovs-dev] [PATCH] ovs-vsctl: check if the device name is valid

2012-10-25 Thread Cong Wang
On Wed, Oct 24, 2012 at 11:54 PM, Ben Pfaff wrote: > On Wed, Oct 24, 2012 at 05:45:36PM +0800, Cong Wang wrote: >> Before waiting for the kernel to reject an invalid name, we >> can actually check it before going into the kernel. The code >> is stolen from linux kernel function dev_valid_name(), >

Re: [ovs-dev] [PATCH] ovs-vsctl: check if the device name is valid

2012-10-24 Thread Ben Pfaff
On Wed, Oct 24, 2012 at 05:45:36PM +0800, Cong Wang wrote: > Before waiting for the kernel to reject an invalid name, we > can actually check it before going into the kernel. The code > is stolen from linux kernel function dev_valid_name(), > but it should apply to non-Linux arch as well, because >

[ovs-dev] [PATCH] ovs-vsctl: check if the device name is valid

2012-10-24 Thread Cong Wang
Before waiting for the kernel to reject an invalid name, we can actually check it before going into the kernel. The code is stolen from linux kernel function dev_valid_name(), but it should apply to non-Linux arch as well, because IFNAMSIZ is POSIX and other errors are obvious. After this patch I