From nobody Mon Feb 9 18:44:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658400438; cv=none; d=zohomail.com; s=zohoarc; b=X3/DtLza1KBaYFVJf4bHbHsJ6nULvyLrV+44MIe64gV4EfrK6fBHUmd2M4880mx7hBLGuAGamx/QN3PSW2tkvwFNa/URqrUG6XJXIHAYar5LQuTcF3tjo1hqISTD6IOW0HqhG0F1B7HSJZLDGdL/7Q1FE8+SkU8xNwNknuLQikk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658400438; 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=iafolzZne3GwCytdf4kY66SajQsUF3m6kBIXPI8OsLw=; b=WE5JKo5u9uYv3OcNk6FzLqa3IjHPXZfN35fTFiJw4tAQbrfVpZxBEycf2taKq1hq4pD+MaIEhR/qqrgHb7YjR60csS388VT0wrdTQlNldb5Jd1NEolfJHKfAZ7mvW/J1xR+GJwlBTpRzb50x89VjxIaeubM59BusIkksoYzxSxE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1658400438377828.9193189358898; Thu, 21 Jul 2022 03:47:18 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-144-jyt48ITSOdeowFARV3_cwQ-1; Thu, 21 Jul 2022 06:46:19 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B75531C13940; Thu, 21 Jul 2022 10:46:16 +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 A5EB4400E894; Thu, 21 Jul 2022 10:46:16 +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 77F0F1947048; Thu, 21 Jul 2022 10:46:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 58729194704B for ; Thu, 21 Jul 2022 10:46:13 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 3B930400E894; Thu, 21 Jul 2022 10:46:13 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id DA46040CFD0A for ; Thu, 21 Jul 2022 10:46:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658400437; 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=iafolzZne3GwCytdf4kY66SajQsUF3m6kBIXPI8OsLw=; b=JAHdwP94lYiOSqMOAJxdRobL3kkepmnzQ3tlyZ2gAEE+SJ20f3hoNeAFOzsYEcfoBalY10 8nD6w5oU0BrmeAzBVj2FQKY6Tzbs/ZkG0wHtNLaZRg2a4EvtGrj+DKpPEJDo+LWcSi/wa0 Bys1DexzHbe6WvVBk6hvIEEqxepNJVU= X-MC-Unique: jyt48ITSOdeowFARV3_cwQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvirt-list@redhat.com Subject: [PATCH v2 7/8] domain_conf: rewrite conditions in virDomainObjWaitUntil() Date: Thu, 21 Jul 2022 12:45:52 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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.84 on 10.11.54.1 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: 1658400439422100001 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 Reviewed-by: Martin Kletzander --- 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 507bff953c..bbe6574487 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4009,15 +4009,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