From nobody Tue May 14 07:51:22 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=1644832820; cv=none; d=zohomail.com; s=zohoarc; b=TEZVQR7ZHXwpoOmC2q+HTooW9rxREHjrJdQ7xddMoajBeXSZuEUX9bLoOsOIHS3rEvBJqwH+59rI2qai61G8keXBaGfzZgBmzPLs7Y6ckg1HQQaL0oZfQma1AWqcD+RxdyHlVXdJUau3Hm2s4k7tU9/ka0eEZFMEXTILMw3kbOE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1644832820; 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=iq5GBJT2DDKDk/rkPuWc/EwLAqwbC+vr1GcybjnY4Xg=; b=CpL3Nr/c8vwBct+X70yZKoY8t4FJIG0M6xHYbyDZ4SIz0/9ITMV35tjEWU64+w2Pt4niYTKUT2dndEuDDf4zn3odvNLKiWb1EieM+ZrR+d2AmyUAyDoGuGZW4rn/1zSGkw5TjlZnOQcOtxkJzChuivWpKNknlbFxNb2G+zJbAYA= 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 1644832820372773.2294461521708; Mon, 14 Feb 2022 02:00:20 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-326-N1D9B1p_NLyKjdDmVNwXqQ-1; Mon, 14 Feb 2022 05:00:09 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DE90546862; Mon, 14 Feb 2022 10:00:04 +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 BC33160C35; Mon, 14 Feb 2022 10:00:04 +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 87BDF4A7CB; Mon, 14 Feb 2022 10:00:04 +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 21E9xxeA018313 for ; Mon, 14 Feb 2022 04:59:59 -0500 Received: by smtp.corp.redhat.com (Postfix) id C74A35E487; Mon, 14 Feb 2022 09:59:59 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 33C0F55F7E for ; Mon, 14 Feb 2022 09:59:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644832819; 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=iq5GBJT2DDKDk/rkPuWc/EwLAqwbC+vr1GcybjnY4Xg=; b=P8CPZvPyxeU23F4HoNLUAN8BRZFrrkVkS34je5SqmzV7UUZfhakhb2YH6YBmwlbkZYggDl N3D3nR0wyqYi/Bz1SB4aEEvriRmA5JVYmbzdVgTRjzLPjSIn1TaDtPj7eI9e9J9RIfcfMe 19grpRWj6CjxDyCtjKEENJudcGSUUBM= X-MC-Unique: N1D9B1p_NLyKjdDmVNwXqQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/2] qemu: domain: Move and unexport 'qemuDomainStorageIdNew/Reset' Date: Mon, 14 Feb 2022 10:59:52 +0100 Message-Id: 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.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1644832821529100005 Content-Type: text/plain; charset="utf-8" They're used only inside qemu_domain.c. Move it before their usage, and unexport them. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- v2: Unexport qemuDomainStorageIdNew too. src/qemu/qemu_domain.c | 54 +++++++++++++++++++++--------------------- src/qemu/qemu_domain.h | 3 --- 2 files changed, 27 insertions(+), 30 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index c764f6296c..d44244f9b8 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -656,6 +656,33 @@ qemuDomainMasterKeyCreate(virDomainObj *vm) } +/** + * qemuDomainStorageIdNew: + * @priv: qemu VM private data object. + * + * Generate a new unique id for a storage object. Useful for node name gen= eration. + */ +static unsigned int +qemuDomainStorageIdNew(qemuDomainObjPrivate *priv) +{ + return ++priv->nodenameindex; +} + + +/** + * qemuDomainStorageIdReset: + * @priv: qemu VM private data object. + * + * Resets the data for the node name generator. The node names need to be = unique + * for a single instance, so can be reset on VM shutdown. + */ +static void +qemuDomainStorageIdReset(qemuDomainObjPrivate *priv) +{ + priv->nodenameindex =3D 0; +} + + static void qemuDomainSecretInfoClear(qemuDomainSecretInfo *secinfo, bool keepAlias) @@ -10889,33 +10916,6 @@ qemuDomainGetManagedPRSocketPath(qemuDomainObjPriv= ate *priv) } -/** - * qemuDomainStorageIdNew: - * @priv: qemu VM private data object. - * - * Generate a new unique id for a storage object. Useful for node name gen= eration. - */ -unsigned int -qemuDomainStorageIdNew(qemuDomainObjPrivate *priv) -{ - return ++priv->nodenameindex; -} - - -/** - * qemuDomainStorageIdReset: - * @priv: qemu VM private data object. - * - * Resets the data for the node name generator. The node names need to be = unique - * for a single instance, so can be reset on VM shutdown. - */ -void -qemuDomainStorageIdReset(qemuDomainObjPrivate *priv) -{ - priv->nodenameindex =3D 0; -} - - virDomainEventResumedDetailType qemuDomainRunningReasonToResumeEvent(virDomainRunningReason reason) { diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 8bf1c91049..0a9d312b65 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -969,9 +969,6 @@ char * qemuDomainGetManagedPRSocketPath(qemuDomainObjPr= ivate *priv); bool qemuDomainDefHasManagedPR(virDomainObj *vm); -unsigned int qemuDomainStorageIdNew(qemuDomainObjPrivate *priv); -void qemuDomainStorageIdReset(qemuDomainObjPrivate *priv); - virDomainEventResumedDetailType qemuDomainRunningReasonToResumeEvent(virDomainRunningReason reason); --=20 2.34.1 From nobody Tue May 14 07:51:22 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=1644832816; cv=none; d=zohomail.com; s=zohoarc; b=HfcsxtzNC8GHli/9cxq2HJpPK745OE8CuHgEvlB2DBSck+t04wW4RGn9W84xAP7zHDAQP3HLCDQz1bJezguMzzOrZoqpSfVYX5gj4ppBQo0hrP50SG03BWt6t5BTVubPj65FN3Yp5hALT19JxzBWJE7m/FrdTew8Feq9pgrVe0c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1644832816; 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=aY//VaZ7QBldeA/ZIbfm3lFMH1rE6lFbfsfpHpI6Xk0=; b=hTCGbkyzfWr57bjRmC0Olx9JTbnhQ2s7RlZvaBkd1NG/FpSvIltfhY1OvPx6dsTSgs1s40MP9m417v2rsWycX4WnAR87pp9bW4sCYlqFdXsqq2hIjUJybgrHiQRc811aI9NsUyILtl4nPnfquh9QUXhRU6kyfUw4H7VNl+XADkI= 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 1644832816984156.85115177643297; Mon, 14 Feb 2022 02:00:16 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-297-Hy8RyWIUPNC4KuUk1h3dpg-1; Mon, 14 Feb 2022 05:00:14 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E7BD31091DB7; Mon, 14 Feb 2022 10:00:08 +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 79A6E10841AF; Mon, 14 Feb 2022 10:00:08 +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 2C0881809CB8; Mon, 14 Feb 2022 10:00:08 +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 21EA05d9018358 for ; Mon, 14 Feb 2022 05:00:05 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5118A5E498; Mon, 14 Feb 2022 10:00:05 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id A8AD95E49F for ; Mon, 14 Feb 2022 09:59:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644832816; 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=aY//VaZ7QBldeA/ZIbfm3lFMH1rE6lFbfsfpHpI6Xk0=; b=RTzTeiWFyOTu7OTbU5b4lltc4HJlBsseNWE9crp54mFYT0Zq4Ey9AGIb6LteingnqlxXez 2nPgKRzgKDpIAFxxEUySgf4smqbwU41E0HWebpOmyINUITBZt8sPi9+hGy3MeRFnlQXFQU YXdWui2qNzcZN5g5EHyqQaZHxvkjkqQ= X-MC-Unique: Hy8RyWIUPNC4KuUk1h3dpg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/2] qemu: domain: Change 'Id' to 'ID' in qemuDomainStorageIdNew/Reset Date: Mon, 14 Feb 2022 10:59:53 +0100 Message-Id: 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.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1644832819525100003 Content-Type: text/plain; charset="utf-8" In a patch adding similarly named APIs I was asked to use 'ID' instead of 'Id'. Since the code is being put together fix qemuDomainStorageIdNew/Reset first. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d44244f9b8..ee1cf6f9bb 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -657,27 +657,27 @@ qemuDomainMasterKeyCreate(virDomainObj *vm) /** - * qemuDomainStorageIdNew: + * qemuDomainStorageIDNew: * @priv: qemu VM private data object. * * Generate a new unique id for a storage object. Useful for node name gen= eration. */ static unsigned int -qemuDomainStorageIdNew(qemuDomainObjPrivate *priv) +qemuDomainStorageIDNew(qemuDomainObjPrivate *priv) { return ++priv->nodenameindex; } /** - * qemuDomainStorageIdReset: + * qemuDomainStorageIDReset: * @priv: qemu VM private data object. * * Resets the data for the node name generator. The node names need to be = unique * for a single instance, so can be reset on VM shutdown. */ static void -qemuDomainStorageIdReset(qemuDomainObjPrivate *priv) +qemuDomainStorageIDReset(qemuDomainObjPrivate *priv) { priv->nodenameindex =3D 0; } @@ -1681,7 +1681,7 @@ qemuDomainObjPrivateDataClear(qemuDomainObjPrivate *p= riv) g_clear_pointer(&priv->backup, virDomainBackupDefFree); /* reset node name allocator */ - qemuDomainStorageIdReset(priv); + qemuDomainStorageIDReset(priv); priv->dbusDaemonRunning =3D false; @@ -3090,7 +3090,7 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, if (qemuDomainObjPrivateXMLParseBackups(priv, ctxt) < 0) goto error; - qemuDomainStorageIdReset(priv); + qemuDomainStorageIDReset(priv); if (virXPathULongLong("string(./nodename/@index)", ctxt, &priv->nodenameindex) =3D=3D -2) { virReportError(VIR_ERR_XML_ERROR, "%s", @@ -10646,7 +10646,7 @@ qemuDomainPrepareStorageSourceBlockdev(virDomainDis= kDef *disk, qemuDomainObjPrivate *priv, virQEMUDriverConfig *cfg) { - src->id =3D qemuDomainStorageIdNew(priv); + src->id =3D qemuDomainStorageIDNew(priv); src->nodestorage =3D g_strdup_printf("libvirt-%u-storage", src->id); src->nodeformat =3D g_strdup_printf("libvirt-%u-format", src->id); @@ -10773,7 +10773,7 @@ qemuDomainPrepareHostdev(virDomainHostdevDef *hostd= ev, src->readonly =3D hostdev->readonly; if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_HOSTDEV_= SCSI)) { - src->id =3D qemuDomainStorageIdNew(priv); + src->id =3D qemuDomainStorageIDNew(priv); src->nodestorage =3D g_strdup_printf("libvirt-%d-backend",= src->id); backendalias =3D src->nodestorage; } --=20 2.34.1