From owner-freebsd-current@FreeBSD.ORG Sun Oct 7 17:05:25 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A1D4F106564A; Sun, 7 Oct 2012 17:05:25 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-qa0-f54.google.com (mail-qa0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 36A5D8FC12; Sun, 7 Oct 2012 17:05:25 +0000 (UTC) Received: by mail-qa0-f54.google.com with SMTP id y23so1552414qad.13 for ; Sun, 07 Oct 2012 10:05:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; bh=dKIpYVxTb7X1/hPg0cDZziqu7SY5ccfc1fDa2oUG+fA=; b=nUkQ5p1mkVql+2GFPiGLEt6M0eRWSgeU/uaOqVGp+CRUParnSzqMt2PL5P/L7QjO1H zuoYejQv0At5uKcEyTBhzkp+/YsiCKo3+fwE7li+80Nvhj9ZKjFpwnKgDXKxbYL+jlJI hG/rusxSXCVdqvKsBmRKfx+uyrpuWdDcFfX56zmtFRmUD7BB8wswWEJB7Ruw3wbSY3z7 3XSIwTX5fPagtkG+IijCUfzzmCtUjuq3eGmwZzH67rqRcOoY39O+w4p76GsOhK8oqNQV VCkZ9iemJnFs2MkKkpDMUMbgU4msOi6l07OHrR4Kx6/wiO+W4sT95ZjOaO71ZganLl4R jjXg== Received: by 10.224.180.7 with SMTP id bs7mr26273659qab.37.1349629524479; Sun, 07 Oct 2012 10:05:24 -0700 (PDT) Received: from narn.knownspace (pool-108-48-127-15.washdc.fios.verizon.net. [108.48.127.15]) by mx.google.com with ESMTPS id dz9sm15713661qab.6.2012.10.07.10.05.23 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 07 Oct 2012 10:05:24 -0700 (PDT) Date: Sun, 7 Oct 2012 13:05:21 -0400 From: Justin Hibbits To: Ian Lepore Message-ID: <20121007130521.76dc7e5e@narn.knownspace> In-Reply-To: <1349626600.1112.30.camel@revolution.hippie.lan> References: <20121006172834.GB63649@onelab2.iet.unipi.it> <20121007104330.GA75115@onelab2.iet.unipi.it> <20121007150219.GA76853@onelab2.iet.unipi.it> <20121007155356.GA77558@onelab2.iet.unipi.it> <1349626600.1112.30.camel@revolution.hippie.lan> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; powerpc-portbld-freebsd10.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Garrett Cooper , Adrian Chadd , Luigi Rizzo , current@freebsd.org Subject: Re: sysctl vs ifconfig vs other (was Re: sysctl-controlled key-value store ?) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Oct 2012 17:05:25 -0000 On Sun, 07 Oct 2012 10:16:40 -0600 Ian Lepore wrote: > On Sun, 2012-10-07 at 17:53 +0200, Luigi Rizzo wrote: > > Access through sysctl is incredibly easy from both userspace and > > from a C application, because all the work is done in the kernel > > side, whereas other mechanisms (ioctl, i'd rather leave kvm apart > > as we really don't want that!) require the definition of a specific > > API (ioctl, structs) _and_ some amount of wrapping code in > > userspace. > > > > cheers > > luigi > > A potential problem with sysctl is its "one thing at a time" nature. > When you pack up a bunch of related data into a structure and hand it > off to an implementation, that implementation can pretty easily make > sure that all the data related to the config request is sane. If you > have to make a series of sysctl calls to achieve some complex config > task, what happens when you're 2/3 of the way through the series and a > call fails? Who backs out the partial config that got accomplished? > > If you go too far down this path you end up with something that looks > a lot like the unmitigated mess which is the SNMP control API. > > -- Ian I agree with Ian here. As messy as ioctl+structs are from a user standpoint, they're the easiest way to guarantee atomic configuration changes. - Justin