Received: from eggs.gnu.org ([2001:4830:134:3::10]:45267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VA68f-0001uT-Mi for qemu-devel@nongnu.org; Thu, 15 Aug 2013 18:35:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VA68Y-0001C3-IB for qemu-devel@nongnu.org; Thu, 15 Aug 2013 18:35:29 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Fri, 16 Aug 2013 00:35:10 +0200 Message-Id: <1376606111-3518-4-git-send-email-afaerber@suse.de> In-Reply-To: <1376606111-3518-1-git-send-email-afaerber@suse.de> References: <1376606111-3518-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [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: qemu-devel@nongnu.org Cc: Alexander Graf , "open list:sPAPR" , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Prerna Saxena 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=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_bas= e, 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_pare= nt(oc)); + } nodename =3D g_strndup(typename, strlen(typename) - strlen("-" TYPE_POWE= RPC_CPU)); dc->fw_name =3D g_strdup_printf("PowerPC,%s", nodename); --=20 1.8.1.4