From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YdNaA-0006wm-O8 for qemu-devel@nongnu.org; Wed, 01 Apr 2015 14:41:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YdNa7-0000sA-En for qemu-devel@nongnu.org; Wed, 01 Apr 2015 14:41:42 -0400 Received: from e31.co.us.ibm.com ([32.97.110.149]:35105) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YdNa7-0000ro-3z for qemu-devel@nongnu.org; Wed, 01 Apr 2015 14:41:39 -0400 Received: from /spool/local by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 1 Apr 2015 12:41:36 -0600 Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id 9F6861FF002A for ; Wed, 1 Apr 2015 12:32:44 -0600 (MDT) Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t31IfLOA31981774 for ; Wed, 1 Apr 2015 11:41:22 -0700 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t31IfWC2009687 for ; Wed, 1 Apr 2015 12:41:32 -0600 Message-ID: <551C3BDA.6080300@linux.vnet.ibm.com> Date: Wed, 01 Apr 2015 14:41:30 -0400 From: Tony Krowiak MIME-Version: 1.0 References: <1427897284-31473-1-git-send-email-marcel@redhat.com> <551BFCF4.1040206@gmail.com> In-Reply-To: <551BFCF4.1040206@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-2.3] util/qemu-config" fix regression of qmp_query_command_line_options List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: marcel@redhat.com, qemu-devel@nongnu.org Cc: pbonzini@redhat.com, armbru@redhat.com On 04/01/2015 10:13 AM, Marcel Apfelbaum wrote: > I noticed the typo in subject :) maybe the maintainer that will take > it can fix this if no further work is necessary, of course. > > On 04/01/2015 05:08 PM, Marcel Apfelbaum wrote: >> Commit 49d2e64 (machine: remove qemu_machine_opts global list) made >> machine machine options specific to machine sub-type, leaving >> the qemu_machine_opts desc array empty. Sadly this is the place >> qmp_query_command_line_options is looking for supported options. >> >> As a fix for for 2.3 the machine_qemu_opts are restored only >> for the scope of qemu-config, bringing together all machines >> properties. We need to find a better fix for 2.4. >> >> Reported-by: Tony Krowiak > Hi Tony, > I'll appreciate if you check that it works now. > > I checked query-command-line-options and it returns the machine > options for now. > No further changes should be necessary, > > Thanks, > Marcel Marcel, I installed your patch on my system and it resolved the problem I was seeing. I'm looking forward to seeing how you are going to resolve this per machine. Tony Krowiak > >> Signed-off-by: Marcel Apfelbaum >> --- >> >> I don't like this approach, but I wouldn't want to loose the >> 'options per machine type' feature. We'll find something better for 2.4/ >> >> util/qemu-config.c | 108 >> +++++++++++++++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 108 insertions(+) >> >> diff --git a/util/qemu-config.c b/util/qemu-config.c >> index f3463df..9e8edda 100644 >> --- a/util/qemu-config.c >> +++ b/util/qemu-config.c >> @@ -6,6 +6,7 @@ >> #include "hw/qdev.h" >> #include "qapi/error.h" >> #include "qmp-commands.h" >> +#include "hw/i386/pc.h" >> >> static QemuOptsList *vm_config_groups[32]; >> static QemuOptsList *drive_config_groups[4]; >> @@ -148,6 +149,111 @@ static CommandLineParameterInfoList >> *get_drive_infolist(void) >> return head; >> } >> >> +/* restore machine options that are now machine's properties */ >> +static QemuOptsList machine_opts = { >> + .merge_lists = true, >> + .head = QTAILQ_HEAD_INITIALIZER(machine_opts.head), >> + .desc = { >> + { >> + .name = "type", >> + .type = QEMU_OPT_STRING, >> + .help = "emulated machine" >> + },{ >> + .name = "accel", >> + .type = QEMU_OPT_STRING, >> + .help = "accelerator list", >> + },{ >> + .name = "kernel_irqchip", >> + .type = QEMU_OPT_BOOL, >> + .help = "use KVM in-kernel irqchip", >> + },{ >> + .name = "kvm_shadow_mem", >> + .type = QEMU_OPT_SIZE, >> + .help = "KVM shadow MMU size", >> + },{ >> + .name = "kernel", >> + .type = QEMU_OPT_STRING, >> + .help = "Linux kernel image file", >> + },{ >> + .name = "initrd", >> + .type = QEMU_OPT_STRING, >> + .help = "Linux initial ramdisk file", >> + },{ >> + .name = "append", >> + .type = QEMU_OPT_STRING, >> + .help = "Linux kernel command line", >> + },{ >> + .name = "dtb", >> + .type = QEMU_OPT_STRING, >> + .help = "Linux kernel device tree file", >> + },{ >> + .name = "dumpdtb", >> + .type = QEMU_OPT_STRING, >> + .help = "Dump current dtb to a file and quit", >> + },{ >> + .name = "phandle_start", >> + .type = QEMU_OPT_NUMBER, >> + .help = "The first phandle ID we may generate dynamically", >> + },{ >> + .name = "dt_compatible", >> + .type = QEMU_OPT_STRING, >> + .help = "Overrides the \"compatible\" property of the dt >> root node", >> + },{ >> + .name = "dump-guest-core", >> + .type = QEMU_OPT_BOOL, >> + .help = "Include guest memory in a core dump", >> + },{ >> + .name = "mem-merge", >> + .type = QEMU_OPT_BOOL, >> + .help = "enable/disable memory merge support", >> + },{ >> + .name = "usb", >> + .type = QEMU_OPT_BOOL, >> + .help = "Set on/off to enable/disable usb", >> + },{ >> + .name = "firmware", >> + .type = QEMU_OPT_STRING, >> + .help = "firmware image", >> + },{ >> + .name = "kvm-type", >> + .type = QEMU_OPT_STRING, >> + .help = "Specifies the KVM virtualization mode (HV, PR)", >> + },{ >> + .name = PC_MACHINE_MAX_RAM_BELOW_4G, >> + .type = QEMU_OPT_SIZE, >> + .help = "maximum ram below the 4G boundary (32bit >> boundary)", >> + },{ >> + .name = PC_MACHINE_VMPORT, >> + .type = QEMU_OPT_STRING, >> + .help = "Enable vmport (pc & q35)", >> + },{ >> + .name = "iommu", >> + .type = QEMU_OPT_BOOL, >> + .help = "Set on/off to enable/disable Intel IOMMU (VT-d)", >> + },{ >> + .name = "secure", >> + .type = QEMU_OPT_BOOL, >> + .help = "Set on/off to enable/disable the ARM " >> + "Security Extensions (TrustZone)", >> + },{ >> + .name = "suppress-vmdesc", >> + .type = QEMU_OPT_BOOL, >> + .help = "Set on to disable self-describing migration", >> + },{ >> + .name = "aes-key-wrap", >> + .type = QEMU_OPT_BOOL, >> + .help = "enable/disable AES key wrapping using the " >> + "CPACF wrapping key", >> + },{ >> + .name = "dea-key-wrap", >> + .type = QEMU_OPT_BOOL, >> + .help = "enable/disable DEA key wrapping using the " >> + "CPACF wrapping key", >> + }, >> + { /* End of list */ } >> + } >> +}; >> + >> CommandLineOptionInfoList *qmp_query_command_line_options(bool >> has_option, >> const char *option, >> Error **errp) >> @@ -162,6 +268,8 @@ CommandLineOptionInfoList >> *qmp_query_command_line_options(bool has_option, >> info->option = g_strdup(vm_config_groups[i]->name); >> if (!strcmp("drive", vm_config_groups[i]->name)) { >> info->parameters = get_drive_infolist(); >> + } else if (!strcmp("machine", vm_config_groups[i]->name)) { >> + info->parameters = >> query_option_descs(machine_opts.desc); >> } else { >> info->parameters = >> query_option_descs(vm_config_groups[i]->desc); >> >