From owner-freebsd-virtualization@FreeBSD.ORG Fri Jul 11 20:24:09 2008 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C51221065674 for ; Fri, 11 Jul 2008 20:24:09 +0000 (UTC) (envelope-from jamie@gritton.org) Received: from gritton.org (gritton.org [161.58.222.4]) by mx1.freebsd.org (Postfix) with ESMTP id 9FEB48FC22 for ; Fri, 11 Jul 2008 20:24:09 +0000 (UTC) (envelope-from jamie@gritton.org) Received: from guppy.corp.verio.net (fw.oremut02.us.wh.verio.net [198.65.168.24]) (authenticated bits=0) by gritton.org (8.13.6.20060614/8.13.6) with ESMTP id m6BKO8AM011713 for ; Fri, 11 Jul 2008 14:24:08 -0600 (MDT) Message-ID: <4877C161.3080400@gritton.org> Date: Fri, 11 Jul 2008 14:24:01 -0600 From: James Gritton User-Agent: Thunderbird 2.0.0.9 (X11/20080228) MIME-Version: 1.0 To: freebsd-virtualization@freebsd.org References: <487787CC.6020302@gritton.org> In-Reply-To: <487787CC.6020302@gritton.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.93, clamav-milter version 0.93 on gritton.org X-Virus-Status: Clean Subject: Re: Simpler Vimage sysctls X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jul 2008 20:24:09 -0000 OK, forget that last part about the SYSCTL_V_XXX macros not needing to be redefined for VIMAGE - I didn't notice that they link to the sysctl_handle_v_xxx functions. - Jamie James Gritton wrote: > While working on combining jail_set and Vimage, I found that the > sysctl virtualization hacks were more complicated than they needed to be. > > The extra "subs" and "mod" arguments in SYSCTL_HANDLER_V_ARGS don't > need to be explicitly passed because they're members of the > sysctl_v_oid structure passed in the oidp argument. By using > oidp->oid_v_subs instead of subs (and same for mod), > SYSCTL_HANDLER_V_ARGS becomes the same as SYSCTL_HANDLER_ARGS, and no > longer need to be defined. > > With the handlers now taking the same arguments, the sysctl_oid and > sysctl_v_oid structures become identical and sysctl_v_oid can go away. > > Unrelated to this is the various SYSCTL_V_XXX macros that refer to > either SYSCTL_V_OID or SYSCTL_OID depending on the VIMAGE define. > Since SYSCTL_V_OID already reduces to SYSCTL_OID if VIMAGE is > undefined, those further switches are unnecessary. > > I'm including a diff that trims all this away, while keeping the same > functionality.