From nobody Sun May 19 03:02:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=reject dis=none) header.from=il.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1673514304; cv=none; d=zohomail.com; s=zohoarc; b=k45ZgE89Dwv3FgT1p0B1PXVRlDrF4l6+CWnBp9L8pcb7Iyrwt7FGU7x9HdgjnvmWn8oGgtvT+ePYemGxr7LwlIdS6jaOI7DxXqL14pDxuUZ+Nk+VQlx7eSuqrvMfR7EsRqLjAWMiyBsy5L0kVlUeSx4mW68fDJngWkrngelGQIg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673514304; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=xdU1QkM0BCraKESHUFvkTXBnlb2uarsr0OlcdnDVpt0=; b=Ws7z6RTYw7442LT+QAdjdsb1nCieRoEX6GKcGuaXvj7UJ86KGsZgjz9XSezDBVqoSsjyY+V4V+ewPIdO1yyKsMDNLmZ8dy9tiG+0VsSqsmolhoE6X1D4Hqq2NrAI+rkMcd5RSrhwPQ0KLosQzVItMlxAmpGmSlSynK87v6RWj+Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=reject dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1673514304524439.74832671118907; Thu, 12 Jan 2023 01:05:04 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-659-xn0uka8PPkuOm1Cmm_oMZw-1; Thu, 12 Jan 2023 04:04:31 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5C5912807D68; Thu, 12 Jan 2023 09:04:28 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id B95F32026D68; Thu, 12 Jan 2023 09:04:27 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8FC271947041; Thu, 12 Jan 2023 09:04:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 13DF81946A78 for ; Thu, 12 Jan 2023 09:04:14 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 5DAC340C2004; Thu, 12 Jan 2023 09:04:14 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5612D40C2064 for ; Thu, 12 Jan 2023 09:04:14 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3A73A1C05192 for ; Thu, 12 Jan 2023 09:04:14 +0000 (UTC) Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-104-BKQ6mpYCObWqmwpbu6QdAg-1; Thu, 12 Jan 2023 04:04:11 -0500 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30C92tdi016107 for ; Thu, 12 Jan 2023 09:04:11 GMT Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3n2f7y012b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 12 Jan 2023 09:04:10 +0000 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 30C6lecH019832 for ; Thu, 12 Jan 2023 09:04:09 GMT Received: from smtprelay04.dal12v.mail.ibm.com ([9.208.130.102]) by ppma02dal.us.ibm.com (PPS) with ESMTPS id 3n1k842c0v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 12 Jan 2023 09:04:09 +0000 Received: from smtpav02.dal12v.mail.ibm.com (smtpav02.dal12v.mail.ibm.com [10.241.53.101]) by smtprelay04.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 30C947Tg55050498 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Jan 2023 09:04:07 GMT Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DE87D58062; Thu, 12 Jan 2023 09:04:06 +0000 (GMT) Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 791435805C; Thu, 12 Jan 2023 09:04:06 +0000 (GMT) Received: from oro.sl.cloud9.ibm.com (unknown [9.59.192.176]) by smtpav02.dal12v.mail.ibm.com (Postfix) with ESMTP; Thu, 12 Jan 2023 09:04:06 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673514303; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=xdU1QkM0BCraKESHUFvkTXBnlb2uarsr0OlcdnDVpt0=; b=VUHykld5Tv4Hr8Mwsk/eHFUiimzrtiwRDzWvqDMMmxJwHnKj70uXCW5tFyYif4cqzqHXPr Iutm0zajBniJka+BXkNAV5BUptRUrHMHYLcSXaOq+R1Lwo+wJhnCB+b7kwb1cQs0BIk8sR BvJhUCFJDozYjMkOHT1HKpULFj/yPaY= X-MC-Unique: xn0uka8PPkuOm1Cmm_oMZw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: BKQ6mpYCObWqmwpbu6QdAg-1 From: Or Ozeri To: libvir-list@redhat.com Subject: [PATCH v1] qemu: block: fix error when blockcopy target is librbd encrypted Date: Thu, 12 Jan 2023 03:04:01 -0600 Message-Id: <20230112090401.2371580-1-oro@il.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: lrj2UyW1SJKwNFuSj1tB_Sk_-_XtchuI X-Proofpoint-GUID: lrj2UyW1SJKwNFuSj1tB_Sk_-_XtchuI X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-12_04,2023-01-11_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 clxscore=1015 phishscore=0 mlxlogscore=624 adultscore=0 mlxscore=0 malwarescore=0 spamscore=0 suspectscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301120059 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: oro@il.ibm.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1673514305681100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Encryption secrets are considered a format dependency, even when being used by the storage node itself, as in the case of using encryption engine=3Dlibrbd. Currently, the storage node is created (blockdev-add) before creating the format dependencies (including encryption secrets). As a result, when trying to perform a blockcopy when the target disk uses librbd encryption, an error of this form is returned: "error: internal error: unable to execute QEMU command 'blockdev-add': No s= ecret with id 'libvirt-5-format-encryption-secret0'" To overcome this error, we change the order of commands so that format dependencies are created BEFORE creating the storage node. Signed-off-by: Or Ozeri --- src/qemu/qemu_block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index e865aa17f9..2aafb2fac7 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1490,9 +1490,9 @@ qemuBlockStorageSourceAttachApply(qemuMonitor *mon, qemuBlockStorageSourceAttachData *data) { if (qemuBlockStorageSourceAttachApplyStorageDeps(mon, data) < 0 || + qemuBlockStorageSourceAttachApplyFormatDeps(mon, data) < 0 || qemuBlockStorageSourceAttachApplyStorage(mon, data) < 0 || qemuBlockStorageSourceAttachApplyStorageSlice(mon, data) < 0 || - qemuBlockStorageSourceAttachApplyFormatDeps(mon, data) < 0 || qemuBlockStorageSourceAttachApplyFormat(mon, data) < 0) return -1; =20 --=20 2.25.1