From owner-freebsd-virtualization@FreeBSD.ORG Mon Nov 11 16:21:09 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6BFD0445 for ; Mon, 11 Nov 2013 16:21:09 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-wg0-x231.google.com (mail-wg0-x231.google.com [IPv6:2a00:1450:400c:c00::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 053BA237F for ; Mon, 11 Nov 2013 16:21:08 +0000 (UTC) Received: by mail-wg0-f49.google.com with SMTP id x13so878773wgg.16 for ; Mon, 11 Nov 2013 08:21:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=6/4LXSP5gfg682BgGpN9pnC8BURa6l9QxZQ8YCB5i1k=; b=cxxlG4np5w1nrhDX1zNSC4hVawtJnHBGHSz0l/pl0HwE6rAjz/FDPkuAqmP91hLjDS u0188e///K4mLhV/6IZB/PMD8rAtVLuf+NWnGKisssuZkGSpYFBgSi585DJD14FGmuPN 2ShonXt7a04rsvdB4+Rk4/qa6BPGezKiJW06JA8MuYzXgZJ2sslG8nQg49Jeb8A7Zkih 6OPMD+DBNE33ta2IPP3FKQhdONJZKjXCcawAQ2nrtuXh732eeWFByrPGhP918kFJihvC 5i9cFhCkfkbauwtKmVKWfcZp/qbsQEg1UUL/BYb5lkOp4MbMBY12xCaRIYe8jQOvLbuX 4AXg== MIME-Version: 1.0 X-Received: by 10.194.122.99 with SMTP id lr3mr22582773wjb.21.1384186867365; Mon, 11 Nov 2013 08:21:07 -0800 (PST) Received: by 10.216.203.195 with HTTP; Mon, 11 Nov 2013 08:21:07 -0800 (PST) In-Reply-To: <5280FF27.1090405@citrix.com> References: <5280FF27.1090405@citrix.com> Date: Mon, 11 Nov 2013 20:21:07 +0400 Message-ID: Subject: Re: Running `sysctl -a` causes crash (Hyper-V) From: Sergey Kandaurov To: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Pavel Timofeev , "freebsd-virtualization@freebsd.org" X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 11 Nov 2013 16:21:09 -0000 On 11 November 2013 20:00, Roger Pau Monn=E9 wrote: > On 11/11/13 15:31, Sergey Kandaurov wrote: >> On 11 November 2013 18:13, Pavel Timofeev wrote: >>> [...] >>> (kgdb) p vm_guest >>> $1 =3D 3 >>> Current language: auto; currently minimal >>> (kgdb) >>> >> >> What if you try this change? >> >> Index: sys/kern/subr_param.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- sys/kern/subr_param.c (revision 257695) >> +++ sys/kern/subr_param.c (working copy) >> @@ -153,6 +153,7 @@ >> "none", >> "generic", >> "xen", >> + "hv", >> NULL >> }; > > This is my fault, I've added VM_GUEST_HV to the guest type enum without > knowing there was another array in a completely different file that > contained a description for those values. Ok, I committed the fix in r257996. > > If you (or someone else) are going to commit this change, I would > recommend adding a BIG comment in sys/systm.h above the declaration of > VM_GUEST explaining that if you add a new guest type there you also need > to add a description in subr_param.c, this will probably prevent > something like this happening again. > What about this change? Index: sys/sys/systm.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/sys/systm.h (revision 257695) +++ sys/sys/systm.h (working copy) @@ -70,6 +70,7 @@ * Detected virtual machine guest types. The intention is to expand * and/or add to the VM_GUEST_VM type if specific VM functionality is * ever implemented (e.g. vendor-specific paravirtualization features). + * Keep in sync with vm_guest_sysctl_names[]. */ enum VM_GUEST { VM_GUEST_NO =3D 0, VM_GUEST_VM, VM_GUEST_XEN, VM_GUEST_HV = }; --=20 wbr, pluknet