From owner-freebsd-virtualization@FreeBSD.ORG Mon Nov 11 16:26:20 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 9108C662 for ; Mon, 11 Nov 2013 16:26:20 +0000 (UTC) (envelope-from roger.pau@citrix.com) Received: from SMTP.CITRIX.COM (smtp.citrix.com [66.165.176.89]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C5DF023E1 for ; Mon, 11 Nov 2013 16:26:19 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.93,679,1378857600"; d="scan'208";a="73206254" Received: from accessns.citrite.net (HELO FTLPEX01CL01.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 11 Nov 2013 16:26:17 +0000 Received: from [IPv6:::1] (10.80.16.47) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.2.342.4; Mon, 11 Nov 2013 11:26:16 -0500 Message-ID: <52810527.8080603@citrix.com> Date: Mon, 11 Nov 2013 17:26:15 +0100 From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Sergey Kandaurov Subject: Re: Running `sysctl -a` causes crash (Hyper-V) References: <5280FF27.1090405@citrix.com> In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-DLP: MIA1 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:26:20 -0000 On 11/11/13 17:21, Sergey Kandaurov wrote: > On 11 November 2013 20:00, Roger Pau Monné wrote: >> On 11/11/13 15:31, Sergey Kandaurov wrote: >>> On 11 November 2013 18:13, Pavel Timofeev wrote: >>>> [...] >>>> (kgdb) p vm_guest >>>> $1 = 3 >>>> Current language: auto; currently minimal >>>> (kgdb) >>>> >>> >>> What if you try this change? >>> >>> Index: sys/kern/subr_param.c >>> =================================================================== >>> --- 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 > =================================================================== > --- 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 = 0, VM_GUEST_VM, VM_GUEST_XEN, VM_GUEST_HV }; Looks good to me.