From nobody Sat May 18 19:24:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.124 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=1675182761; cv=none; d=zohomail.com; s=zohoarc; b=MxhqMjrcwU7vkQK+seBkpeBEQwznecHBWtB1KkidxLh0HYNHU/VKNb+TuIUhu+AFeI0sji703P3V2CIUsNPAsJ046caORBXtgg5RwszZqyt8n1sC3xEA+/2NbchAq8V0NqZyIOkl27KO1Td1tIQgOII99eMwTtRvfVs6F/kl1U4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675182761; 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=cEihl+jxC5yK3rGV8ywFuKW0+wDb5taPZh3h8tgp48Q=; b=iiEANp3nhUWZem9YVwqMaUOIxYJBdkezolp1VEG1XJZ7imrY/PKVynt1LXFASgQebgFlqZokAgYhCRFO/QrTGIFIP+KT+CRDxsDaJ8PC6y2+dzHW/f41T6yIPliDTXoFLgBrVJ3tL4LfHTuEVP85TFWjMY45iATaPo5z/D8d28k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1675182761062183.83170265870933; Tue, 31 Jan 2023 08:32:41 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-509-dTxc--7pPtiJnAm5gOrfsg-1; Tue, 31 Jan 2023 11:32:32 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 953EB91DB86; Tue, 31 Jan 2023 16:32:18 +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 7D050401531B; Tue, 31 Jan 2023 16:32:18 +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 69FFA1946589; Tue, 31 Jan 2023 16:32:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BA7751946587 for ; Tue, 31 Jan 2023 16:32:16 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id AE20E422F2; Tue, 31 Jan 2023 16:32:16 +0000 (UTC) Received: from speedmetal.lan (ovpn-208-29.brq.redhat.com [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 23067175A2 for ; Tue, 31 Jan 2023 16:32:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675182759; 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=cEihl+jxC5yK3rGV8ywFuKW0+wDb5taPZh3h8tgp48Q=; b=JWzOkbf8EF4H8o9XImYAdMuO7h1/N5nlJ4+DBGTUOGMVGtBMM6mrY2aC0AruQYLfpadKSk AurYu4vCyeatd3Mmr7HK488DiZDvrW0zdN8Pul0eIGyH20NX1rYIB4tx8H6Z81BE/8Vrzo M5I196jCD/CXARU5hCNP3uptlezFAVk= X-MC-Unique: dTxc--7pPtiJnAm5gOrfsg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/7] qemu_fd: Remove declaration for 'qemuFDPassNewDirect' Date: Tue, 31 Jan 2023 17:32:07 +0100 Message-Id: <5324ebe99977c179cf7d972ba76f72cdf55e36c2.1675182670.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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: 1675182762214100001 Content-Type: text/plain; charset="utf-8" The function doesn't exist any more. Signed-off-by: Peter Krempa Reviewed-by: Martin Kletzander --- src/qemu/qemu_fd.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/qemu/qemu_fd.h b/src/qemu/qemu_fd.h index 6f165b6be9..032b9442ee 100644 --- a/src/qemu/qemu_fd.h +++ b/src/qemu/qemu_fd.h @@ -30,9 +30,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuFDPass, qemuFDPassFree); qemuFDPass * qemuFDPassNew(const char *prefix, void *dompriv); -qemuFDPass * -qemuFDPassNewDirect(const char *prefix, - void *dompriv); void qemuFDPassAddFD(qemuFDPass *fdpass, --=20 2.39.1 From nobody Sat May 18 19:24:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.124 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=1675182761; cv=none; d=zohomail.com; s=zohoarc; b=iz5qq92gAuVBJn3CkgCQmGFVOw5lMBvlmcuBru5yiaU3Q6RfMQgAWXXd0SY6i76MeVshub4dvC1OmbIaV6iha4xp4bn/w8b+F1Ygawi5SlQY0apCgM96iSMXb9JInES6y/Lp5CSH0rVlCaiw7SycM2QsRz8/KgDuo5jKB+1kMeo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675182761; 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=sj16HG8r/iFX4SskPWFNOYkfmCjlvdBCKmBprIUvQK8=; b=B0K1wuA7D5zQoG0Bp5UOS/X+TfZ4SWgDhPWbyJ9UhFzElV1bhOzE5DUiJe68tm2SMryArWR+i8kKruEFzFQT/5fTBzx0pDbIVxOZpSEnmR0fyGN2rY0FlDnoGSKyifegAPEU8mQFb+CfByhrzj7xQV/FIXJx1m9txNW3DRvy8CQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1675182761152513.636512811995; Tue, 31 Jan 2023 08:32:41 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-593-ciQFij86M9WVeWlLoe2pXA-1; Tue, 31 Jan 2023 11:32:33 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 61CD910294B0; Tue, 31 Jan 2023 16:32:20 +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 4BB842166B33; Tue, 31 Jan 2023 16:32:20 +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 2C2511946589; Tue, 31 Jan 2023 16:32:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 37A101946587 for ; Tue, 31 Jan 2023 16:32:18 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 2A464175A2; Tue, 31 Jan 2023 16:32:18 +0000 (UTC) Received: from speedmetal.lan (ovpn-208-29.brq.redhat.com [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 31A96422FE for ; Tue, 31 Jan 2023 16:32:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675182758; 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=sj16HG8r/iFX4SskPWFNOYkfmCjlvdBCKmBprIUvQK8=; b=BqeZzJTASp/i0jf2XOBxzJX23eymXARsJmJC8QyTOOK3UWIyb8FMKH8CWzBPrGVLGWnjot 80vqLlicXsfn0Fg0LatKLdzvZCRhJOZBMRvLWtFyjLL+iKd448Ak+gpLNCYnzNr7w7wgWS 88UKRFEIWcLfB96hOlG+iukhPvmV4kc= X-MC-Unique: ciQFij86M9WVeWlLoe2pXA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/7] qemuStorageSourcePrivateDataFormat: Rename 'tmp' to 'objectsChildBuf' Date: Tue, 31 Jan 2023 17:32:08 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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: 1675182762225100002 Content-Type: text/plain; charset="utf-8" Be consistent with other children buffer variable naming scheme. Signed-off-by: Peter Krempa Reviewed-by: Martin Kletzander --- src/qemu/qemu_domain.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index c331c2e7be..112d4fb90e 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2005,9 +2005,9 @@ static int qemuStorageSourcePrivateDataFormat(virStorageSource *src, virBuffer *buf) { - g_auto(virBuffer) tmp =3D VIR_BUFFER_INIT_CHILD(buf); qemuDomainStorageSourcePrivate *srcPriv =3D QEMU_DOMAIN_STORAGE_SOURCE= _PRIVATE(src); g_auto(virBuffer) nodenamesChildBuf =3D VIR_BUFFER_INIT_CHILD(buf); + g_auto(virBuffer) objectsChildBuf =3D VIR_BUFFER_INIT_CHILD(buf); virBufferEscapeString(&nodenamesChildBuf, "\n", src->nodestorage); virBufferEscapeString(&nodenamesChildBuf, "\n", src->nodeformat); @@ -2025,16 +2025,16 @@ qemuStorageSourcePrivateDataFormat(virStorageSource= *src, return -1; if (srcPriv) { - qemuStorageSourcePrivateDataFormatSecinfo(&tmp, srcPriv->secinfo, = "auth"); - qemuStorageSourcePrivateDataFormatSecinfo(&tmp, srcPriv->encinfo, = "encryption"); - qemuStorageSourcePrivateDataFormatSecinfo(&tmp, srcPriv->httpcooki= e, "httpcookie"); - qemuStorageSourcePrivateDataFormatSecinfo(&tmp, srcPriv->tlsKeySec= ret, "tlskey"); + qemuStorageSourcePrivateDataFormatSecinfo(&objectsChildBuf, srcPri= v->secinfo, "auth"); + qemuStorageSourcePrivateDataFormatSecinfo(&objectsChildBuf, srcPri= v->encinfo, "encryption"); + qemuStorageSourcePrivateDataFormatSecinfo(&objectsChildBuf, srcPri= v->httpcookie, "httpcookie"); + qemuStorageSourcePrivateDataFormatSecinfo(&objectsChildBuf, srcPri= v->tlsKeySecret, "tlskey"); } if (src->tlsAlias) - virBufferAsprintf(&tmp, "\n", src->tlsAlias= ); + virBufferAsprintf(&objectsChildBuf, "\n", s= rc->tlsAlias); - virXMLFormatElement(buf, "objects", NULL, &tmp); + virXMLFormatElement(buf, "objects", NULL, &objectsChildBuf); if (src->thresholdEventWithIndex) virBufferAddLit(buf, "\n"); --=20 2.39.1 From nobody Sat May 18 19:24:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.124 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=1675182767; cv=none; d=zohomail.com; s=zohoarc; b=DjFh4sKjVxZjUGhnHtAixzAwn4JJogLF34cutv43AWjA5RNh8fU7AVjWy+LduTh+u4uwxXqXU7E2JKMB5s9Kx6pnXcZzZHUiQNBfBxwwAFWmQhMgzNMQXCyn8Az9j9ytxeHFE8aSgET6qCm3hcGsJpW1h63hzTdwcCVQGSdipbA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675182767; 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=EU0hQygKX/aAcWFMt5cgMR9AXSIbl6AR+od0C37sVCo=; b=EKn0DUMlOtfHliim605oZua2SPnWIJZbmftr9yhnd6+n+51LKivEZNxbk+BLiVsFIEObjkgb80UJXQ2B2iprIWE12kuitzy+zFjekDhh9lzhGTJ943ectBu4OF4rgibCfZLHGI+ynY9MRFPfZM7uDBx+0wGoWeWyiCOljMP4JXs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1675182767006128.26217319429713; Tue, 31 Jan 2023 08:32:47 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-433-bBHBmSm0PsyYuulzt1sBwA-1; Tue, 31 Jan 2023 11:32:35 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C2B9810294BB; Tue, 31 Jan 2023 16:32:20 +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 AD39440C2064; Tue, 31 Jan 2023 16:32:20 +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 65B2919465B6; Tue, 31 Jan 2023 16:32:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 83F1C1946587 for ; Tue, 31 Jan 2023 16:32:19 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 759DF43FB3; Tue, 31 Jan 2023 16:32:19 +0000 (UTC) Received: from speedmetal.lan (ovpn-208-29.brq.redhat.com [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id B79B5175A2 for ; Tue, 31 Jan 2023 16:32:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675182766; 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=EU0hQygKX/aAcWFMt5cgMR9AXSIbl6AR+od0C37sVCo=; b=i+BNKx3xAu3Q3uiqC9bOV2Rfd00lW6ZQrDb6BTQS5WHa9+RHgwb6Exw9y0s/WVMKQvIjFF 1R1kVEecG/+UTu2rVhffspC2zQmJ87LoHSYgstF5mUnFQjL5l/3Gudk0AFAYZDOYy8lNGJ 6yyTYx5iQp9C5QX3h4IlfqgHN1+PqcE= X-MC-Unique: bBHBmSm0PsyYuulzt1sBwA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/7] qemu: command: Handle FD passing commandline via qemuBuildBlockStorageSourceAttachDataCommandline Date: Tue, 31 Jan 2023 17:32:09 +0100 Message-Id: <3762f4f21d2593b4f9e6afc600959c958901bbde.1675182670.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: 1675182768388100002 Content-Type: text/plain; charset="utf-8" Copy the pointer to qemuFDPass into struct qemuBlockStorageSourceAttachData so that it can be used from qemuBuildBlockStorageSourceAttachDataCommandline rather than looping again in qemuBuildDiskSourceCommandLineFDs. Signed-off-by: Peter Krempa Reviewed-by: Martin Kletzander --- src/qemu/qemu_block.h | 2 ++ src/qemu/qemu_command.c | 26 +++---------------- .../disk-source-fd.x86_64-latest.args | 6 ++--- 3 files changed, 9 insertions(+), 25 deletions(-) diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h index eac986e0f0..5a61a19da2 100644 --- a/src/qemu/qemu_block.h +++ b/src/qemu/qemu_block.h @@ -99,6 +99,8 @@ struct qemuBlockStorageSourceAttachData { char *tlsAlias; virJSONValue *tlsKeySecretProps; char *tlsKeySecretAlias; + + qemuFDPass *fdpass; }; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 297f53ba84..90dc6b5434 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2125,6 +2125,8 @@ qemuBuildBlockStorageSourceAttachDataCommandline(virC= ommand *cmd, return -1; } + qemuFDPassTransferCommand(data->fdpass, cmd); + if (data->storageProps) { if (!(tmp =3D virJSONValueToString(data->storageProps, false))) return -1; @@ -2153,25 +2155,6 @@ qemuBuildBlockStorageSourceAttachDataCommandline(vir= Command *cmd, } -static int -qemuBuildDiskSourceCommandLineFDs(virCommand *cmd, - virDomainDiskDef *disk) -{ - virStorageSource *n; - - for (n =3D disk->src; virStorageSourceIsBacking(n); n =3D n->backingSt= ore) { - qemuDomainStorageSourcePrivate *srcpriv =3D QEMU_DOMAIN_STORAGE_SO= URCE_PRIVATE(n); - - if (!srcpriv || !srcpriv->fdpass) - continue; - - qemuFDPassTransferCommand(srcpriv->fdpass, cmd); - } - - return 0; -} - - static int qemuBuildDiskSourceCommandLine(virCommand *cmd, virDomainDiskDef *disk, @@ -2189,9 +2172,6 @@ qemuBuildDiskSourceCommandLine(virCommand *cmd, if (virStorageSourceIsEmpty(disk->src)) return 0; - if (qemuBuildDiskSourceCommandLineFDs(cmd, disk) < 0) - return -1; - if (!(data =3D qemuBuildStorageSourceChainAttachPrepareBlockdev(di= sk->src))) return -1; @@ -10654,6 +10634,8 @@ qemuBuildStorageSourceAttachPrepareCommon(virStorag= eSource *src, tlsKeySecretAlias =3D srcpriv->tlsKeySecret->alias; } + + data->fdpass =3D srcpriv->fdpass; } if (src->haveTLS =3D=3D VIR_TRISTATE_BOOL_YES && diff --git a/tests/qemuxml2argvdata/disk-source-fd.x86_64-latest.args b/tes= ts/qemuxml2argvdata/disk-source-fd.x86_64-latest.args index b4a81acfc7..a7ddd65000 100644 --- a/tests/qemuxml2argvdata/disk-source-fd.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-source-fd.x86_64-latest.args @@ -33,13 +33,13 @@ XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config= \ -blockdev '{"driver":"file","filename":"/dev/fdset/2","node-name":"libvirt= -4-storage","auto-read-only":true,"discard":"unmap"}' \ -blockdev '{"node-name":"libvirt-4-format","read-only":false,"driver":"qco= w2","file":"libvirt-4-storage"}' \ -device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x2","drive":"li= bvirt-4-format","id":"virtio-disk4","bootindex":1}' \ --add-fd set=3D0,fd=3D704,opaque=3Dlibvirt-1-storage0 \ --add-fd set=3D1,fd=3D777,opaque=3Dlibvirt-2-storage0 \ --add-fd set=3D1,fd=3D778,opaque=3Dlibvirt-2-storage1 \ -blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/rhel7.1484= 071876","node-name":"libvirt-3-storage","auto-read-only":true,"discard":"un= map"}' \ -blockdev '{"node-name":"libvirt-3-format","read-only":true,"driver":"qcow= 2","file":"libvirt-3-storage","backing":null}' \ +-add-fd set=3D1,fd=3D777,opaque=3Dlibvirt-2-storage0 \ +-add-fd set=3D1,fd=3D778,opaque=3Dlibvirt-2-storage1 \ -blockdev '{"driver":"file","filename":"/dev/fdset/1","node-name":"libvirt= -2-storage","auto-read-only":true,"discard":"unmap"}' \ -blockdev '{"node-name":"libvirt-2-format","read-only":true,"driver":"qcow= 2","file":"libvirt-2-storage","backing":"libvirt-3-format"}' \ +-add-fd set=3D0,fd=3D704,opaque=3Dlibvirt-1-storage0 \ -blockdev '{"driver":"file","filename":"/dev/fdset/0","node-name":"libvirt= -1-storage","read-only":false,"discard":"unmap"}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qco= w2","file":"libvirt-1-storage","backing":"libvirt-2-format"}' \ -device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x3","drive":"li= bvirt-1-format","id":"virtio-disk5"}' \ --=20 2.39.1 From nobody Sat May 18 19:24:23 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1675182787; cv=none; d=zohomail.com; s=zohoarc; b=nsv6e5xmK5ZO1qDikem/i7Oc/XuiVzZWMmCVSEwJlf0xxukyeH27hExKGGNON/9zeSTGwxxo0V2xmiM6Ibj3d3MjLvHNGPGtoEmEkc2t/x5qQodvLmPga1S0VIiXjwLK94lD31PxJCL5aTq7rbqP2KgCaIYnrpWYZbtPpcp3zng= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675182787; 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=BRt121TIKVCKR8pWZC+5bN9pSDrf8MA0U2SNeMfnbtc=; b=ZfA4QQDtDrnIqtMLNGRTYnlJwRdBXT1lradT6Prf0+vaYeHY+pWO74/q3l5VaEM7gz6ffNXbm1aer/DDNnVc7f8b5puTtZgz3Oo8ZBd727LL/TTBCKQ/MdyhS56NodBJbkzUj4fWtzcQCsLIU+ybOHWjUaKnuYqlHV+xwgrDr4w= 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=pass header.from= (p=none 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 1675182787854618.2477119501535; Tue, 31 Jan 2023 08:33:07 -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-259-ekVSuy1QN-CHXXrRAfCLmA-1; Tue, 31 Jan 2023 11:32:49 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D35D53C41A0E; Tue, 31 Jan 2023 16:32:21 +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 C0055140EBF4; Tue, 31 Jan 2023 16:32:21 +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 9FB9B1946589; Tue, 31 Jan 2023 16:32:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E85FF1946587 for ; Tue, 31 Jan 2023 16:32:20 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id DC354175A2; Tue, 31 Jan 2023 16:32:20 +0000 (UTC) Received: from speedmetal.lan (ovpn-208-29.brq.redhat.com [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id DB1E5422F2 for ; Tue, 31 Jan 2023 16:32:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675182786; 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=BRt121TIKVCKR8pWZC+5bN9pSDrf8MA0U2SNeMfnbtc=; b=Obv+U+HGO3crE5MXtABRyiCFp2+lPxCDWwcGX/sdFLSEpcq/qiJb8X+TwV0Ak1yLy65wGp h9dnfhFBCita2qnSMHNK1d9wgxq0W4Hzz1UlUVuZV0H6BA8icAwXh8vOV+Bxafnvx9SGC3 nivbUmgFIEgbE2vzTR3uPRaBKRqIYNA= X-MC-Unique: ekVSuy1QN-CHXXrRAfCLmA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 4/7] qemuFDPassTransferCommand: Mark that FD was passed Date: Tue, 31 Jan 2023 17:32:10 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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: 1675182788278100001 Content-Type: text/plain; charset="utf-8" Until now the code didn't expect that we'd want to rollback/detach a FD passed on the commandline, but whith disk backend FD passing this can happen. Properly mark the 'qemuFDPass' object as passed to qemu even when it was done on the commandline. Signed-off-by: Peter Krempa Reviewed-by: Martin Kletzander --- src/qemu/qemu_fd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qemu/qemu_fd.c b/src/qemu/qemu_fd.c index 51a8133fde..ebeeb65505 100644 --- a/src/qemu/qemu_fd.c +++ b/src/qemu/qemu_fd.c @@ -151,6 +151,8 @@ qemuFDPassTransferCommand(qemuFDPass *fdpass, fdpass->fds[i].fd =3D -1; virCommandAddArgList(cmd, "-add-fd", arg, NULL); } + + fdpass->passed =3D true; } --=20 2.39.1 From nobody Sat May 18 19:24:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.124 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=1675182781; cv=none; d=zohomail.com; s=zohoarc; b=BIiM2GvVbEjnixv+Cnqngv6ZbLM+pdN/yAw/4whZM+/WefoMxr2+O9xay67k5zIZGSPmKwID7B/ka7LUOQGxAX0bXMOiU6Q1ITNQv+gLRSzTdJTFyhudx5bYW4jSGVSvphS1Do8cy5ZdvqvpgdprRD3KHn9ww+4lW/xi0y+0o/A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675182781; 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=5g3u5Q36L8U3mQT/wjQoZslAgTuwN1iVgbZwWrKcW2o=; b=YH9ykcUMDmh8RKl4lTt3db6/zyJDk/466eJjK07ornuXoCXib/kUvmJITuoZc0c+ajuOSM2uWa+yAkJvx52AOnnamOgbkY+5fu3oT1uu7bkvEBgm+6I0uFEPba9KPvNZgdpLtPeWO+Qp/AxtdTzjDGaGCUDQLpceWK7rjax2+8g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1675182781031632.446528415813; Tue, 31 Jan 2023 08:33:01 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-45-QOjAXys-M0S7lTN7-7vbsQ-1; Tue, 31 Jan 2023 11:32:47 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 18A8D1818E46; Tue, 31 Jan 2023 16:32:26 +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 058AE2166B33; Tue, 31 Jan 2023 16:32:26 +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 D7EC01946589; Tue, 31 Jan 2023 16:32:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D706D1946587 for ; Tue, 31 Jan 2023 16:32:22 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id BBA4E175A2; Tue, 31 Jan 2023 16:32:22 +0000 (UTC) Received: from speedmetal.lan (ovpn-208-29.brq.redhat.com [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id B51ED43FB3 for ; Tue, 31 Jan 2023 16:32:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675182780; 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=5g3u5Q36L8U3mQT/wjQoZslAgTuwN1iVgbZwWrKcW2o=; b=Q+6UNiYQjYLfFeGC0mNUvWoF4UntIgfiPB9SCuf19KgdqeQl/NHa0SjG3dQ6PR6+HWRO8M 6l6yULPHacpoY6Dzcs+xvXOzq3CUo5li52rZtotzu3XrodkQbB3fwukThsUN9pkAszgquM E6PYXHTm22lJqc20IZWb4eeKZDw7qlI= X-MC-Unique: QOjAXys-M0S7lTN7-7vbsQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 5/7] qemu: fd: Add helpers allowing storing FD set data in status XML Date: Tue, 31 Jan 2023 17:32:11 +0100 Message-Id: <70b4e9f4371c0351588b1c7074ba3cdc28ccb95a.1675182670.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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: 1675182782248100001 Content-Type: text/plain; charset="utf-8" Rollback of FD sets passed to qemu is also needed after possible restart of libvirtd when we need to serialize the data into status XML. For this purpose we need to access the fdset ID once it was passed to qemu and potentially re-create a 'qemuFDPass' struct in passed state. Introduce 'qemuFDPassNewPassed' and 'qemuFDPassIsPassed'. Signed-off-by: Peter Krempa Reviewed-by: Martin Kletzander --- src/qemu/qemu_fd.c | 41 +++++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_fd.h | 7 +++++++ 2 files changed, 48 insertions(+) diff --git a/src/qemu/qemu_fd.c b/src/qemu/qemu_fd.c index ebeeb65505..9eaaa098ee 100644 --- a/src/qemu/qemu_fd.c +++ b/src/qemu/qemu_fd.c @@ -96,6 +96,47 @@ qemuFDPassNew(const char *prefix, } +/** + * qemuFDPassNewPassed: + * @fdSetID: ID of an FDset which was allready passed to qemu + * + * Create qemuFDPass pointing to an already passed FD. Useful to usw with + * qemuFDPassTransferMonitorRollback, when restoring after restart. + */ +qemuFDPass * +qemuFDPassNewPassed(unsigned int fdSetID) +{ + qemuFDPass *fdpass =3D g_new0(qemuFDPass, 1); + + fdpass->fdSetID =3D fdSetID; + fdpass->passed =3D true; + + return fdpass; +} + + +/** + * qemuFDPassIsPassed: + * @fdpass: The fd passing helper struct + * @id: when non-NULL filled with the fdset ID + * + * Returns true if @fdpass was passed to qemu. In such case @id is also fi= lled + * with the ID of the fdset if non-NULL. + */ +bool +qemuFDPassIsPassed(qemuFDPass *fdpass, + unsigned *id) +{ + if (!fdpass) + return false; + + if (id) + *id =3D fdpass->fdSetID; + + return true; +} + + /** * qemuFDPassAddFD: * @fdpass: The fd passing helper struct diff --git a/src/qemu/qemu_fd.h b/src/qemu/qemu_fd.h index 032b9442ee..cd0ff2c690 100644 --- a/src/qemu/qemu_fd.h +++ b/src/qemu/qemu_fd.h @@ -31,6 +31,13 @@ qemuFDPass * qemuFDPassNew(const char *prefix, void *dompriv); +qemuFDPass * +qemuFDPassNewPassed(unsigned int fdSetID); + +bool +qemuFDPassIsPassed(qemuFDPass *fdpass, + unsigned *id); + void qemuFDPassAddFD(qemuFDPass *fdpass, int *fd, --=20 2.39.1 From nobody Sat May 18 19:24:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.124 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=1675182768; cv=none; d=zohomail.com; s=zohoarc; b=eIxjSufaWdX051AAzt+u6jrV5KG1WPTkShV0Lnn6OM0Fn2wVTxCFIjp7y82LHgaPPzaewLmY1rq5X5W2TxFzy1kLL+Ye36CheYyAS+onm5tXnQLH8+iK83lkR7AdT04s9YAis8fKraJ46q9MHHQ/loPc8c+9T/IL1Y52fuLgW6g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675182768; 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=zJxfH41BrHeUM/z5zL5xCagF+NIpw+7YfltCgSNsM+o=; b=P8wCkSoRBnpDd+zZOC9RPGrjckhJXy8UlJzgxNe1ABfYQLeRAm1kAB2EFfIHGdyZ1shzCFdKVzRBcbH9kk1CNxRoIuihyc8ff3OusliYrCZsbJngWuB0zG4eDn/YmrqrGwuaOvhXD5yntg+iFqPbgtKxJKYyUhuyPXlF5gKOszc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1675182768082589.5727357005992; Tue, 31 Jan 2023 08:32:48 -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-173-Cbf2BO5pPemrZVXn6XI_lA-1; Tue, 31 Jan 2023 11:32:41 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 918AE28036F9; Tue, 31 Jan 2023 16:32:26 +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 79BF14085722; Tue, 31 Jan 2023 16:32:26 +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 1BE3E19465B6; Tue, 31 Jan 2023 16:32:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 999211946587 for ; Tue, 31 Jan 2023 16:32:24 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 7DB38422FE; Tue, 31 Jan 2023 16:32:24 +0000 (UTC) Received: from speedmetal.lan (ovpn-208-29.brq.redhat.com [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9BD5B175A2 for ; Tue, 31 Jan 2023 16:32:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675182767; 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=zJxfH41BrHeUM/z5zL5xCagF+NIpw+7YfltCgSNsM+o=; b=XgekHEVjjhHPIm8+XXLknmmY9TofMivTH17An1tr1Hp3dzZ4ZIkqyEkUt5ZRJWJyUbFoF1 u7oylFxuiN8SC7vSII/kLxx+Bw9YjpIsyoUXZKWN+e+k7mMUilBtW3CZqTvtOACqvKN3zr eVdCmKti6lrc41dUNIIwHDVmYbT4wTs= X-MC-Unique: Cbf2BO5pPemrZVXn6XI_lA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 6/7] qemu: domain: Store fdset ID for disks passed to qemu via FD Date: Tue, 31 Jan 2023 17:32:12 +0100 Message-Id: <00e24973acd1e2e3d3388ca48a7ecdf24a38b081.1675182670.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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: 1675182770201100005 Content-Type: text/plain; charset="utf-8" To ensure that we can hot-unplug the disk including the associated fdset we need to store the fdset ID in the status XML. Signed-off-by: Peter Krempa Reviewed-by: Martin Kletzander --- src/qemu/qemu_domain.c | 17 ++++++++++++++++- tests/qemustatusxml2xmldata/modern-in.xml | 3 +++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 112d4fb90e..1757a6aaad 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1941,6 +1941,8 @@ qemuStorageSourcePrivateDataParse(xmlXPathContextPtr = ctxt, g_autofree char *httpcookiealias =3D NULL; g_autofree char *tlskeyalias =3D NULL; g_autofree char *thresholdEventWithIndex =3D NULL; + bool fdsetPresent =3D false; + unsigned int fdSetID; src->nodestorage =3D virXPathString("string(./nodenames/nodename[@type= =3D'storage']/@name)", ctxt); src->nodeformat =3D virXPathString("string(./nodenames/nodename[@type= =3D'format']/@name)", ctxt); @@ -1957,7 +1959,9 @@ qemuStorageSourcePrivateDataParse(xmlXPathContextPtr = ctxt, httpcookiealias =3D virXPathString("string(./objects/secret[@type=3D'h= ttpcookie']/@alias)", ctxt); tlskeyalias =3D virXPathString("string(./objects/secret[@type=3D'tlske= y']/@alias)", ctxt); - if (authalias || encalias || httpcookiealias || tlskeyalias) { + fdsetPresent =3D virXPathUInt("string(./fdsets/fdset[@type=3D'storage'= ]/@id)", ctxt, &fdSetID) =3D=3D 0; + + if (authalias || encalias || httpcookiealias || tlskeyalias || fdsetPr= esent) { if (!src->privateData && !(src->privateData =3D qemuDomainStorageSourcePrivateNew())) return -1; @@ -1975,6 +1979,9 @@ qemuStorageSourcePrivateDataParse(xmlXPathContextPtr = ctxt, if (qemuStorageSourcePrivateDataAssignSecinfo(&priv->tlsKeySecret,= &tlskeyalias) < 0) return -1; + + if (fdsetPresent) + priv->fdpass =3D qemuFDPassNewPassed(fdSetID); } if (virStorageSourcePrivateDataParseRelPath(ctxt, src) < 0) @@ -2008,6 +2015,7 @@ qemuStorageSourcePrivateDataFormat(virStorageSource *= src, qemuDomainStorageSourcePrivate *srcPriv =3D QEMU_DOMAIN_STORAGE_SOURCE= _PRIVATE(src); g_auto(virBuffer) nodenamesChildBuf =3D VIR_BUFFER_INIT_CHILD(buf); g_auto(virBuffer) objectsChildBuf =3D VIR_BUFFER_INIT_CHILD(buf); + g_auto(virBuffer) fdsetsChildBuf =3D VIR_BUFFER_INIT_CHILD(buf); virBufferEscapeString(&nodenamesChildBuf, "\n", src->nodestorage); virBufferEscapeString(&nodenamesChildBuf, "\n", src->nodeformat); @@ -2025,10 +2033,15 @@ qemuStorageSourcePrivateDataFormat(virStorageSource= *src, return -1; if (srcPriv) { + unsigned int fdSetID; + qemuStorageSourcePrivateDataFormatSecinfo(&objectsChildBuf, srcPri= v->secinfo, "auth"); qemuStorageSourcePrivateDataFormatSecinfo(&objectsChildBuf, srcPri= v->encinfo, "encryption"); qemuStorageSourcePrivateDataFormatSecinfo(&objectsChildBuf, srcPri= v->httpcookie, "httpcookie"); qemuStorageSourcePrivateDataFormatSecinfo(&objectsChildBuf, srcPri= v->tlsKeySecret, "tlskey"); + + if (qemuFDPassIsPassed(srcPriv->fdpass, &fdSetID)) + virBufferAsprintf(&fdsetsChildBuf, "\n", fdSetID); } if (src->tlsAlias) @@ -2036,6 +2049,8 @@ qemuStorageSourcePrivateDataFormat(virStorageSource *= src, virXMLFormatElement(buf, "objects", NULL, &objectsChildBuf); + virXMLFormatElement(buf, "fdsets", NULL, &fdsetsChildBuf); + if (src->thresholdEventWithIndex) virBufferAddLit(buf, "\n"); diff --git a/tests/qemustatusxml2xmldata/modern-in.xml b/tests/qemustatusxm= l2xmldata/modern-in.xml index 7759034f7a..f5beab722b 100644 --- a/tests/qemustatusxml2xmldata/modern-in.xml +++ b/tests/qemustatusxml2xmldata/modern-in.xml @@ -341,6 +341,9 @@ + + + --=20 2.39.1 From nobody Sat May 18 19:24:23 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1675182763; cv=none; d=zohomail.com; s=zohoarc; b=cfqTMy0B++jiYgtNIz316Wvv9XscDeML+hzJ5AOdnQ8Pw//vEQ0WqqmT5Qx1D+p38PJM7aB4e10ATRlvFRbSyH2u7cnkv6pVDZyeia78WGwTdb94XpTqKM+HMAPzHYTFv7tGtpZdDytYGfM84JgfIVH5iPDecm+rZ9hQaZ0wQN0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675182763; 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=PLo0vLRljX5SobSGWY4KRM2xpcmhWr3rHHvq3NFBQ2M=; b=Geuse+Rvh/VItFrJbFtjKal+7YERYPQ8hRo1VCpYpRX203aVbvXG5kfxMmZ9RXA3ZAelcpVmgg3kfQ0dvy/gRUcLi5ekgZGgZlXeq5aFvzqqJ7cR3gR16PNy0wbzn0caN9RKPCQvmBuzxp+BrLzywZX6kL6uSLSK7ESBp3HC2g8= 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=pass header.from= (p=none 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 1675182763218735.5252576759826; Tue, 31 Jan 2023 08:32:43 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-600-Ala59krFOPOlcAMMb1FvMw-1; Tue, 31 Jan 2023 11:32:35 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 88E1088B506; Tue, 31 Jan 2023 16:32: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 76585492C3E; Tue, 31 Jan 2023 16:32:28 +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 67DBF194658F; Tue, 31 Jan 2023 16:32:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9AF4A1946589 for ; Tue, 31 Jan 2023 16:32:25 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 90808422F2; Tue, 31 Jan 2023 16:32:25 +0000 (UTC) Received: from speedmetal.lan (ovpn-208-29.brq.redhat.com [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id E3AE6175A2 for ; Tue, 31 Jan 2023 16:32:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675182762; 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=PLo0vLRljX5SobSGWY4KRM2xpcmhWr3rHHvq3NFBQ2M=; b=RAa1imaDdgmdGWEbPO1c/ZsqNEbTF5nGIXUI18TaXDU4wIgct0tihSIRC7s/JUahJ5Bv6B DhG/be8PIKU2eRz3IyODl1kSY+lMiHEa/FEO5woA3quLLIiYYpUWffc/5vV+8ZV6hUsWxA k/bEWWbsdjquCb53bT9dygCklEyym5c= X-MC-Unique: Ala59krFOPOlcAMMb1FvMw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 7/7] qemu: block: Properly handle FD-passed disk hot-(un-)plug Date: Tue, 31 Jan 2023 17:32:13 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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: 1675182764259100005 Content-Type: text/plain; charset="utf-8" The hotplug code paths need to be able to pass the FDs to the monitor to ensure that hotplug works. Signed-off-by: Peter Krempa Reviewed-by: Martin Kletzander --- 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 e865aa17f9..c218262691 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1410,6 +1410,9 @@ qemuBlockStorageSourceAttachApplyStorageDeps(qemuMoni= tor *mon, qemuMonitorAddObject(mon, &data->tlsProps, &data->tlsAlias) < 0) return -1; + if (qemuFDPassTransferMonitor(data->fdpass, mon) < 0) + return -1; + return 0; } @@ -1559,6 +1562,8 @@ qemuBlockStorageSourceAttachRollback(qemuMonitor *mon, if (data->tlsKeySecretAlias) ignore_value(qemuMonitorDelObject(mon, data->tlsKeySecretAlias, fa= lse)); + qemuFDPassTransferMonitorRollback(data->fdpass, mon); + virErrorRestore(&orig_err); } @@ -1609,6 +1614,8 @@ qemuBlockStorageSourceDetachPrepare(virStorageSource = *src) if (srcpriv->tlsKeySecret) data->tlsKeySecretAlias =3D g_strdup(srcpriv->tlsKeySecret->al= ias); + + data->fdpass =3D srcpriv->fdpass; } return g_steal_pointer(&data); --=20 2.39.1