From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51425) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEtvJ-0000EF-BD for qemu-devel@nongnu.org; Thu, 29 Aug 2013 00:33:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VEtvA-00059d-Ug for qemu-devel@nongnu.org; Thu, 29 Aug 2013 00:33:33 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:33458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEtvA-00059Q-Oi for qemu-devel@nongnu.org; Thu, 29 Aug 2013 00:33:24 -0400 Received: by mail-pd0-f176.google.com with SMTP id q10so7191377pdj.35 for ; Wed, 28 Aug 2013 21:33:23 -0700 (PDT) Message-ID: <521ECF0D.4040403@ozlabs.ru> Date: Thu, 29 Aug 2013 14:33:17 +1000 From: Alexey Kardashevskiy MIME-Version: 1.0 References: <1376606111-3518-1-git-send-email-afaerber@suse.de> <1376606111-3518-4-git-send-email-afaerber@suse.de> In-Reply-To: <1376606111-3518-4-git-send-email-afaerber@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 3/4] spapr: Improve device tree CPU node for -cpu host with unknown OF name List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Cc: sPAPR , qemu-devel@nongnu.org, Prerna Saxena On 08/16/2013 08:35 AM, Andreas Färber wrote: > Whenever DeviceClass::fw_name is not available, derive it from the CPU's > type name, resorting to the parent's type in case of -cpu host, and fill > it in for that class in a PAPR-compliant way with "PowerPC," prefix. > > Reported-by: Prerna Saxena > Signed-off-by: Andreas Färber > --- > hw/ppc/spapr.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index 6d984dc..0e9be32 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -344,6 +344,10 @@ static void *spapr_create_fdt_skel(hwaddr initrd_base, > const char *typename; > > typename = object_class_get_name(oc); > + if (kvm_enabled() && > + strcmp(typename, "host-" TYPE_POWERPC_CPU) == 0) { > + typename = object_class_get_name(object_class_get_parent(oc)); > + } > nodename = g_strndup(typename, > strlen(typename) - strlen("-" TYPE_POWERPC_CPU)); > dc->fw_name = g_strdup_printf("PowerPC,%s", nodename); > You could use dc->desc of a parent, would be simpler, no? -- Alexey