From nobody Sun Feb 8 19:03:05 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.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 207.211.31.120 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=1582293188; cv=none; d=zohomail.com; s=zohoarc; b=H61dBJ7HiI7LP2aEzcwLUgseYFT9Ny82MMOEK7Tka0WKhn+UJty4fsrEy96bhUsg0w9nWIhapbWMpKgrlu6ZprmEc/NeLyNNyBTYNmtpRr7hIvD5pcUURMWtV1Mjd0yxxDoKME009/2HOhpfHKnlyvXjcBXJT6+PsYxI26lqcjc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582293188; 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=hX2HLxR2ik2It/ISfXiGsO3ff6fZLDPlTKNdblNyFE0=; b=M3UkDawblPcP47/Hu2fhpxWGDplaAGocxyY8cRzY2eRefOuXC6Iv9ueV35ZxEMVBMoeFnjKuGlv2WfhytffYZuCObuXpzeB9Gt6xeHnoNC8Hp0EbTKKUXW9BjyE4Y78RBGFASkuFxOqeNMIGK6tYAogOqy7rxe/jL+NwAkVfrvQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1582293188863500.4903081230668; Fri, 21 Feb 2020 05:53:08 -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-21-ml8APCd3MjeMLCyibfvnfQ-1; Fri, 21 Feb 2020 08:52:31 -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 5D850108444F; Fri, 21 Feb 2020 13:52:25 +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 334E45DA7B; Fri, 21 Feb 2020 13:52:25 +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 DF8671832DAD; Fri, 21 Feb 2020 13:52:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01LDpwJj032522 for ; Fri, 21 Feb 2020 08:51:58 -0500 Received: by smtp.corp.redhat.com (Postfix) id 578C55DA76; Fri, 21 Feb 2020 13:51:58 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id D28F65D9C5 for ; Fri, 21 Feb 2020 13:51:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582293185; 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=hX2HLxR2ik2It/ISfXiGsO3ff6fZLDPlTKNdblNyFE0=; b=e5D6fLwNQ5NZltJDzWIQ5xUzqR4SlSQGHkGjq84iihYNUQglnIAiA8amtkPtHHsQGPx7/c uUcecG1Fsi3TlYur5u3RLDrGUjVuIafVFvOIZESppzt4Bnyh4KIQ4AumrolA8dIBQaCpIe oZwvMPwGXAe1/IzHrxsX2cQg6dSyQAU= X-MC-Unique: ml8APCd3MjeMLCyibfvnfQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 5/7] virStorageBackendGlusterRefreshVol: Refactor handling of backing store Date: Fri, 21 Feb 2020 14:51:43 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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 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" Take the format of the backing store from the 'meta' object directly and use g_steal_pointer go steal the path. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/storage/storage_backend_gluster.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/storage/storage_backend_gluster.c b/src/storage/storage_ba= ckend_gluster.c index 4a8ee3870d..e92e9612bd 100644 --- a/src/storage/storage_backend_gluster.c +++ b/src/storage/storage_backend_gluster.c @@ -224,7 +224,6 @@ virStorageBackendGlusterRefreshVol(virStorageBackendGlu= sterStatePtr state, int ret =3D -1; glfs_fd_t *fd =3D NULL; ssize_t len; - int backingFormat; g_autoptr(virStorageVolDef) vol =3D NULL; g_autoptr(virStorageSource) meta =3D NULL; g_autofree char *header =3D NULL; @@ -277,7 +276,7 @@ virStorageBackendGlusterRefreshVol(virStorageBackendGlu= sterStatePtr state, if (!(meta =3D virStorageFileGetMetadataFromBuf(name, header, len, VIR_STORAGE_FILE_AUTO, - &backingFormat))) + NULL))) goto cleanup; if (meta->backingStoreRaw) { @@ -286,13 +285,11 @@ virStorageBackendGlusterRefreshVol(virStorageBackendG= lusterStatePtr state, vol->target.backingStore->type =3D VIR_STORAGE_TYPE_NETWORK; - vol->target.backingStore->path =3D meta->backingStoreRaw; + vol->target.backingStore->path =3D g_steal_pointer(&meta->backingS= toreRaw); + vol->target.backingStore->format =3D meta->backingStoreRawFormat; - if (backingFormat < 0) + if (vol->target.backingStore->format < 0) vol->target.backingStore->format =3D VIR_STORAGE_FILE_RAW; - else - vol->target.backingStore->format =3D backingFormat; - meta->backingStoreRaw =3D NULL; } vol->target.format =3D meta->format; --=20 2.24.1