From mboxrd@z Thu Jan 1 00:00:00 1970 From: Don Slutz Subject: Re: [RFC][PATCH v1 1/3] Add xen-hvm-param Date: Tue, 02 Sep 2014 11:11:50 -0400 Message-ID: <5405DE36.3090802@terremark.com> References: <1409659640-20615-1-git-send-email-dslutz@verizon.com> <1409659640-20615-2-git-send-email-dslutz@verizon.com> <5405BC55.3030607@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5405BC55.3030607@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper , Don Slutz , xen-devel@lists.xen.org Cc: Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On 09/02/14 08:47, Andrew Cooper wrote: > On 02/09/14 13:07, Don Slutz wrote: >> A tool to get and set hvm param. >> >> Signed-off-by: Don Slutz >> --- ... >> + snprintf(hvm_param_name[HVM_PARAM_VMPORT_BUILD_NUMBER_VALUE], >> + sizeof(hvm_param_name[HVM_PARAM_VMPORT_BUILD_NUMBER_VALUE]), >> + "Vmport_Build_Number_Value"); >> + snprintf(hvm_param_name[HVM_PARAM_VMPORT_RESET_TIME], >> + sizeof(hvm_param_name[HVM_PARAM_VMPORT_RESET_TIME]), "Vmport_Reset_Time"); > Surely all these snprintfs can be replaced with some compiler magic, to > vastly reduce its complexity. > > static const char * hvm_param_names[] = > { > "Callback_Irq", > "Store_Pfn", > ... > }; > > static const char *hvm_param_name(unsigned int param) > { > return param < ARRAY_SIZE(hvm_param_names) ? hvm_param_names[param] > : "Unknown"; > } There might be. I just went with the fastest way to do this (an emacs macro...) > > It might also be nice to have a "dump all" option. Yes. How about if only domain id specified, all are dumpped? -Don Slutz > ~Andrew > >