From nobody Mon Feb 9 00:55:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658322788; cv=none; d=zohomail.com; s=zohoarc; b=V41l5oTCPHs550kzj1KmpM/2hkeTxOO6bs2sPS9yNcmNofok3kwjcJJJrUKUeQErU9hDyhL5p+PIPvba3IFwoy1LupvMUp5JhnBwhgUt11Nfn0vNlCzhimVl6fkMi5LnCFM4LkHkA2ZaTjz8Auo+O3qZ3G5fhDKHmH0Q5tcqKpU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658322788; 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=tMF4Zn8k5v6uSuyjG20HanhGovAs1K1ms0xxVVm5+VE=; b=QHNq2WycPMJuB2VOMHLRYqhoevMXArZ2Xa+QsB1w3mxZfMwn31bFW+Jtfj8ok7T/VJ0dY6qPnBplRIX0whHvFecusx9lBoQ0tf5jLS9tHOdsYfzOzcFmk6ATuN3ulzYDP6I8cfD2VAuIeUdSSY15aHovKsBYEW4IOZVmKizuVTU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1658322788772817.1259852293299; Wed, 20 Jul 2022 06:13:08 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-9-mudLugXXMCOfO7aeavr96w-1; Wed, 20 Jul 2022 09:13:03 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0491494E6EE; Wed, 20 Jul 2022 13:13:00 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id E509F2026D64; Wed, 20 Jul 2022 13:12:59 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3FD551923CA3; Wed, 20 Jul 2022 13:12:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B85731947066 for ; Wed, 20 Jul 2022 13:11:23 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 91EAF40D296B; Wed, 20 Jul 2022 13:11:23 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C82B40D2962 for ; Wed, 20 Jul 2022 13:11:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658322787; 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=tMF4Zn8k5v6uSuyjG20HanhGovAs1K1ms0xxVVm5+VE=; b=LQrb5AlCFjs0CBYZD2H0yWacV1vK1bUTtqp7SOp8gf5kc8+bZI1rgyWHa3ZuVLhQGk7a2H ucN5HEQSg7GcLs8uR9+entPsiEjDVYT7+t6+rd5GKPh2SCztWmPApcQ1EO2Xr06fYLrOIZ S5i+mPYzt+CsiCNcanysCfhPBEMTGL8= X-MC-Unique: mudLugXXMCOfO7aeavr96w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH 8/9] domain_conf: rewrite conditions in virDomainObjWaitUntil() Date: Wed, 20 Jul 2022 15:11:11 +0200 Message-Id: <0892e8f93ec408bab448571c3bc70e66098fd81a.1658322264.git.khanicov@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658322790665100003 Content-Type: text/plain; charset="utf-8"; x-default="true" This patch rewrites conditions to make the code easier and less structured. Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 1c29a2d929..e52f39c809 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3999,15 +3999,15 @@ int virDomainObjWaitUntil(virDomainObj *vm, unsigned long long whenms) { - if (virCondWaitUntil(&vm->cond, &vm->parent.lock, whenms) < 0) { - if (errno !=3D ETIMEDOUT) { - virReportSystemError(errno, "%s", - _("failed to wait for domain condition")); - return -1; - } + if (virCondWaitUntil(&vm->cond, &vm->parent.lock, whenms) >=3D 0) + return 0; + + if (errno =3D=3D ETIMEDOUT) return 1; - } - return 0; + + virReportSystemError(errno, "%s", + _("failed to wait for domain condition")); + return -1; } =20 =20 --=20 2.35.3