From nobody Sun Apr 6 21:03:48 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1736242401; cv=none; d=zohomail.com; s=zohoarc; b=i60wF4pyoyCFoJCxvYjs5jt8qovB7wASAevleTf30zPNFOSZp7V5qU+qn2R4JDIWD7uGzSx6jLrpWPt2LUjG1AFv9Rvk+UfHaQ7yMrZ+qqYCIbqRz3BvVka/1CQh8eI78FkaXdM4PwUwC3TgICzM2pCpYdRcgOR4S8EwpegS/tw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736242401; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=le6xEQUAKXVEdnvKDfxbK1jzAiqE1WDBuz0Ul4Gn8vE=; b=XTxirD28w8UXYSzbVIeLh/+6Y88tACc7nkaArFFqQHMbPc9Idf7A/NsuOjdAc5fHhqFGwaqWSnKetXU5Ctb00RwGXeVhoHUrF6jE4AWCLbpKn8y9wB9/+YGL4jC7JyBr019XUZD3bpYTOiPTRlduye1zSaxXwLm0O33QMZScg/c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1736242399711978.1158999302028; Tue, 7 Jan 2025 01:33:19 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.866219.1277523 (Exim 4.92) (envelope-from ) id 1tV5xJ-0001y2-Cc; Tue, 07 Jan 2025 09:32:57 +0000 Received: by outflank-mailman (output) from mailman id 866219.1277523; Tue, 07 Jan 2025 09:32:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tV5xJ-0001xt-9J; Tue, 07 Jan 2025 09:32:57 +0000 Received: by outflank-mailman (input) for mailman id 866219; Tue, 07 Jan 2025 09:32:56 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tV5xI-0001ho-4s for xen-devel@lists.xenproject.org; Tue, 07 Jan 2025 09:32:56 +0000 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [2a00:1450:4864:20::434]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 5f3aced8-ccda-11ef-99a4-01e77a169b0f; Tue, 07 Jan 2025 10:32:54 +0100 (CET) Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-385e87b25f0so10082025f8f.0 for ; Tue, 07 Jan 2025 01:32:54 -0800 (PST) Received: from localhost ([84.78.159.3]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4366127c4d7sm591188645e9.34.2025.01.07.01.32.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2025 01:32:53 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 5f3aced8-ccda-11ef-99a4-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1736242374; x=1736847174; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=le6xEQUAKXVEdnvKDfxbK1jzAiqE1WDBuz0Ul4Gn8vE=; b=NCtGz7epRuTDB0UrihncsKcA5TdRbC3o9Q+MTVrdZxgA4m/wfm+ZSFnevvIq569gws 0NOIvJsLy2cS73cZWdZh5LmyT4eusMrqjfzPhiYfbRy6FBrLaC4ITT9ioGOcpFFgUREg 1QfuFmytc76ou8UDpsYJS7C+JnfgnvxxuvdEY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736242374; x=1736847174; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=le6xEQUAKXVEdnvKDfxbK1jzAiqE1WDBuz0Ul4Gn8vE=; b=X2viTzSZDyAs1lj6gDIFYhrjX/zK7hlSGvvCaDUNq9B3UDKvYOLTpwu7L/ZAchyrK8 4KOZJ8umkdzDt0kM2XH3UPUCk80H2NFBfueRZcw3ctegC6kPIYGxmRcYEb38191lOYv3 EKDblabWYhs2vz1pvZqllHMqnH0oTYiaqlutngqEEbTLDQ2Pu4XFr/ndxrXADiMXr6jK 0Iy+65Xa4c/iWydovTUeuxUPlFIAHlKVosghCqMY2gokMCWWIcpDUY/c04ZaDBrsRnyI yZMM3L/JAQlmpbHMDzruxViVIDB/1z9qh6nANmnnEitm9PG5BTL7ltuSoutszRBNQmuJ VrAg== X-Forwarded-Encrypted: i=1; AJvYcCU4KD49iJVMlquNcG6jnYC/lcrWpDGHo544sYP7RLTn3a3mpRguTFh8K6URunyhd+wbp23uJhLp1O0=@lists.xenproject.org X-Gm-Message-State: AOJu0YxIMqdY8my73FlZIuHVs2aeXgVD9IV5ZQs02nlXJgY4tUyCW7DZ z27Ojhx0FfPyjpzBNrlavJ6ti7uTTCOV8iauAi1tfLMx+Tzsrc8fXTdKyJ01MnA= X-Gm-Gg: ASbGncsJVFXhDqfKRwFJ+AtlzOS3QB66mfqbnyLHi9Zk1XKRW1lVjIEJAUmX+tq6CZS xISJVO0kcpFRr3GRsd+KgUzG1RUadc79Cy2QWfdY8Y33DWUDDZxtRAhD9JaeTwqMPXu0qhqD1Sb waZUMo6c+3OBABlxYkBh6pKyEg8IWM7MAfhTLVeMXhdeMfZJn6ECs+W3Y5O3TgGaPLzN4IxfMLy rLmkFBHfJBl5nNC3izfkFmeKcopxH7tglWJHFpciE+IlCetJhwGfoRjAoUgLg== X-Google-Smtp-Source: AGHT+IGs6RVcLqHmfQoSzmfYVFDzjcfB1yzxVrQ1br3JPwQL8Jwfwgn1cE39EOkxrmixmEPusLWFPA== X-Received: by 2002:a5d:47c3:0:b0:385:df17:2148 with SMTP id ffacd0b85a97d-38a7923b75dmr1712737f8f.20.1736242374009; Tue, 07 Jan 2025 01:32:54 -0800 (PST) From: Roger Pau Monne To: qemu-devel@nongnu.org Cc: Roger Pau Monne , Stefano Stabellini , Anthony PERARD , Paul Durrant , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , xen-devel@lists.xenproject.org Subject: [PATCH 1/2] xen/console: fix error handling in xen_console_device_create() Date: Tue, 7 Jan 2025 10:31:39 +0100 Message-ID: <20250107093140.86180-2-roger.pau@citrix.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20250107093140.86180-1-roger.pau@citrix.com> References: <20250107093140.86180-1-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1736242401982116600 The usage of error_prepend() in some of the error contexts of xen_console_device_create() is incorrect, as `errp` hasn't been initialized. This leads to the following segmentation fault on error paths resulting from xenstore reads: Program terminated with signal SIGSEGV, Segmentation fault. Address not mapped to object. fmt=3D0x15c4dfeade42 "failed to read console device type: ", ap=3D0x15c= d0165ab50) at ../qemu-xen-dir-remote/util/error.c:142 142 g_string_append(newmsg, (*errp)->msg); [...] (gdb) bt (errp=3D0x15cd0165ae10, fmt=3D0x15c4dfeade42 "failed to read console de= vice type: ", ap=3D0x15cd0165ab50) at ../qemu-xen-dir-remote/util/error.c:1= 42 (errp=3D0x15cd0165ae10, fmt=3D0x15c4dfeade42 "failed to read console de= vice type: ") at ../qemu-xen-dir-remote/util/error.c:152 (backend=3D0x43944de00660, opts=3D0x43944c929000, errp=3D0x15cd0165ae10) at ../qemu-xen-dir-remote/hw/char/xen_console.c:555 Replace usages of error_prepend() with error_setg() where appropriate. Fixes: 9b7737469080 ('hw/xen: update Xen console to XenDevice model') Signed-off-by: Roger Pau Monn=C3=A9 --- Cc: Stefano Stabellini Cc: Anthony PERARD Cc: Paul Durrant Cc: "Edgar E. Iglesias" Cc: "Marc-Andr=C3=A9 Lureau" Cc: Paolo Bonzini Cc: xen-devel@lists.xenproject.org --- hw/char/xen_console.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c index ef0c2912efa1..af706c7ef440 100644 --- a/hw/char/xen_console.c +++ b/hw/char/xen_console.c @@ -551,7 +551,7 @@ static void xen_console_device_create(XenBackendInstanc= e *backend, } =20 if (xs_node_scanf(xsh, XBT_NULL, fe, "type", errp, "%ms", &type) !=3D = 1) { - error_prepend(errp, "failed to read console device type: "); + error_setg(errp, "failed to read console device type: "); goto fail; } =20 @@ -582,7 +582,7 @@ static void xen_console_device_create(XenBackendInstanc= e *backend, } else if (number) { cd =3D serial_hd(number); if (!cd) { - error_prepend(errp, "console: No serial device #%ld found: ", + error_setg(errp, "console: No serial device #%ld found: ", number); goto fail; } --=20 2.46.0 From nobody Sun Apr 6 21:03:48 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1736242442; cv=none; d=zohomail.com; s=zohoarc; b=eSIKb3FBwWW4BudMZrfPtzXn9hAhygE3oou3AuOLy1c1pmWXYUW4tA+dpaFG/Vxy8m7E0fsfOmZl5ImeoArbMgzxbdEcU1eeUvF77iIrvsLT/Z8+p0YIqBVGoptsmmJex+055tkMMTqxO6XWe4cbfroLJK2WozhikAbzAdfBWd0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736242442; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NXMJwJkD6GoreE4rq36bTo/n6oNP+S5NtP/Em4G4kUk=; b=YhPxuSB5FXaRlIs3P0pmExNMdGzH96KXkVs96J8KtI6nm7Lwc03o0X8droKyxsgMvFPO/183odEI9p9J5W2GLHMsh6aQJdwc9SE7dKnXCtEVAoc0Ev7L4UpHaiFxX0XTeVusIESFbhEx+vPQEQiWqGRstr9rXB3yjTNckgNZCo4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1736242442346632.6694459806432; Tue, 7 Jan 2025 01:34:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tV5xT-0005Qb-O6; Tue, 07 Jan 2025 04:33:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tV5xR-0005QD-Sc for qemu-devel@nongnu.org; Tue, 07 Jan 2025 04:33:05 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tV5xQ-0006KD-8s for qemu-devel@nongnu.org; Tue, 07 Jan 2025 04:33:05 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-43621d27adeso105776975e9.2 for ; Tue, 07 Jan 2025 01:33:03 -0800 (PST) Received: from localhost ([84.78.159.3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c8a6abesm49900025f8f.90.2025.01.07.01.33.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2025 01:33:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1736242382; x=1736847182; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NXMJwJkD6GoreE4rq36bTo/n6oNP+S5NtP/Em4G4kUk=; b=H732gq64P26N8HSKGLeDVYPS1UV5KgMAF0F4RixJGJaqZp7knvxr9uH6Unxluk5NlM HU9xLUFB43PKx9zIHsSVqydRcOQRvyXWHICI0x/tdTX7vRuck6IPQPZAHhRsPKYZd1tM 8//5aLAUnwgCQ3rLJrRC6Ct/04eytbeZCeOxQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736242382; x=1736847182; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NXMJwJkD6GoreE4rq36bTo/n6oNP+S5NtP/Em4G4kUk=; b=EUsX/5zPom9YOYTmyshiAo/ydC2AmYeCl59cUpK/npTmOYKH5mQC1/EeXqqzjdlJJ/ BKUqZyD6Wo31WkqJZIhton4qN7GHz2zUl4OZd6dO8cwf+REc6ov6op5jdfvuAlW+y34M WfeyMXIut/AtZgFcbMfPiBII7rkCAPnuYpXDEoebqRyn4ZqPos9Qys4b+6YO4XqLs7QK ky0wb0vZN6hNkCFIKM/TBKiKJgY4jIu8PLHJzQXtS6zRBUAz8cE+QZ7csh+/lH60XBAP QGabHTA/lF3Ko/q7QDHvD9WPcun1LOYy/SfD9UpTPO5QG6Y7lTlOn07MhJTHABlnN5w/ /YJg== X-Gm-Message-State: AOJu0YyX/4O7jXbKF2mCiplIgICEwfalLgQXk3VewYGi1VWA5dx3xJwy eXoIoP9y//4iUJ8CLvDzVG0XMjWuvsJQ6fU/4Jhh2C9hKHokvWZ04yY7GvpGAPTgQt0vkbMK3G4 R X-Gm-Gg: ASbGncs/e0ev78k3W4og7n+1o8JdjUuqY6vYMfEg1qFtD9HiRbLpuPQ8/xexXPVjmlU PK9RmJJQH6v5uDqgFpdmpjK57H2BOn0iI74yr1kzH1cDNLFXkupaGVbtUJh4MivSIP+gWVOi3Sb f6YUwtP3Q5arcvhj2Bcl0z32KGr1FYYG3jafT8yZi9PCz4Ca6nUshnAIpvMK0aj8rZ1XMT2Od+8 mn4l/2h9ZCHI6y5IXrL6BVQNz+9r2o6HFPLtMG0SqY1aHigqaZ82/hYC23JVQ== X-Google-Smtp-Source: AGHT+IEix0l+GrmL6GlNsHgpdBKlhdge3KcJsVrThXIBxIDP7VrUAOxyB//Zy8/3JjeQgqN+VJe5zw== X-Received: by 2002:a05:6000:4012:b0:385:f7a3:fea6 with SMTP id ffacd0b85a97d-38a221fa6bamr42191038f8f.13.1736242382216; Tue, 07 Jan 2025 01:33:02 -0800 (PST) From: Roger Pau Monne To: qemu-devel@nongnu.org Cc: Roger Pau Monne , Stefano Stabellini , Anthony PERARD , Paul Durrant , "Edgar E. Iglesias" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , xen-devel@lists.xenproject.org Subject: [PATCH 2/2] xen: do not use '%ms' scanf specifier Date: Tue, 7 Jan 2025 10:31:40 +0100 Message-ID: <20250107093140.86180-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20250107093140.86180-1-roger.pau@citrix.com> References: <20250107093140.86180-1-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=roger.pau@cloud.com; helo=mail-wm1-x32c.google.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.446, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.179, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1736242444596116600 The 'm' parameter used to request auto-allocation of the destination variab= le is not supported on FreeBSD, and as such leads to failures to parse. What's more, the current usage of '%ms' with xs_node_scanf() is pointless, = as it just leads to a double allocation of the same string. Instead use qemu_xen_xs_read() to read the whole xenstore node. Fixes: a783f8ad4ec9 ('xen: add a mechanism to automatically create XenDevic= e-s...') Fixes: 9b7737469080 ('hw/xen: update Xen console to XenDevice model') Signed-off-by: Roger Pau Monn=C3=A9 --- Cc: Stefano Stabellini Cc: Anthony PERARD Cc: Paul Durrant Cc: "Edgar E. Iglesias" Cc: "Marc-Andr=C3=A9 Lureau" Cc: Paolo Bonzini Cc: xen-devel@lists.xenproject.org --- hw/char/xen_console.c | 11 +++++++++-- hw/xen/xen-bus.c | 7 +++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c index af706c7ef440..18afd214c2f6 100644 --- a/hw/char/xen_console.c +++ b/hw/char/xen_console.c @@ -531,6 +531,7 @@ static void xen_console_device_create(XenBackendInstanc= e *backend, const char *name =3D xen_backend_get_name(backend); unsigned long number; char *fe =3D NULL, *type =3D NULL, *output =3D NULL; + const char *node_path; char label[32]; XenDevice *xendev =3D NULL; XenConsole *con; @@ -550,7 +551,10 @@ static void xen_console_device_create(XenBackendInstan= ce *backend, goto fail; } =20 - if (xs_node_scanf(xsh, XBT_NULL, fe, "type", errp, "%ms", &type) !=3D = 1) { + node_path =3D g_strdup_printf("%s/type", fe); + type =3D qemu_xen_xs_read(xsh, XBT_NULL, node_path, NULL); + g_free(node_path); + if (!type) { error_setg(errp, "failed to read console device type: "); goto fail; } @@ -568,7 +572,10 @@ static void xen_console_device_create(XenBackendInstan= ce *backend, =20 snprintf(label, sizeof(label), "xencons%ld", number); =20 - if (xs_node_scanf(xsh, XBT_NULL, fe, "output", NULL, "%ms", &output) = =3D=3D 1) { + node_path =3D g_strdup_printf("%s/output", fe); + output =3D qemu_xen_xs_read(xsh, XBT_NULL, node_path, NULL); + g_free(node_path); + if (!output) { /* * FIXME: sure we want to support implicit * muxed monitors here? diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c index adfc4efad035..9be807649e77 100644 --- a/hw/xen/xen-bus.c +++ b/hw/xen/xen-bus.c @@ -142,6 +142,7 @@ again: =20 opts =3D qdict_new(); for (i =3D 0; i < n; i++) { + const char *node_path; char *val; =20 /* @@ -156,8 +157,10 @@ again: !strcmp(key[i], "hotplug-status")) continue; =20 - if (xs_node_scanf(xenbus->xsh, tid, path, key[i], NULL, "%ms", - &val) =3D=3D 1) { + node_path =3D g_strdup_printf("%s/%s", path, key[i]); + val =3D qemu_xen_xs_read(xenbus->xsh, tid, node_path, NULL); + g_free(node_path); + if (val) { qdict_put_str(opts, key[i], val); free(val); } --=20 2.46.0