From nobody Sat Apr 20 00:37:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 15809810899311001.8224332828748; Thu, 6 Feb 2020 01:24:49 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-130-BTKs6EjsMjiCKmzZm4MqVg-1; Thu, 06 Feb 2020 04:24:46 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 58E798018A1; Thu, 6 Feb 2020 09:24:41 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 269311A7E3; Thu, 6 Feb 2020 09:24:40 +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 C9F5A8173B; Thu, 6 Feb 2020 09:24:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0169OZQT013395 for ; Thu, 6 Feb 2020 04:24:35 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1B60B60C05; Thu, 6 Feb 2020 09:24:35 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9807160BF7 for ; Thu, 6 Feb 2020 09:24:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580981088; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=GWrXORy3zyTJQKfwK2hVUU8T2hAazwm4MZJmc6QWPO8=; b=At1tb1Ko+m9QUAp13BEDBaWIbu/mrbna6kI7kNA1ffJH9RaYpXXxqHjeDdzkZpns/Hxelj JvYZjPPbmgC6vDImfKa4DeYAa5u8FC66CPAiT6jusb26sCpPZv0ZuN7AT8ONf6ENQAR5QC M8WQ3JaU/wXhQMPRvlTGyb24C7+KfCU= From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH] qemuBlockStorageSourceGetBackendProps: Report errors on all switch cases Date: Thu, 6 Feb 2020 10:24:31 +0100 Message-Id: <302e9b7f7dccff42b133168b9371a73f2c23fc0b.1580981070.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: BTKs6EjsMjiCKmzZm4MqVg-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Few switch cases returned failure but didn't report an error. For a situation when the backingStore type=3D'volume' was not translated the following error would occur: $ virsh start VM error: Failed to start domain VM error: An error occurred, but the cause is unknown After this patch: $ virsh start VM error: Failed to start domain VM error: internal error: storage source pool 'tmp' volume 'pull3.qcow2' is n= ot translated Signed-off-by: Peter Krempa Reviewed-by: Erik Skultety Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 63116ef5f2..0ee10dd770 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1081,8 +1081,14 @@ qemuBlockStorageSourceGetBackendProps(virStorageSour= cePtr src, break; case VIR_STORAGE_TYPE_VOLUME: + virReportError(VIR_ERR_INTERNAL_ERROR, + _("storage source pool '%s' volume '%s' is not tran= slated"), + src->srcpool->pool, src->srcpool->volume); + return NULL; + case VIR_STORAGE_TYPE_NONE: case VIR_STORAGE_TYPE_LAST: + virReportEnumRangeError(virStorageType, actualType); return NULL; case VIR_STORAGE_TYPE_NETWORK: @@ -1141,6 +1147,7 @@ qemuBlockStorageSourceGetBackendProps(virStorageSourc= ePtr src, case VIR_STORAGE_NET_PROTOCOL_NONE: case VIR_STORAGE_NET_PROTOCOL_LAST: + virReportEnumRangeError(virStorageNetProtocol, src->protocol); return NULL; } break; --=20 2.24.1