From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59217) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEup6-0004iU-Fl for qemu-devel@nongnu.org; Thu, 29 Aug 2013 01:31:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VEuow-0004RA-Nj for qemu-devel@nongnu.org; Thu, 29 Aug 2013 01:31:12 -0400 Message-ID: <521EDC93.5090202@suse.de> Date: Thu, 29 Aug 2013 07:30:59 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1376606111-3518-1-git-send-email-afaerber@suse.de> <1376606111-3518-4-git-send-email-afaerber@suse.de> <521ECF0D.4040403@ozlabs.ru> In-Reply-To: <521ECF0D.4040403@ozlabs.ru> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: Alexey Kardashevskiy Cc: qemu-ppc , qemu-devel@nongnu.org, Prerna Saxena Am 29.08.2013 06:33, schrieb Alexey Kardashevskiy: > On 08/16/2013 08:35 AM, Andreas F=C3=A4rber 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 fi= ll >> it in for that class in a PAPR-compliant way with "PowerPC," prefix. >> >> Reported-by: Prerna Saxena >> Signed-off-by: Andreas F=C3=A4rber >> --- >> 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; >> =20 >> typename =3D object_class_get_name(oc); >> + if (kvm_enabled() && >> + strcmp(typename, "host-" TYPE_POWERPC_CPU) =3D=3D 0) = { >> + typename =3D object_class_get_name(object_class_get_p= arent(oc)); >> + } >> nodename =3D g_strndup(typename, >> strlen(typename) - strlen("-" TYPE_P= OWERPC_CPU)); >> dc->fw_name =3D g_strdup_printf("PowerPC,%s", nodename); >> >=20 > You could use dc->desc of a parent, would be simpler, no? Answered on 2/4. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg