From nobody Fri Apr 26 15:02:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559582157; cv=none; d=zoho.com; s=zohoarc; b=lvVnYFvE3XQhfsWPluK5t/FvYRxSaxZZzu4e9qyhHs96dxqiB28JJURddmux/Zp4fK1bAq/FQAWCNVrZRA/mOvjOMQI12BoBh3UL+Scn2csYJHqcCycY8EsF192zHFH1K4H1B/YuDPGaGXULL5C7KJDfEW6C6JiJRTAZD016AI0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559582157; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=WFkUnr8MWITqlTGVjr8HiLOkJErhCw+DrrzdxAnK7vw=; b=al1vyIZCBN55N1ajtU3jVKHy0l2vcNN92HD+0hh08HFh76dVUO6Oep0kWZCmn42OnvCX3K7XgNkCHmoTsWdEFP4Vqaf7M/a/DdPKujGDgb+8HcAFqXJbCg/WT9DBXYP9ouTIp4glgTBuBVA7ykMHR+iqiPeQJNtIoI23y8BprEw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1559582157143663.9337327303218; Mon, 3 Jun 2019 10:15:57 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5EB368112A; Mon, 3 Jun 2019 17:15:14 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1CE5C17DD4; Mon, 3 Jun 2019 17:15:01 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 495AB1806B18; Mon, 3 Jun 2019 17:14:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x53HEgxW032074 for ; Mon, 3 Jun 2019 13:14:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 02BC617CC0; Mon, 3 Jun 2019 17:14:42 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 80A856090E for ; Mon, 3 Jun 2019 17:14:39 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Mon, 3 Jun 2019 19:14:37 +0200 Message-Id: <20190603171437.23878-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] util: Propagate numad failures correctly X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 03 Jun 2019 17:15:55 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Right now, if numad fails, we raise an error but return an empty string to the caller instead of a NULL pointer, which means processing will continue and the user will see # virsh start guest error: Failed to start domain guest error: invalid argument: Failed to parse bitmap '' instead of a more reasonable # virsh start guest error: Failed to start domain guest error: operation failed: Failed to query numad for the advisory nodeset Make sure the user gets a better error message. https://bugzilla.redhat.com/show_bug.cgi?id=3D1716387 Signed-off-by: Andrea Bolognani Reviewed-by: Daniel Henrique Barboza Reviewed-by: J=C3=A1n Tomko --- src/util/virnuma.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/util/virnuma.c b/src/util/virnuma.c index dd3fb7519e..fee0dfcd5a 100644 --- a/src/util/virnuma.c +++ b/src/util/virnuma.c @@ -66,10 +66,12 @@ virNumaGetAutoPlacementAdvice(unsigned short vcpus, =20 virCommandSetOutputBuffer(cmd, &output); =20 - if (virCommandRun(cmd, NULL) < 0) - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + if (virCommandRun(cmd, NULL) < 0) { + virReportError(VIR_ERR_OPERATION_FAILED, "%s", _("Failed to query numad for the " "advisory nodeset")); + VIR_FREE(output); + } =20 return output; } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list