From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJ8AF-0007IO-Ct for qemu-devel@nongnu.org; Wed, 04 Feb 2015 17:11:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJ89y-00081V-3u for qemu-devel@nongnu.org; Wed, 04 Feb 2015 17:11:15 -0500 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:60243) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJ89x-00080n-SQ for qemu-devel@nongnu.org; Wed, 04 Feb 2015 17:10:58 -0500 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 4 Feb 2015 22:10:56 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id AEEF81B0804B for ; Wed, 4 Feb 2015 22:11:00 +0000 (GMT) Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t14MArhF9961808 for ; Wed, 4 Feb 2015 22:10:53 GMT Received: from d06av12.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t14MAqkT006043 for ; Wed, 4 Feb 2015 15:10:53 -0700 Message-ID: <54D298EB.80303@de.ibm.com> Date: Wed, 04 Feb 2015 23:10:51 +0100 From: Christian Borntraeger MIME-Version: 1.0 References: <1423064635-19045-1-git-send-email-marcel@redhat.com> <54D276F4.7050400@de.ibm.com> <54D29089.2050606@gmail.com> In-Reply-To: <54D29089.2050606@gmail.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/8] machine: query machine properties rather than qemu opts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: marcel@redhat.com, qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, james.hogan@imgtec.com, mst@redhat.com, jan.kiszka@siemens.com, agraf@suse.de, scottwood@freescale.com, cornelia.huck@de.ibm.com, pbonzini@redhat.com, leon.alrae@imgtec.com, aurelien@aurel32.net Am 04.02.2015 um 22:35 schrieb Marcel Apfelbaum: [...] >> Would a function there that does gets S390_CCW_MACHINE(current_machine)->aes_key_wrap >> considered ok, or do we need to pollute hw/core/machine.c with architecture specific >> options? > We surely don't add this to hw/core/machine.c because is specific to TYPE_S390_CCW_MACHINE. > > Let's say you want to use this property in kvm_arch_init of target-s390x/kvm.c. > - After this series you already have an instance of MachineState initialized with your new properties. > - My assumption is that TYPE_S390_CCW_MACHINE is the only s390 machine or the base type of all s390 machines. > You have three options here: > 1. Use QOM infrastucture: > bool aes_key_wrap = object_property_get_bool(OBJECT(machine), "aes-key-wrap", NULL); > 2. Add a wrapper somewhere in include/hw/s390x/ > that gets MachineState, cast it into S390State and return the field value. > 3. Directly downcast MachineState to S390State and get the value. > * All of the above use my assumption that all s390 machines derive from this one. Yes, we derive CCW_MACHINE from the base machine type. Thanks > >> >> Christian >> >> PS: The same is somewhat true for qemu-options.hx. Having such specific machine option >> in the global help offers room for improvement > Can you please elaborate? I didn't fully understand what exactly are you referring to. lets take for example vmport. This is only relevant for x86, but it seems that there is nothing like QEMU_ARCH_ALL QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | QEMU_ARCH_LM32 for machine properties. Now that we actually move this into the backends, we could do it here as well. > Hope I helped, > Marcel Absolutely