From nobody Mon Feb 9 01:06:28 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1583771052; cv=none; d=zohomail.com; s=zohoarc; b=TSsHjOysSm9Gu64XYgeASAijHFLxw9vC3ZFlwcbDAkRJSlJZJJ4CwnVMSLWIjGyWJ+UXwOD4SmrRiNiib/rZ3h5/VtMbZUxUrb0IqW5di4+IIThl0rZzP5gGuu6TfkKxtPGloageqvVdzmLaNKEdxjlLC5A8FEJ5lnZll3lS740= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583771052; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HoiygD0eCW2Sv2RPjm0CowPNVR0rAstmVYIDOjxLgoQ=; b=Sd3Bv8XDVeLPVVqYjDxlL1PX5/Cu0BbIkVe94NqXUG1h2zgKaV0DepiOOnRPqP7HKToWAjLGPZSZasUvZon17NjJA6dgpWpgRgE7N9GOp69Pz5mFYuo1LmlV5j/gOXzTaydDCXXGdYCnG6+gbBVVmuQiXWJECdYrUgoRrIIEt6Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1583771052107638.5585594334798; Mon, 9 Mar 2020 09:24:12 -0700 (PDT) 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-231-KzqFaT_SNX-7qGaCMF8X9w-1; Mon, 09 Mar 2020 12:24:08 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6E3D0DB63; Mon, 9 Mar 2020 16:23:59 +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 449C55C3F8; Mon, 9 Mar 2020 16:23:59 +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 E1C4986A1F; Mon, 9 Mar 2020 16:23:58 +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 029GNSQu020827 for ; Mon, 9 Mar 2020 12:23:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0708790779; Mon, 9 Mar 2020 16:23:28 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 822A39051C for ; Mon, 9 Mar 2020 16:23:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583771051; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=HoiygD0eCW2Sv2RPjm0CowPNVR0rAstmVYIDOjxLgoQ=; b=BasvCggk9A6rRyE/5hBiwxv2I+iCw4xNwCj0VXhAPX38tIcjQ4IOyIi1qUSo30zos3AQXi ii8UAAit4QQDBH7G2Dnmc4gcngvGLCFw//PLpTM4r5vT5uOJheXZsH18GS13XFm5ylEehh maqOSdfS6aBfzYEazfiSnX6iQsi26H4= X-MC-Unique: KzqFaT_SNX-7qGaCMF8X9w-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 16/30] qemuDomainValidateStorageSource: Validate new network storage parameters Date: Mon, 9 Mar 2020 17:22:56 +0100 Message-Id: <1b2f4bd23d4b6c7565803b8436fa9230b118fab3.1583770683.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.79 on 10.5.11.16 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" Ensure that the new fields are allowed only when -blockdev is used or when they are in the detected part of the backing chain where qemu will handle them internally. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 55 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 1d551f248f..e7aaded4d5 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6881,6 +6881,61 @@ qemuDomainValidateStorageSource(virStorageSourcePtr = src, } } + if (src->sslverify !=3D VIR_TRISTATE_BOOL_ABSENT) { + if (actualType !=3D VIR_STORAGE_TYPE_NETWORK || + (src->protocol !=3D VIR_STORAGE_NET_PROTOCOL_HTTPS && + src->protocol !=3D VIR_STORAGE_NET_PROTOCOL_FTPS)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("ssl verification is supported only with HTTP= S/FTPS protocol")); + return -1; + } + + if (!src->detected && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("ssl verification setting is not supported by= this QEMU binary")); + return -1; + } + } + + if (src->ncookies > 0) { + if (actualType !=3D VIR_STORAGE_TYPE_NETWORK || + (src->protocol !=3D VIR_STORAGE_NET_PROTOCOL_HTTPS && + src->protocol !=3D VIR_STORAGE_NET_PROTOCOL_HTTP)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("http cookies are supported only with HTTP(S)= protocol")); + return -1; + } + + if (!src->detected && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("http cookies are not supported by this QEMU = binary")); + return -1; + } + + if (virStorageSourceNetCookiesValidate(src) < 0) + return -1; + } + + if (src->readahead > 0) { + if (!src->detected && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("readahead setting is not supported by this Q= EMU binary")); + return -1; + } + } + + if (src->timeout > 0) { + if (!src->detected && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("timeout setting is not supported by this QEM= U binary")); + return -1; + } + } + return 0; } --=20 2.24.1