From: Anthony Liguori Subject: Re: [RFC, PATCH 5/24] i386 Vmi code patching Date: Wed, 15 Mar 2006 16:05:48 -0600 Message-ID: <44188FBC.3090603@us.ibm.com> References: <200603131802.k2DI2nv8005665@zach-dev.vmware.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <200603131802.k2DI2nv8005665@zach-dev.vmware.com> Sender: linux-kernel-owner@vger.kernel.org To: Zachary Amsden Cc: Linus Torvalds , Linux Kernel Mailing List , Virtualization Mailing List , Xen-devel , Andrew Morton , Dan Hecht , Dan Arai , Anne Holler , Pratap Subrahmanyam , Christopher Li , Joshua LeVasseur , Chris Wright , Rik Van Riel , Jyothy Reddy , Jack Lo , Kip Macy , Jan Beulich , Ky Srinivasan , Wim Coekaerts , Leendert van Doorn List-Id: xen-devel@lists.xenproject.org Zachary Amsden wrote: > +void __init vmi_init(void) > +{ > + int romsize; > + > + /* > + * Setup optional callback functions if we found the VMI ROM > + */ > + if (hypervisor_found) { > + romsize = vmi_rom->romLength * 512; > + if (VROMFunc(vmi_rom, VMI_CALL_Init)) { > + printk(KERN_WARNING "VMI ROM failed to initialize\n"); > + hypervisor_found = 0; > + } else { > + memcpy(&__VMI_START, (char *)vmi_rom, romsize); > + scan_builtin_annotations(); > + } > + } > + if (!vmi_rom) > + printk(KERN_WARNING "VMI ROM not found" > + " - falling back to native mode\n"); > + else if (!hypervisor_found) > + printk(KERN_WARNING "VMI ROM version mismatch " > + "(kernel requires version >= %d.%d) " > + " - falling back to native mode\n", > + VMI_API_REV_MAJOR, MIN_VMI_API_REV_MINOR); > +} > Minor nitpick. The error logic here is somewhat confusing. If a VMI_CALL_Init results in a failure, you end up with: VMI ROM failed to initialize VMI ROM version mismatch (kernel requires version >= 13.0) - falling back to native mode The later error is misleading as the version may actually match. The nesting here probably could be simplified to. Regards, Anthony Liguori