From patchwork Wed Oct 24 14:14:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Yi" X-Patchwork-Id: 10654299 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 827E314BD for ; Wed, 24 Oct 2018 07:37:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 683C22A6C8 for ; Wed, 24 Oct 2018 07:37:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C5822A6CA; Wed, 24 Oct 2018 07:37:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=2.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D223B2A6C8 for ; Wed, 24 Oct 2018 07:37:58 +0000 (UTC) Received: from localhost ([::1]:46488 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFDjp-0008SZ-TX for patchwork-qemu-devel@patchwork.kernel.org; Wed, 24 Oct 2018 03:37:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFDhg-0006KY-AJ for qemu-devel@nongnu.org; Wed, 24 Oct 2018 03:35:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gFDhc-0005Rj-SQ for qemu-devel@nongnu.org; Wed, 24 Oct 2018 03:35:44 -0400 Received: from mga09.intel.com ([134.134.136.24]:21197) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gFDhb-0005H1-U0 for qemu-devel@nongnu.org; Wed, 24 Oct 2018 03:35:40 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Oct 2018 00:35:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,419,1534834800"; d="scan'208";a="98083800" Received: from linux.intel.com ([10.54.29.200]) by fmsmga002.fm.intel.com with ESMTP; 24 Oct 2018 00:35:26 -0700 Received: from dazhang1-ssd.sh.intel.com (dazhang1-ssd.sh.intel.com [10.239.48.128]) by linux.intel.com (Postfix) with ESMTP id 5D35B5802E4; Wed, 24 Oct 2018 00:35:24 -0700 (PDT) From: Zhang Yi To: mst@redhat.com, peter.maydell@linaro.org, yu.c.zhang@linux.intel.com, ehabkost@redhat.com, imammedo@redhat.com Date: Wed, 24 Oct 2018 22:14:56 +0800 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.24 Subject: [Qemu-devel] [PATCH 1/1] hostmem-file: remove the invalid pmem object id. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: xiaoguangrong.eric@gmail.com, crosthwaite.peter@gmail.com, richard.henderson@linaro.org, qemu-devel@nongnu.org, Zhang Yi , stefanha@redhat.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP We will never get the canonical path from the object before object_property_add_child. Signed-off-by: Zhang Yi --- backends/hostmem-file.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index 639c8d4..9691c48 100644 --- a/backends/hostmem-file.c +++ b/backends/hostmem-file.c @@ -145,26 +145,20 @@ static void file_memory_backend_set_pmem(Object *o, bool value, Error **errp) HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(o); if (host_memory_backend_mr_inited(backend)) { - char *path = object_get_canonical_path_component(o); - error_setg(errp, "cannot change property 'pmem' of %s '%s'", - object_get_typename(o), - path); - g_free(path); + error_setg(errp, "cannot change property 'pmem' of %s.", + object_get_typename(o)); return; } #ifndef CONFIG_LIBPMEM if (value) { Error *local_err = NULL; - char *path = object_get_canonical_path_component(o); error_setg(&local_err, "Lack of libpmem support while setting the 'pmem=on'" - " of %s '%s'. We can't ensure data persistence.", - object_get_typename(o), - path); - g_free(path); + " of %s. We can't ensure data persistence.", + object_get_typename(o)); error_propagate(errp, local_err); return; }