From nobody Sat May 4 21:09:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1600884931; cv=none; d=zohomail.com; s=zohoarc; b=LQlnOHNiRjFT9fXiwRW71wabnCRUGmvI+TKQcAeiQI+Qi7EZC2oIa+nIQwIexYeKvpOlzUEHm4Mr+QIi6tMI0JPrLucyCfZ0uCMep9AnF/oaY3HDbCsn0zmqME/ZFn9ERNEfinwlQeeR6oqYd6gq+QMohaaVOIPRFPU3S/RBdIU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600884931; 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=aUubcNdFRz3TleEPQRQn9S5aklsDEgllEtp8/EuGKWw=; b=G9flB1LF8Ocs1YvtY8V3RVsi247wQ/In6aNZGp10qi0PL0sO87CIX9o8KlLM2AcSDHnsth+GpuXKOyiwJB6KEWPg+Gdbx7v+c/f18xXStinOr0hir8u/ot1GK3sD5orEqoY7in1it/aYYHW3YP2mT5N+OY2Aji8Vc/Abe4WlnvQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1600884931339542.0979763051301; Wed, 23 Sep 2020 11:15:31 -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-182-MAljkZ2xOVSclcjYaJkU-A-1; Wed, 23 Sep 2020 14:15:27 -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 0D228801FD8; Wed, 23 Sep 2020 18:15:22 +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 DFA535C1DC; Wed, 23 Sep 2020 18:15:21 +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 AA800183D044; Wed, 23 Sep 2020 18:15:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08NIF9MC017955 for ; Wed, 23 Sep 2020 14:15:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 637BC78828; Wed, 23 Sep 2020 18:15:09 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id DDC1778827 for ; Wed, 23 Sep 2020 18:15:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600884930; 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=aUubcNdFRz3TleEPQRQn9S5aklsDEgllEtp8/EuGKWw=; b=N4eqdE+yngp7SfF+m0aYXDtxJqUoeZXYzAU7UUFZpLy58mABRBlyEA+OUvjY9fOJLIF2Cr 82laJGVOxsBplY+xZaAs9WSeSIQINd/8nP6Y1mZ9DfjP44+P0oUs8PdOZ1dV2+QeRwXlhc f9qm6mgckqqfNVHnnagW5yszg98t6XA= X-MC-Unique: MAljkZ2xOVSclcjYaJkU-A-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 01/14] tools: virshCheckpointListCollect: remove unused names Date: Wed, 23 Sep 2020 20:14:50 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Introduced by: commit 689beaa47c51fb49fafa992dd468116b8f6b0782 and unused since. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Martin Kletzander --- tools/virsh-checkpoint.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tools/virsh-checkpoint.c b/tools/virsh-checkpoint.c index 33e70515ad..f3c4fe90ba 100644 --- a/tools/virsh-checkpoint.c +++ b/tools/virsh-checkpoint.c @@ -581,7 +581,6 @@ virshCheckpointListCollect(vshControl *ctl, bool tree) { size_t i; - char **names =3D NULL; int count =3D -1; virDomainCheckpointPtr *chks; virshCheckpointListPtr checkpointlist =3D vshMalloc(ctl, @@ -628,10 +627,6 @@ virshCheckpointListCollect(vshControl *ctl, =20 cleanup: virshCheckpointListFree(checkpointlist); - if (names && count > 0) - for (i =3D 0; i < count; i++) - VIR_FREE(names[i]); - VIR_FREE(names); return ret; } =20 --=20 2.26.2 From nobody Sat May 4 21:09:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1600884954; cv=none; d=zohomail.com; s=zohoarc; b=LtjhVb0E+UIgwKWyNr2jTwYwKSWGgC46ZluvUDWngOrgXA2aFo9NGoofrdkHIcmL4o0vhkv6mhW51I0zD4WqNMmjAI8tar80HX9/b4UF2BJ6dr7A5P2KtfF1nQVLK5i6Vrg00gY1cDD35gJtxZEVJhqwEHrljLsg/XZ1b/WsuwA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600884954; 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=IeDTIRU9NrOvuBSH1cOnk6RDmJ+4D8rwW97Q3K9BV6w=; b=ezgFKggr7mQ5rUuo7TziIOIUbDnfd7w6+CUwr3LTk876kxplrIriCviMTx6GAniNBqJxP3QDBn7ekARBvFLRpQyUP/kNjiIuyDeRMHyYLGQNgZmE6fjQxJhm3c0Y+inJHkbuU6bTAegOf5QHVbNEdCFkOaZVYofxaB7BIQxh/O8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1600884954640255.78453368339865; Wed, 23 Sep 2020 11:15:54 -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-334-4hnm_xGZMOqBPUZxhcFXTQ-1; Wed, 23 Sep 2020 14:15:49 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D48E8801FD8; Wed, 23 Sep 2020 18:15:42 +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 B476073668; Wed, 23 Sep 2020 18:15:42 +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 80FB1183D043; Wed, 23 Sep 2020 18:15:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08NIFAHv017960 for ; Wed, 23 Sep 2020 14:15:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3833E7882B; Wed, 23 Sep 2020 18:15:10 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id B322C78827 for ; Wed, 23 Sep 2020 18:15:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600884953; 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=IeDTIRU9NrOvuBSH1cOnk6RDmJ+4D8rwW97Q3K9BV6w=; b=TZnfcIlby9awvwCBXpflP2YsQ2vykzqNraxuixo2JlOQ4Hk/jN6xAEQkqTIrg4kY510i79 jXn07ucLBNp1oPMmiPyywXjlFFOsphNbDUT0lbFqYiH83F1f+nBwAJZ6eD5jEGaqafwbk4 /kgY2wLmLM/VHs4G5AgI1x4lh8mP2Xc= X-MC-Unique: 4hnm_xGZMOqBPUZxhcFXTQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 02/14] vbox: remove VBoxCGlueTerm Date: Wed, 23 Sep 2020 20:14:51 +0200 Message-Id: <2e67576c26aef5107e488aaafee2dad3a0a35ac6.1600884543.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.13 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) cppcheck reports: src/vbox/vbox_XPCOMCGlue.c:226:21: style: The statement 'if (hVBoxXPCOMC!=3DNULL) hVBoxXPCOMC=3DNULL' is logically equivalent to 'hVBoxXPCOMC=3DNULL'. [duplicateConditionalAssign] It does not matter anyway because this function is never called. Fixes: e1506cb4eb7eab96e7ded27a23f0d8ac9697ac2a Signed-off-by: J=C3=A1n Tomko Reviewed-by: Martin Kletzander --- src/vbox/vbox_XPCOMCGlue.c | 19 ------------------- src/vbox/vbox_XPCOMCGlue.h | 1 - 2 files changed, 20 deletions(-) diff --git a/src/vbox/vbox_XPCOMCGlue.c b/src/vbox/vbox_XPCOMCGlue.c index 3cbb679110..2936ff0edb 100644 --- a/src/vbox/vbox_XPCOMCGlue.c +++ b/src/vbox/vbox_XPCOMCGlue.c @@ -217,25 +217,6 @@ VBoxCGlueInit(unsigned int *version) } =20 =20 -/** - * Terminate the C glue library. - */ -void -VBoxCGlueTerm(void) -{ - if (hVBoxXPCOMC !=3D NULL) { -#if 0 /* VBoxRT.so doesn't like being reloaded. See @bugref{3725}. */ - dlclose(g_hVBoxXPCOMC); -#endif - hVBoxXPCOMC =3D NULL; - } - - pVBoxFuncs_v2_2 =3D NULL; - g_pfnGetFunctions =3D NULL; -} - - - /* * In XPCOM an array is represented by 1) a pointer to an array of pointers * that point to the items and 2) an unsigned int representing the number = of diff --git a/src/vbox/vbox_XPCOMCGlue.h b/src/vbox/vbox_XPCOMCGlue.h index 517b02393f..d0e579482e 100644 --- a/src/vbox/vbox_XPCOMCGlue.h +++ b/src/vbox/vbox_XPCOMCGlue.h @@ -36,7 +36,6 @@ extern PFNVBOXGETXPCOMCFUNCTIONS g_pfnGetFunctions; =20 int VBoxCGlueInit(unsigned int *version); -void VBoxCGlueTerm(void); =20 typedef struct _vboxArray vboxArray; =20 --=20 2.26.2 From nobody Sat May 4 21:09:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1600884924; cv=none; d=zohomail.com; s=zohoarc; b=ikGdo2Byz9e0cf5YzumMIVU7qVDgYiV2wHRLQiOkx4DwExY6GUmwcOmyJuwzOvcZ87OowOouSXbtpUJZMrTuW1XepZjEHfzlNCLCMXRImMqCqmUTxsypYxNoFkZvb/OTV3HN5Xzemc2JJVN8E0iILLXcZgKtuJLdxhzS3HukiME= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600884924; 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=2m1BmH4tEaO7hJHkFwFm/6X/kQ06GJHccnjymm2ScSY=; b=gNnxpFu97hKel0FizHqyXS/lut8EI8U34zAOZGN0pTqPvNBkzJq5I0T4NoYGKBvei6s+bTrvV9Gux0hZmUQutCbcJw2+Q8s0odz+B3lg23MRuAdwoW2ckgwgQ+svHUygYX5ph3Og95V5+y2UF15Ce9iW3duDGXmBqms3mGU/AYU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1600884924556764.6569270915788; Wed, 23 Sep 2020 11:15:24 -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-3-nfqUoczzMcCCblpNc4UyOQ-1; Wed, 23 Sep 2020 14:15:20 -0400 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 22793801FD8; Wed, 23 Sep 2020 18:15:14 +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 F10615D98D; Wed, 23 Sep 2020 18:15:13 +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 A85E644A46; Wed, 23 Sep 2020 18:15:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08NIFBvQ017969 for ; Wed, 23 Sep 2020 14:15:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 101BB78827; Wed, 23 Sep 2020 18:15:11 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8A2F17882C for ; Wed, 23 Sep 2020 18:15:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600884923; 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=2m1BmH4tEaO7hJHkFwFm/6X/kQ06GJHccnjymm2ScSY=; b=QeyledH/9YnewESa7EYgvVxF5aeCjV3Ig640tYN9KPPH+S8ipxStK9AEu05LMLul1Oi5Fc XJ/LpEf0ggjx6bjgfXOUSFj7pdLyo4Y2OoBO/l2Dpu+POjgDI1o8PmWhuuiLA/nqbrJGrZ cnEV92jURVqlpa88yLk9Bm7Xxm/2huQ= X-MC-Unique: nfqUoczzMcCCblpNc4UyOQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 03/14] vbox: StartMachine: overwrite ret less often Date: Wed, 23 Sep 2020 20:14:52 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Use goto to jump over the ret =3D 0 assignment as is usual in rest of the code. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Martin Kletzander --- src/vbox/vbox_common.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index 9978741a64..99c7fbd117 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -2090,7 +2090,7 @@ vboxStartMachine(virDomainPtr dom, int maxDomID, IMac= hine *machine, vboxIID *iid int ret =3D -1; =20 if (!data->vboxObj) - return ret; + return -1; =20 VBOX_UTF8_TO_UTF16("FRONTEND/Type", &keyTypeUtf16); gVBoxAPI.UIMachine.GetExtraData(machine, keyTypeUtf16, &valueTypeUtf16= ); @@ -2177,7 +2177,7 @@ vboxStartMachine(virDomainPtr dom, int maxDomID, IMac= hine *machine, vboxIID *iid if (NS_FAILED(rc)) { virReportError(VIR_ERR_OPERATION_FAILED, "%s", _("OpenRemoteSession/LaunchVMProcess failed, domain= can't be started")); - ret =3D -1; + goto cleanup; } else { PRBool completed =3D 0; resultCodeUnion resultCode; @@ -2186,19 +2186,21 @@ vboxStartMachine(virDomainPtr dom, int maxDomID, IM= achine *machine, vboxIID *iid rc =3D gVBoxAPI.UIProgress.GetCompleted(progress, &completed); if (NS_FAILED(rc)) { /* error */ - ret =3D -1; + goto cleanup; } gVBoxAPI.UIProgress.GetResultCode(progress, &resultCode); if (RC_FAILED(resultCode)) { /* error */ - ret =3D -1; + goto cleanup; } else { /* all ok set the domid */ dom->id =3D maxDomID + 1; - ret =3D 0; } } =20 + ret =3D 0; + + cleanup: VBOX_RELEASE(progress); =20 gVBoxAPI.UISession.Close(data->vboxSession); --=20 2.26.2 From nobody Sat May 4 21:09:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1600884933; cv=none; d=zohomail.com; s=zohoarc; b=h63bWedEULJwjSiFbi+8tbFdovUvI6mxg8ClLiQ8oBpppAQYtKWn58EUBSYA4v24yK5k8oqH6MdavUH8kl9DXq6ZoSHwb273wqhr7wGfioiqY7h82qWKXvbFx7Cn5iMPsBLNmHbG0EP7almB6cATUD4J450VjQP8VdrGXfzSVIw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600884933; 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=EODSCV6IYf6dnOYDMUxo/6fZra5HMmPv9kUGJyWw9kU=; b=OIqM8g+U8nXOC2U0C8QpNEgXrM/3mv3xTOEtjuJP3HDrD/w/i/CdXAxdFsgafdO/X0XJJO2RTtIo4vS/+ZezCyl2BHdxZK5G911kB8ylmqoFAPAjuSEeMQ5eKPffVNHT+ZtVyLHEgBqsDXqhBUfoHy1mXCPaAb0uIgcxyR7orBU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1600884933753262.64618132036014; Wed, 23 Sep 2020 11:15:33 -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-104-3kZ21fC9OceyGZceZeFvuQ-1; Wed, 23 Sep 2020 14:15:29 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F20E010BBED4; Wed, 23 Sep 2020 18:15:21 +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 D1DB655784; Wed, 23 Sep 2020 18:15:21 +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 9ED8F44A7F; Wed, 23 Sep 2020 18:15:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08NIFB9h018005 for ; Wed, 23 Sep 2020 14:15:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id D495B78816; Wed, 23 Sep 2020 18:15:11 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5CCBA78827 for ; Wed, 23 Sep 2020 18:15:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600884932; 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=EODSCV6IYf6dnOYDMUxo/6fZra5HMmPv9kUGJyWw9kU=; b=cAwYoxRcoLROxDtiSWSXdFmS44foJKuAcaOYlg5/QpAcp3reonSEhkpuZARRUQxGA7CsTP LqTO7YmKxQrvdN1UFwmZ3UMi28BPt2PBfOLBn5D7L6jf4mKJpBLuJZhCZhLCCDwwGeeWLh LBzoXvRfwlEc7iqLJvM3gHg+VFGXs78= X-MC-Unique: 3kZ21fC9OceyGZceZeFvuQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 04/14] Remove pointless assignments Date: Wed, 23 Sep 2020 20:14:53 +0200 Message-Id: <4c35db10c1ba0883836ff4e81022a759ddad67fd.1600884543.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.15 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) There's no need to initialize every variable, especially not if it's overwritten two lines later. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Martin Kletzander --- examples/c/admin/logging.c | 2 +- src/libxl/libxl_driver.c | 2 +- src/vbox/vbox_common.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/c/admin/logging.c b/examples/c/admin/logging.c index 730ae40d9d..c183c4867d 100644 --- a/examples/c/admin/logging.c +++ b/examples/c/admin/logging.c @@ -29,7 +29,7 @@ int main(int argc, char **argv) const char *set_outputs =3D NULL; const char *set_filters =3D NULL; =20 - ret =3D c =3D -1; + ret =3D -1; opterr =3D 0; =20 while ((c =3D getopt(argc, argv, ":hpo:f:")) > 0) { diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 161a6882f3..ea7d08cd11 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -5423,7 +5423,7 @@ libxlDiskSectorSize(int domid, int devno) return ret; } =20 - path =3D val =3D NULL; + val =3D NULL; path =3D g_strdup_printf("/local/domain/%d/device/vbd/%d/backend", dom= id, devno); =20 if ((val =3D xs_read(handle, XBT_NULL, path, &len)) =3D=3D NULL) diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index 99c7fbd117..2783827012 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -4618,7 +4618,7 @@ vboxSnapshotRedefine(virDomainPtr dom, if (openSessionForMachine(data, dom->uuid, &domiid, &machine) < 0) goto cleanup; =20 - rc =3D gVBoxAPI.UIMachine.SaveSettings(machine); + gVBoxAPI.UIMachine.SaveSettings(machine); /* It may failed when the machine is not mutable. */ rc =3D gVBoxAPI.UIMachine.GetSettingsFilePath(machine, &settingsFilePa= th); if (NS_FAILED(rc)) { --=20 2.26.2 From nobody Sat May 4 21:09:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1600884934; cv=none; d=zohomail.com; s=zohoarc; b=aegZ312rQWMgRqAV1Pa407CDT1zaIJHjbibvup+803YXHftZ56xjtIi3xfP8XtLXym8ECQyuUoTyc5VvbdU2Jab9KYW6G/U8zqp5qLiWLJCnySjTBx6A/uGUR9fw9O/OG1vsb/68RQfNeG1EzSHc0xeQt0nClqoX508HRFhOMBY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600884934; 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=4xjiqJ80pXMABT+gxTjNmk6ow/nzfCUoq9pYsIs1Lkg=; b=Ucf/f2v+jfin0hWZ6u881cGXyvKEv88edKfdqLIKKa723T87VDig94ahEhG8Hd66CPW5zkCcFpcJrUijeQBX0RfsrLTLWj/7fmCymiBg3X4an8gmCG6caMu8DGLJSfSnZZ6vLDTvuPWkJcRhOFUG8p9vROXMC1WoTz5qeH77Xds= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1600884934980592.2958213364302; Wed, 23 Sep 2020 11:15:34 -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-15--rSfOWo7PHqVAZvs8QK8Tg-1; Wed, 23 Sep 2020 14:15:30 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DE11D801AF7; Wed, 23 Sep 2020 18:15:24 +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 BC6C360BEC; Wed, 23 Sep 2020 18:15:24 +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 861E6183D049; Wed, 23 Sep 2020 18:15:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08NIFCtr018022 for ; Wed, 23 Sep 2020 14:15:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id A74C578822; Wed, 23 Sep 2020 18:15:12 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2DF5578816 for ; Wed, 23 Sep 2020 18:15:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600884933; 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=4xjiqJ80pXMABT+gxTjNmk6ow/nzfCUoq9pYsIs1Lkg=; b=Yo2m8ZJROah+TNb02LsmElIcZ78x+xI6/hNGKfHV60EO0f7U97e0YFKHb4KKTtQaxEzwt+ E0wsX1Zpr9OJ+i63krHu6FDQ4astSnPF6zbdTmoU/3wdHUZAsNlX8INvh7EP9VOnPPyJJ+ seGRTgoWIa+MVFZllIt/0YxVOD5p1EE= X-MC-Unique: -rSfOWo7PHqVAZvs8QK8Tg-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 05/14] Remove pointless initializations Date: Wed, 23 Sep 2020 20:14:54 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.12 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: J=C3=A1n Tomko --- src/test/test_driver.c | 2 +- tests/virnumamock.c | 2 +- tests/virrandommock.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index d582c207f4..cbbfea6665 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -4354,7 +4354,7 @@ testNodeGetFreePages(virConnectPtr conn G_GNUC_UNUSED, unsigned long long *counts, unsigned int flags) { - size_t i =3D 0, j =3D 0; + size_t i, j; int x =3D 6; =20 virCheckFlags(0, -1); diff --git a/tests/virnumamock.c b/tests/virnumamock.c index 40e18e646e..d39c264a3f 100644 --- a/tests/virnumamock.c +++ b/tests/virnumamock.c @@ -130,7 +130,7 @@ virNumaGetPages(int node, { const int pages_def[] =3D { 4, 2 * 1024, 1 * 1024 * 1024}; const int npages_def =3D G_N_ELEMENTS(pages_def); - size_t i =3D 0; + size_t i; =20 if (pages_size) *pages_size =3D g_new0(unsigned int, npages_def); diff --git a/tests/virrandommock.c b/tests/virrandommock.c index 6dd15213e3..ca0520a5a3 100644 --- a/tests/virrandommock.c +++ b/tests/virrandommock.c @@ -69,7 +69,7 @@ int gnutls_dh_params_generate2(gnutls_dh_params_t dparams, unsigned int bits) { - int rc =3D 0; + int rc; =20 VIR_MOCK_REAL_INIT(gnutls_dh_params_generate2); =20 --=20 2.26.2 From nobody Sat May 4 21:09:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1600884933; cv=none; d=zohomail.com; s=zohoarc; b=gpcTBtp3w+bl1qEiSzlFUk7a1A9VtsVmuVJhqDH6/RRRqJj3JC3+eLcohkoCCs741efBR4wxmeI4RFK7Aw7C0k8Xf8xxU1C4DaL9dVI6vsMTPdsEmJtXzQ8X7ZRA2QR+8IuhpPZNsPb7a9/m7ZBC/5KoicID77roOblRT0ebzkg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600884933; 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=gSeep/E70DrhIXZFGaiWijdx6murkC/jcHUwfFp++s0=; b=R4YRq5eLOwYR+BbpzOb/KAqkpebf5/X6dbhJnqQIb0SDdX1LC7q3M+jgK5Am34UmH7OqeZvvqFR+AxoilOu/4Vgr8csQDKGk2yFF6gY1D+rGD794ti482qDOhMpn23ld42l7V6IubiPCcLmOCfzp3/BvYTtcGQaSsjoQcor0tMs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 160088493391856.8205113147842; Wed, 23 Sep 2020 11:15:33 -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-120-LgYbtOyfOQ-qVTosAcCMVQ-1; Wed, 23 Sep 2020 14:15:30 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 00A3A191E2A7; Wed, 23 Sep 2020 18:15: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 D3AAA5577A; Wed, 23 Sep 2020 18:15:24 +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 7CFA9183D048; Wed, 23 Sep 2020 18:15:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08NIFDMc018029 for ; Wed, 23 Sep 2020 14:15:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7ADEA78822; Wed, 23 Sep 2020 18:15:13 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id F3EB878816 for ; Wed, 23 Sep 2020 18:15:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600884932; 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=gSeep/E70DrhIXZFGaiWijdx6murkC/jcHUwfFp++s0=; b=QjRlYSxftWEYkdu1/F02ngDR+WS+M2UDExSBXYysDaH4VlxvWsPUCYQ+O0V7KxL8xmQu5d eAGKKlDQiifLqK4hgE8pDJcJS/BI+1QzrhaNP/WcpPcZ7419wLP3LABVwFDcmimUIspOd7 8/IVr0lBRpe3p1QxWhSspXZF6OEdrJI= X-MC-Unique: LgYbtOyfOQ-qVTosAcCMVQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 06/14] virsh: virshStreamSourceSkip: remove unused 'off' Date: Wed, 23 Sep 2020 20:14:55 +0200 Message-Id: <7e3b5f8673d419c1d504bcbaa67fef400a1183af.1600884543.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.15 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: J=C3=A1n Tomko Reviewed-by: Martin Kletzander --- tools/virsh-util.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/virsh-util.c b/tools/virsh-util.c index b8b0f98066..af7ed55348 100644 --- a/tools/virsh-util.c +++ b/tools/virsh-util.c @@ -173,9 +173,8 @@ virshStreamSourceSkip(virStreamPtr st G_GNUC_UNUSED, { virshStreamCallbackDataPtr cbData =3D opaque; int fd =3D cbData->fd; - off_t cur; =20 - if ((cur =3D lseek(fd, offset, SEEK_CUR)) =3D=3D (off_t) -1) + if (lseek(fd, offset, SEEK_CUR) =3D=3D (off_t) -1) return -1; =20 return 0; --=20 2.26.2 From nobody Sat May 4 21:09:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1600884937; cv=none; d=zohomail.com; s=zohoarc; b=VkUZuk5nW4BWRZvM3wttUv+rwQ786DkxP3q4U/FGgKVX7fPhjtR+Rxv4nCnTjXjdDKGj5lN2ityREILxk3Y+rna/rtky3733Twt5Diesc8ugQ0PxXAvX2ayrvJAH30XhIOIlsmuKQAQJxwb4Kiuk/q24Csf86EgUeDrVmvpxzRw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600884937; 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=ueNriNEQEZMMK53R/D2DNJDPwAS2JIX23Mm6Q0VMSIw=; b=HkHejnKEHQ70NsBMcSsfyQALi3eXRxrEM7qbsTMceQnQOBqaiXk6QBw/JiiBM2cgNlLOMcpMqPP8aQGg8jzSj6sf4o+pjK3eGOxiAhzzpoAvWbuf2FCd6foVtQ0J2mVETpKa1m9SXbvrkbXI4Uw90REo6sRfk0yE2DBlVWRy/eM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1600884937305420.37504798757925; Wed, 23 Sep 2020 11:15:37 -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-280-vWpuqcwNObuZ3Bz0unGeQw-1; Wed, 23 Sep 2020 14:15:33 -0400 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 9A60FD6448; Wed, 23 Sep 2020 18:15:27 +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 7872F5D993; Wed, 23 Sep 2020 18:15:27 +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 44E118C7AA; Wed, 23 Sep 2020 18:15:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08NIFErv018064 for ; Wed, 23 Sep 2020 14:15:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4CF9478822; Wed, 23 Sep 2020 18:15:14 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id C858678816 for ; Wed, 23 Sep 2020 18:15:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600884936; 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=ueNriNEQEZMMK53R/D2DNJDPwAS2JIX23Mm6Q0VMSIw=; b=G2bVKp1rZEDM4qSy8NxYsJID3fa+giKTRqi/JJWGaoXxQXf5dqwrDeZvzHdPn3StsSicfj Y3S/QNndyKsPTNYipw0c86szU446GtS4oMMtZW6f1exfVljk+Ui50BFNY68OruXUsv5Hyw MXkp4hiOBPo7MsHVPSdj9NFd4ownZ60= X-MC-Unique: vWpuqcwNObuZ3Bz0unGeQw-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 07/14] Do not check whether unsigned variables are negative Date: Wed, 23 Sep 2020 20:14:56 +0200 Message-Id: <426d370875c4160f4d8bb96d833d45b803443ea4.1600884543.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: J=C3=A1n Tomko Reviewed-by: Martin Kletzander --- src/openvz/openvz_driver.c | 2 +- src/vbox/vbox_common.c | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index 71e270ea09..74d87b1085 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -1215,7 +1215,7 @@ static int openvzDomainSetVcpusFlags(virDomainPtr dom= , unsigned int nvcpus, if (!(vm =3D openvzDomObjFromDomain(driver, dom->uuid))) return -1; =20 - if (nvcpus <=3D 0) { + if (nvcpus =3D=3D 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Number of vCPUs should be >=3D 1")); goto cleanup; diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index 2783827012..b9b72e2e02 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -2111,7 +2111,7 @@ vboxStartMachine(virDomainPtr dom, int maxDomID, IMac= hine *machine, vboxIID *iid VBOX_UTF16_TO_UTF8(valueDisplayUtf16, &valueDisplayUtf8); VBOX_UTF16_FREE(valueDisplayUtf16); =20 - if (strlen(valueDisplayUtf8) <=3D 0) + if (strlen(valueDisplayUtf8) =3D=3D 0) VBOX_UTF8_FREE(valueDisplayUtf8); } =20 @@ -2990,7 +2990,7 @@ vboxHostDeviceGetXMLDesc(vboxDriverPtr data, virDomai= nDefPtr def, IMachine *mach gVBoxAPI.UArray.vboxArrayGet(&deviceFilters, USBCommon, gVBoxAPI.UArray.handleUSBGetDeviceFilters= (USBCommon)); =20 - if (deviceFilters.count <=3D 0) + if (deviceFilters.count =3D=3D 0) goto release_filters; =20 /* check if the filters are active and then only @@ -3612,9 +3612,8 @@ vboxDumpSharedFolders(virDomainDefPtr def, vboxDriver= Ptr data, IMachine *machine gVBoxAPI.UArray.vboxArrayGet(&sharedFolders, machine, gVBoxAPI.UArray.handleMachineGetSharedFol= ders(machine)); =20 - if (sharedFolders.count <=3D 0) { - if (sharedFolders.count =3D=3D 0) - ret =3D 0; + if (sharedFolders.count =3D=3D 0) { + ret =3D 0; goto cleanup; } =20 --=20 2.26.2 From nobody Sat May 4 21:09:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1600884956; cv=none; d=zohomail.com; s=zohoarc; b=Nl5qImcOMUjZAdemNopMzlOmgPuq0rkKIRwzvh1ZSG02kWyI2fQ2DB2ebi7l6VK/KWoG5emec/Bun682E57OqjQaETYTKSbm81lgofmjXtrjeIdy/IOEjSh4chrFZ6EW0cY1LbMnkyRjPp1wFTKCLKUwrRLmvBxTqH3lRQWvfTw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600884956; 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=96A0hwE0slcUFme4QIsMU6JO7jTuwgeJr/9kJdxywlE=; b=CZjHB2Ngayc31qmRO1IGB046HWqRsddwm86PTVYPeuInK1ZeuIFFJevg7Ybb4/CfcUi+9vbYoc3ZbyeDgoqFE2PzoXv6fG9Vlndrhw8DnUJMWq3uMhj1VfIRNCWaNQvgZN12EpicN5OWF7asoa1WCbuarxULtZTFsc025puPCAY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1600884956033564.9620569925748; Wed, 23 Sep 2020 11:15:56 -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-447-hOwcWbOWNYqpRWKDNxWhLA-1; Wed, 23 Sep 2020 14:15:51 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8716C81F00B; Wed, 23 Sep 2020 18:15:45 +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 5F1F91975E; Wed, 23 Sep 2020 18:15:45 +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 2D0B78C7AA; Wed, 23 Sep 2020 18:15:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08NIFFj0018096 for ; Wed, 23 Sep 2020 14:15:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id 23B4478823; Wed, 23 Sep 2020 18:15:15 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E9807B7B9 for ; Wed, 23 Sep 2020 18:15:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600884954; 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=96A0hwE0slcUFme4QIsMU6JO7jTuwgeJr/9kJdxywlE=; b=GF4yEjhDzrFtjnRnsavJV+ZPFUD1h03OJTkH0rtSrkvSV1nSKfpxuuz9/33e7Ib7iaQJDk QGGMa7yQl5//sUacV0a7tlMipaRjID+Bw5pAsPccxPMFdBQ+bz8x0CvolWSj+OlLgtOQIR 4EyZB1zjJTaE1aEKUMJGCR8Mo8cWu1A= X-MC-Unique: hOwcWbOWNYqpRWKDNxWhLA-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 08/14] libxl: remove unused 'bits' from struct guest_arch Date: Wed, 23 Sep 2020 20:14:57 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.23 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) It was made pointless by: commit c25c18f71bdc43a1305be4ad1a2ca91b25cf13f3 Convert capabilities / domain_conf to use virArch and unused by: commit 8db1f2d228bb2f27a729a873dcdb81ce3c7c38fd Fix libxl driver for virArch changes Signed-off-by: J=C3=A1n Tomko Reviewed-by: Martin Kletzander --- src/libxl/libxl_capabilities.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c index 8284ea3d53..e5b144ea1d 100644 --- a/src/libxl/libxl_capabilities.c +++ b/src/libxl/libxl_capabilities.c @@ -52,7 +52,6 @@ enum libxlHwcapVersion { =20 struct guest_arch { virArch arch; - int bits; int hvm; int pvh; int pae; --=20 2.26.2 From nobody Sat May 4 21:09:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1600884937; cv=none; d=zohomail.com; s=zohoarc; b=N0HQrHtfo3uYrqfMdB0S2vvSY9ayF0wDClF7klk9Y1DVeJaRlrhXbRb2E8DW+PdVKnk8Nc/Wity4FIYpoS6yLBb3/CzGKwfUaVUAwvduLP+G0MCV6fBNNA6DRPyKbpoopIwV26mVS5gapDy9D8OwaIK74SGhOpognvK+1poZym0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600884937; 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=ZZbEn/5GkpFaq+qL240dTpGqSDXINlpItzMMSle0pME=; b=l+W0puvqFoRJo28VI3IzaX+uaEvj/4SBhyRQa2OrJuwgbW9Chue2jULRHB5BW9c8TUwWaCMSBpn9s+FBC9xf4YJ9bgFOrpma873JniBuKBKdswxx8hbLGnDsEMlVpePqdl55WKGTXvNBqxLBgHA4ThBXTMKu6ZNArcM5YgId3Es= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 160088493763932.35134022248906; Wed, 23 Sep 2020 11:15:37 -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-344-THYaF6c4OK69ViJ6eQKmAA-1; Wed, 23 Sep 2020 14:15:33 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8918810BBED0; Wed, 23 Sep 2020 18:15:27 +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 666BC60BEC; Wed, 23 Sep 2020 18:15:27 +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 28A24183D04E; Wed, 23 Sep 2020 18:15:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08NIFFGY018109 for ; Wed, 23 Sep 2020 14:15:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id E93487882C; Wed, 23 Sep 2020 18:15:15 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 70D4B78823 for ; Wed, 23 Sep 2020 18:15:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600884936; 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=ZZbEn/5GkpFaq+qL240dTpGqSDXINlpItzMMSle0pME=; b=GgjNYtqxFm+Auy+VaWZeNag3uBCoEs7sXryn70Re9y3WrOov3uBLEYzABo5LVF3tsMQ0Rc Uy7yUNBTJKugbVDW29dODjQ5USNLqHPtiEcJ3RjF55ch85CLj6DcLBr55y9LiYAv+7nVhd OBST2M7wcbsRLmd20i1g3H4ujQsSpz4= X-MC-Unique: THYaF6c4OK69ViJ6eQKmAA-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 09/14] api: virDomainMemoryStats: use 'ret' variable Date: Wed, 23 Sep 2020 20:14:58 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.12 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Instead of 'nr_stats_ret'. Also reduce its scope. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Martin Kletzander --- src/libvirt-domain.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index cde86c77e8..415482a526 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -5741,7 +5741,6 @@ virDomainMemoryStats(virDomainPtr dom, virDomainMemor= yStatPtr stats, unsigned int nr_stats, unsigned int flags) { virConnectPtr conn; - unsigned long nr_stats_ret =3D 0; =20 VIR_DOMAIN_DEBUG(dom, "stats=3D%p, nr_stats=3D%u, flags=3D0x%x", stats, nr_stats, flags); @@ -5758,11 +5757,10 @@ virDomainMemoryStats(virDomainPtr dom, virDomainMem= oryStatPtr stats, =20 conn =3D dom->conn; if (conn->driver->domainMemoryStats) { - nr_stats_ret =3D conn->driver->domainMemoryStats(dom, stats, nr_st= ats, - flags); - if (nr_stats_ret =3D=3D -1) + int ret =3D conn->driver->domainMemoryStats(dom, stats, nr_stats, = flags); + if (ret =3D=3D -1) goto error; - return nr_stats_ret; + return ret; } =20 virReportUnsupportedError(); --=20 2.26.2 From nobody Sat May 4 21:09:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1600884940; cv=none; d=zohomail.com; s=zohoarc; b=C45+WgLKDT+TiOSFovGJQVGq8unOkLcCv0aPyDuW9kWzM6QJFf8sNPUSiK9VmunxHE9T9B/e7cwx+odvpOyDA9IDq7nCr1JixYWN0p1IHPCQy9yug1vrZaJZ1Qtt7uEIUCqSl7CljZp6wX1/ka+mUsPi3ogRkuctUnPHg60/a6g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600884940; 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=er8N00iQqiW5Tl4snPTr8LD0ZM/7VYKOeWzuJyqR9Yg=; b=jWjyEvW9dBKuBv1HUD3+FSVFlB3n+Gz7NfnMT+gxODC7Gm5Tcn+FrtNcbVt9+vJkDDMP8rTQmfxwlAsb27nhnfXJBr5StSUuMWgIqTkkTNQpZCqDrStDjKID7ss/cKuvq5P6naG4XVMlJJIbU76k4xds4n4fvcW5FzCinDr0Wzg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1600884940766668.7809365167515; Wed, 23 Sep 2020 11:15:40 -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-279-rLWWImCnNc2qby1ogqkAmQ-1; Wed, 23 Sep 2020 14:15:36 -0400 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 48C0410BBED3; Wed, 23 Sep 2020 18:15:30 +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 237C410021AA; Wed, 23 Sep 2020 18:15:30 +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 DE9F7183D050; Wed, 23 Sep 2020 18:15:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08NIFGib018153 for ; Wed, 23 Sep 2020 14:15:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id BAD697882C; Wed, 23 Sep 2020 18:15:16 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 41E5278823 for ; Wed, 23 Sep 2020 18:15:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600884939; 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=er8N00iQqiW5Tl4snPTr8LD0ZM/7VYKOeWzuJyqR9Yg=; b=GcyBX35CpT5R+dhkh4HV7ClYcjKKAxvNFzYYA4s6dMZpjOOAr/H12LGWvwpnL043DpJC5U H6hiRKeXuQtrnZOqxYfg6k3VB/irA4oe+PtjJGkFI9THndqrc2B4BO3GTOSEmodPhMEIv1 yxgyjKhZqSKlMLE6hqA5Gm846eG0AXI= X-MC-Unique: rLWWImCnNc2qby1ogqkAmQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 10/14] storage: createFileDir: remove useless 'err' variable Date: Wed, 23 Sep 2020 20:14:59 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: J=C3=A1n Tomko Reviewed-by: Martin Kletzander --- src/storage/storage_util.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index 9171cb084f..93c24ab6bc 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -1997,7 +1997,6 @@ createFileDir(virStoragePoolObjPtr pool, unsigned int flags) { virStoragePoolDefPtr def =3D virStoragePoolObjGetDef(pool); - int err; =20 virCheckFlags(0, -1); =20 @@ -2015,14 +2014,14 @@ createFileDir(virStoragePoolObjPtr pool, } =20 =20 - if ((err =3D virDirCreate(vol->target.path, - (vol->target.perms->mode =3D=3D (mode_t)-1 ? - VIR_STORAGE_DEFAULT_VOL_PERM_MODE : - vol->target.perms->mode), - vol->target.perms->uid, - vol->target.perms->gid, - (def->type =3D=3D VIR_STORAGE_POOL_NETFS - ? VIR_DIR_CREATE_AS_UID : 0))) < 0) { + if (virDirCreate(vol->target.path, + (vol->target.perms->mode =3D=3D (mode_t)-1 ? + VIR_STORAGE_DEFAULT_VOL_PERM_MODE : + vol->target.perms->mode), + vol->target.perms->uid, + vol->target.perms->gid, + (def->type =3D=3D VIR_STORAGE_POOL_NETFS + ? VIR_DIR_CREATE_AS_UID : 0)) < 0) { return -1; } =20 --=20 2.26.2 From nobody Sat May 4 21:09:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1600885027; cv=none; d=zohomail.com; s=zohoarc; b=CM2EEgfTcJJ6iXwkR0M3bVjxEe56wWtWIhjOKOpp7/LoHojc3a58yyBCD+HVU1kW2GZU6RgbJJQ0+9xlYvBpV0+rifGjdTwre+TeX8EZ4CJvuuN1YjT512Itsv+zuuHiDwuyyC17yr1XO0B9gjkKy1ck/5cwQS21v7w5molGWrY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600885027; 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=0DJjjaKcIkgTLK/bE1tPJtNJ9tMhaSaQQ1dLlgZpa+M=; b=GgahxhO1TgjNegVk5FHFgDMgD6kSmygU19G79+GJaUY0sGP4kgM38VexgxHj2HWsjfjhh7zO98tzK7RvCo5k6sHJNW2Y6cPiUnd6r+a2GsTlXeZWNOCsEmggeC4XUGBwTC3DgLRMngeLEHvUHwHy8HdvzhwKT16YGLpV9aek4fs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1600885027145527.3986980959014; Wed, 23 Sep 2020 11:17:07 -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-567-MNx88KaBMXyq6aF9mjp7mA-1; Wed, 23 Sep 2020 14:15:39 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D0DA2191E2A6; Wed, 23 Sep 2020 18:15:32 +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 B08106198B; Wed, 23 Sep 2020 18:15:32 +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 799AE183D053; Wed, 23 Sep 2020 18:15:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08NIFHGE018176 for ; Wed, 23 Sep 2020 14:15:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8C79778816; Wed, 23 Sep 2020 18:15:17 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 13CD3702E7 for ; Wed, 23 Sep 2020 18:15:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600885025; 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=0DJjjaKcIkgTLK/bE1tPJtNJ9tMhaSaQQ1dLlgZpa+M=; b=EXzyCvrdgOuOIsHM5gfM7M13Z6rsFhRdPtpu5UfwPeg5YG2YKaFLyYxUPRO5gPapdWQRVq ohnwMjXdVoVVUDpLxrZT29yc8Onk/SNOCoQt6VcQmZ9iDHyhj2KSs4AHzoLMGLCziRIn9y 0+fpeVuq9DUqpJKWGf0Ht3TA12zFf4E= X-MC-Unique: MNx88KaBMXyq6aF9mjp7mA-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 11/14] storage: createFileDir: use less ternary operators Date: Wed, 23 Sep 2020 20:15:00 +0200 Message-Id: <1e7f3b4759f2dede28fb7dca16da2482804325a0.1600884543.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.12 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Introduce separate variables and if conditions with spaces around them to make the function call easier to read. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Martin Kletzander --- src/storage/storage_util.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index 93c24ab6bc..49ecbc5344 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -1997,6 +1997,8 @@ createFileDir(virStoragePoolObjPtr pool, unsigned int flags) { virStoragePoolDefPtr def =3D virStoragePoolObjGetDef(pool); + mode_t permmode =3D VIR_STORAGE_DEFAULT_VOL_PERM_MODE; + unsigned int flags =3D 0; =20 virCheckFlags(0, -1); =20 @@ -2013,15 +2015,17 @@ createFileDir(virStoragePoolObjPtr pool, return -1; } =20 + if (vol->target.perms->mode !=3D (mode_t)-1) + permmode =3D vol->target.perms->mode; + + if (def->type =3D=3D VIR_STORAGE_POOL_NETFS) + flags |=3D VIR_DIR_CREATE_AS_UID; =20 if (virDirCreate(vol->target.path, - (vol->target.perms->mode =3D=3D (mode_t)-1 ? - VIR_STORAGE_DEFAULT_VOL_PERM_MODE : - vol->target.perms->mode), + permmode, vol->target.perms->uid, vol->target.perms->gid, - (def->type =3D=3D VIR_STORAGE_POOL_NETFS - ? VIR_DIR_CREATE_AS_UID : 0)) < 0) { + flags) < 0) { return -1; } =20 --=20 2.26.2 From nobody Sat May 4 21:09:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1600884959; cv=none; d=zohomail.com; s=zohoarc; b=RtRhki2p3M2pT9PLOikifADj10xYi+UjFamJUm9DFJLSlnlswc/PftJvdIwwphmWduaDsD21UtGdbz5F9VpJ8X4yUtrIBFu6hgdNeizAt19eL5TWUGGx0PkRxSMuo82S6z0p9K3uYZS71Yc8V6mMTcm6DM7uUFNoyv00N5Tx/PU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600884959; 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=kteSilwgpc13oicBgYMhDyzll0i0Xm1khyRkgQpTZQg=; b=JSdCWZVb/tF18M/yuF6w+q1UZ6WQaF6roJOOphG5O1/tNduFeF0ad4XZegAaE41JGuab3NNnlI8zyDK3v77CLXq9ilR26E5gVd7Ur0SQp+FhtmFZXbdNQcfFK+VE9Rv6F3kzA9ZXVjaYy/ngQjHDPSlY+RKdh4qrL3OhA3LXGeo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1600884959495556.9278670338502; Wed, 23 Sep 2020 11:15:59 -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-521-clJeEwHXNfyo2ia2TxXtZQ-1; Wed, 23 Sep 2020 14:15:54 -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 1EE44102120B; Wed, 23 Sep 2020 18:15:48 +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 EED255C22B; Wed, 23 Sep 2020 18:15:47 +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 B893F8C7D3; Wed, 23 Sep 2020 18:15:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08NIFIaa018198 for ; Wed, 23 Sep 2020 14:15:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5D807702E7; Wed, 23 Sep 2020 18:15:18 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id DA21E7882C for ; Wed, 23 Sep 2020 18:15:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600884958; 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=kteSilwgpc13oicBgYMhDyzll0i0Xm1khyRkgQpTZQg=; b=F76HfQvdmUXbB0DCcO8BbCfxcDlY3B8oplZSCr2hGgoiU1Z8vNxa/pAp1OJZ8y5Hd6HdGN Kr9u4E414KdTYQs+r/HeVtGpJja8yuqubY4AdREptL5M2a+Dm06B7dg92uFtbMpr0PDN4s kIvdr47KaOKSGrbrY7aGdhw1YV1uroo= X-MC-Unique: clJeEwHXNfyo2ia2TxXtZQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 12/14] vbox: reduce variable scope in vboxDumpStorageControllers Date: Wed, 23 Sep 2020 20:15:01 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Most of the variables were reinitialized on every iteration. Also remove the pointless initialization of 'i'. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Martin Kletzander --- src/vbox/vbox_common.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index b9b72e2e02..6a517ff96c 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -3079,23 +3079,18 @@ static int vboxDumpStorageControllers(virDomainDefPtr def, IMachine *machine) { vboxArray storageControllers =3D VBOX_ARRAY_INITIALIZER; - IStorageController *controller =3D NULL; - PRUint32 storageBus =3D StorageBus_Null; - PRUint32 controllerType =3D StorageControllerType_Null; - virDomainControllerDefPtr cont =3D NULL; - size_t i =3D 0; - int model =3D -1, ret =3D -1; - virDomainControllerType type =3D VIR_DOMAIN_CONTROLLER_TYPE_LAST; + int ret =3D -1; + size_t i; =20 gVBoxAPI.UArray.vboxArrayGet(&storageControllers, machine, gVBoxAPI.UArray.handleMachineGetStorageControllers(machin= e)); =20 for (i =3D 0; i < storageControllers.count; i++) { - controller =3D storageControllers.items[i]; - storageBus =3D StorageBus_Null; - controllerType =3D StorageControllerType_Null; - type =3D VIR_DOMAIN_CONTROLLER_TYPE_LAST; - model =3D -1; + IStorageController *controller =3D storageControllers.items[i]; + PRUint32 storageBus =3D StorageBus_Null; + PRUint32 controllerType =3D StorageControllerType_Null; + virDomainControllerType type =3D VIR_DOMAIN_CONTROLLER_TYPE_LAST; + int model =3D -1; =20 if (!controller) continue; @@ -3133,8 +3128,6 @@ vboxDumpStorageControllers(virDomainDefPtr def, IMach= ine *machine) case StorageControllerType_IntelAhci: case StorageControllerType_I82078: case StorageControllerType_Null: - model =3D -1; - break; } =20 @@ -3165,6 +3158,8 @@ vboxDumpStorageControllers(virDomainDefPtr def, IMach= ine *machine) } =20 if (type !=3D VIR_DOMAIN_CONTROLLER_TYPE_LAST) { + virDomainControllerDefPtr cont; + cont =3D virDomainDefAddController(def, type, -1, model); if (!cont) { virReportError(VIR_ERR_INTERNAL_ERROR, --=20 2.26.2 From nobody Sat May 4 21:09:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1600884940; cv=none; d=zohomail.com; s=zohoarc; b=ih2vJhQjEmvdWvhTz5i4GvFJvBDtmmhxesKr0S+PnymKNMQpKsYKm391clKUo9IDuFOdZOTsfagvfe3OpGMRs4XE1jIHo1FvXiyQMTvB49JQCnVJ6sWapotRhAMTpd1iiq3ASPoMXAuRlZkUOdwKTqOsEpmtgZCo1KPltwkKD9A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600884940; 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=AeMkcqF/ah1Uu3XSjkP8/P96SvBoOkM3/26yjGuMnUA=; b=DpYJwJNbFlk4+SUls0VLv/AJ1FmMJSS+0XkV+m8AOo25Vzq3d8OXDkJVqFijZDFFATy/SMibwAq+I8sooKIoKHnw/iDBx4OqL4yYqa9k4DX6bPQ0fK/IsJYR+CHKIvJOZU+cMjYH2hsjX5HsGNcuERw5qkncOhoPwx+lUMKHwZg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1600884940644672.3753381112701; Wed, 23 Sep 2020 11:15:40 -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-253-hgp5XyFbNM2LfFC3oi-qrQ-1; Wed, 23 Sep 2020 14:15:36 -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 461BD81F006; Wed, 23 Sep 2020 18:15:30 +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 20AEF5C1DC; Wed, 23 Sep 2020 18:15:30 +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 DF62D8C7CA; Wed, 23 Sep 2020 18:15:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08NIFJ4p018227 for ; Wed, 23 Sep 2020 14:15:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2FFBF78816; Wed, 23 Sep 2020 18:15:19 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB992702E7 for ; Wed, 23 Sep 2020 18:15:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600884939; 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=AeMkcqF/ah1Uu3XSjkP8/P96SvBoOkM3/26yjGuMnUA=; b=TZXnXyRk0JxwxnOTV7Y8A080/++vD87apA0S5spwKUidu1dQnh7DU/yFa0KIeHofg+7hr1 d8CceyfVGrvqKCSB8aMoCUIhOicZUW568+Rsk2jjs72AFHkDq4+tXXzpBGk8Wof4mgJEB2 g1ozD19Dt1pX1ceOxHF+sQjcMTeQGtk= X-MC-Unique: hgp5XyFbNM2LfFC3oi-qrQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 13/14] storage: storageBackendWipeLocal: reduce variable scope Date: Wed, 23 Sep 2020 20:15:02 +0200 Message-Id: <165ec56d1289fa2efdba8eb8003b4b955cdf2bc2.1600884543.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Also use MIN instead of open-coding it. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Martin Kletzander --- src/storage/storage_util.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index 49ecbc5344..23632fc884 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -2526,10 +2526,8 @@ storageBackendWipeLocal(const char *path, size_t writebuf_length, bool zero_end) { - int written =3D 0; unsigned long long remaining =3D 0; off_t size; - size_t write_size =3D 0; g_autofree char *writebuf =3D NULL; =20 if (VIR_ALLOC_N(writebuf, writebuf_length) < 0) @@ -2557,9 +2555,9 @@ storageBackendWipeLocal(const char *path, =20 remaining =3D wipe_len; while (remaining > 0) { + size_t write_size =3D MIN(writebuf_length, remaining); + int written =3D safewrite(fd, writebuf, write_size); =20 - write_size =3D (writebuf_length < remaining) ? writebuf_length : r= emaining; - written =3D safewrite(fd, writebuf, write_size); if (written < 0) { virReportSystemError(errno, _("Failed to write %zu bytes to " --=20 2.26.2 From nobody Sat May 4 21:09:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1600885033; cv=none; d=zohomail.com; s=zohoarc; b=QIETW4HvNVGLPCDJDU676SFOwTtplsARXddX+BU/PoFQunNJ22TsmdLgpxnnl6VPK/fpXMI2CCzWK5r2U0clderKP1S3uHPO0Knhb8VBpQE662oEshbjPg0bAOo9UGx1BvndFCWiBkr7BthoQMSu9objXG5DC4BXHNwwtjdImCE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600885033; 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=Ad4oyowqejG/xSIdJL+5zX+slWTHOYoY06sKD4oHybI=; b=ApOmA892ThDQzDYjDnJqyBtKb7Yvg1FD86mPmbv+52DSQJSyM36jV2DukKGqbKzpFiyyqw614WVU0heAPNQG9KSXEGs1xKqNBtfg9bjodJJwqwzujF0gHcq1hZTMabd4IBuTw6i6qA34Kbt0MCE6tBzaIcYehxgj1XPKZhzEv5E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1600885033370230.51578478504598; Wed, 23 Sep 2020 11:17:13 -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-337-rKWaOXGqP3-6u_nS-zDaNQ-1; Wed, 23 Sep 2020 14:15:58 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 69F891021207; Wed, 23 Sep 2020 18:15:52 +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 48EC178831; Wed, 23 Sep 2020 18:15:52 +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 183E08C7D8; Wed, 23 Sep 2020 18:15:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08NIFKvh018234 for ; Wed, 23 Sep 2020 14:15:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0251B78816; Wed, 23 Sep 2020 18:15:20 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7D8EC702E7 for ; Wed, 23 Sep 2020 18:15:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600885032; 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=Ad4oyowqejG/xSIdJL+5zX+slWTHOYoY06sKD4oHybI=; b=BilLUDJaqteKF3D0lagmXaPhgmsHEsBEnT4hTaIz52/UU+jyN+gnO9g922v+kvBGgqiqlo IFEng67Sb7yaUzZ9HMvuAIDBKRpNAvSZFxq1lmwSryHRNDFBN/+i37Za0WWi1Cl2lmyZLB eql9XjTqq24EPldO2GcErZWzOMyu3Jk= X-MC-Unique: rKWaOXGqP3-6u_nS-zDaNQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 14/14] Reduce scope of some variables Date: Wed, 23 Sep 2020 20:15:03 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.11 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: J=C3=A1n Tomko Reviewed-by: Martin Kletzander --- src/libvirt-host.c | 4 +--- src/node_device/node_device_driver.c | 3 ++- src/storage/storage_backend_mpath.c | 3 +-- src/storage/storage_util.c | 6 ++---- tools/virsh-pool.c | 3 ++- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/libvirt-host.c b/src/libvirt-host.c index 07d13585f4..58622d415d 100644 --- a/src/libvirt-host.c +++ b/src/libvirt-host.c @@ -1352,8 +1352,6 @@ virConnectSetKeepAlive(virConnectPtr conn, int interval, unsigned int count) { - int ret =3D -1; - VIR_DEBUG("conn=3D%p, interval=3D%d, count=3D%u", conn, interval, coun= t); =20 virResetLastError(); @@ -1361,7 +1359,7 @@ virConnectSetKeepAlive(virConnectPtr conn, virCheckConnectReturn(conn, -1); =20 if (conn->driver->connectSetKeepAlive) { - ret =3D conn->driver->connectSetKeepAlive(conn, interval, count); + int ret =3D conn->driver->connectSetKeepAlive(conn, interval, coun= t); if (ret < 0) goto error; return ret; diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_de= vice_driver.c index f4b140bef4..f5ea973c7a 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -747,7 +747,6 @@ nodeDeviceCreateXML(virConnectPtr conn, g_autoptr(virNodeDeviceDef) def =3D NULL; g_autofree char *wwnn =3D NULL; g_autofree char *wwpn =3D NULL; - int parent_host =3D -1; virNodeDevicePtr device =3D NULL; const char *virt_type =3D NULL; =20 @@ -765,6 +764,8 @@ nodeDeviceCreateXML(virConnectPtr conn, return NULL; =20 if (nodeDeviceHasCapability(def, VIR_NODE_DEV_CAP_SCSI_HOST)) { + int parent_host; + if (virNodeDeviceGetWWNs(def, &wwnn, &wwpn) =3D=3D -1) return NULL; =20 diff --git a/src/storage/storage_backend_mpath.c b/src/storage/storage_back= end_mpath.c index fffc0f86b7..f474ab32a9 100644 --- a/src/storage/storage_backend_mpath.c +++ b/src/storage/storage_backend_mpath.c @@ -151,13 +151,12 @@ static int virStorageBackendCreateVols(virStoragePoolObjPtr pool, struct dm_names *names) { - int is_mpath =3D 0; uint32_t minor =3D -1; uint32_t next; g_autofree char *map_device =3D NULL; =20 do { - is_mpath =3D virStorageBackendIsMultipath(names->name); + int is_mpath =3D virStorageBackendIsMultipath(names->name); =20 if (is_mpath < 0) return -1; diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index 23632fc884..7bfcf53570 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -2416,7 +2416,6 @@ virStorageBackendVolUploadLocal(virStoragePoolObjPtr = pool G_GNUC_UNUSED, unsigned int flags) { char *target_path =3D vol->target.path; - int has_snap =3D 0; bool sparse =3D flags & VIR_STORAGE_VOL_UPLOAD_SPARSE_STREAM; g_autofree char *path =3D NULL; =20 @@ -2427,7 +2426,7 @@ virStorageBackendVolUploadLocal(virStoragePoolObjPtr = pool G_GNUC_UNUSED, * when volUpload is fully finished. */ if (vol->target.format =3D=3D VIR_STORAGE_FILE_PLOOP) { /* Fail if the volume contains snapshots or we failed to check it.= */ - has_snap =3D storageBackendPloopHasSnapshots(vol->target.path); + int has_snap =3D storageBackendPloopHasSnapshots(vol->target.path); if (has_snap < 0) { return -1; } else if (!has_snap) { @@ -2456,13 +2455,12 @@ virStorageBackendVolDownloadLocal(virStoragePoolObj= Ptr pool G_GNUC_UNUSED, unsigned int flags) { char *target_path =3D vol->target.path; - int has_snap =3D 0; bool sparse =3D flags & VIR_STORAGE_VOL_DOWNLOAD_SPARSE_STREAM; g_autofree char *path =3D NULL; =20 virCheckFlags(VIR_STORAGE_VOL_DOWNLOAD_SPARSE_STREAM, -1); if (vol->target.format =3D=3D VIR_STORAGE_FILE_PLOOP) { - has_snap =3D storageBackendPloopHasSnapshots(vol->target.path); + int has_snap =3D storageBackendPloopHasSnapshots(vol->target.path); if (has_snap < 0) { return -1; } else if (!has_snap) { diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c index 634e9ac8cd..497b409989 100644 --- a/tools/virsh-pool.c +++ b/tools/virsh-pool.c @@ -1583,7 +1583,6 @@ cmdPoolInfo(vshControl *ctl, const vshCmd *cmd) virStoragePoolInfo info; virStoragePoolPtr pool; int autostart =3D 0; - int persistent =3D 0; bool ret =3D true; bool bytes =3D false; char uuid[VIR_UUID_STRING_BUFLEN]; @@ -1601,6 +1600,8 @@ cmdPoolInfo(vshControl *ctl, const vshCmd *cmd) if (virStoragePoolGetInfo(pool, &info) =3D=3D 0) { double val; const char *unit; + int persistent; + vshPrint(ctl, "%-15s %s\n", _("State:"), virshStoragePoolStateToString(info.state)); =20 --=20 2.26.2