From owner-freebsd-virtualization@FreeBSD.ORG Sat Jul 12 01:55:26 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 52FCA106564A for ; Sat, 12 Jul 2008 01:55:26 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outS.internet-mail-service.net (outs.internet-mail-service.net [216.240.47.242]) by mx1.freebsd.org (Postfix) with ESMTP id 327298FC17 for ; Sat, 12 Jul 2008 01:55:26 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 1505223EE; Fri, 11 Jul 2008 18:55:26 -0700 (PDT) Received: from julian-mac.elischer.org (localhost [127.0.0.1]) by idiom.com (Postfix) with ESMTP id B66B62D6019; Fri, 11 Jul 2008 18:55:25 -0700 (PDT) Message-ID: <48780EF3.6030802@elischer.org> Date: Fri, 11 Jul 2008 18:54:59 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: James Gritton 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 Cc: freebsd-virtualization@freebsd.org 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: Sat, 12 Jul 2008 01:55:26 -0000 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. I've only looked at the sysctl macros supreficially but assumed that the redundant information was forward looking, and that there was support for future changes there. > > 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. umm but they call different code.. > > I'm including a diff that trims all this away, while keeping the same > functionality. > > - Jamie > > > ------------------------------------------------------------------------ > > _______________________________________________ > freebsd-virtualization@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization > To unsubscribe, send any mail to "freebsd-virtualization-unsubscribe@freebsd.org"