From nobody Thu May 9 23:16:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1646045583; cv=none; d=zohomail.com; s=zohoarc; b=G9c5j3BSZtXb0UsCUJqt+/qHIGjRqP9n9nGe3PvvXQ64DJhv7nYrxA2CdvXdXFxTjS4tWDuwG7mXM8oepZLn/b9QY9PGNWw9fMUnWksgWRBmCdJOvEXYE2jM1Z28lCPCI3XpPxeaiY4KVgoEofRXO7XrAPj4pL32g34NWE7qeks= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646045583; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=XnlKTvDkwmfbT7mTr20FAtDQa1jM4kL5PE630H3psS4=; b=kMki7cW5bUQXHaGvxEiIY8IO9qDkSzh8EwvIwxUDfHcCkz+eQ9x2W98Ker5oqoLhc7xm3TVvyZuktUaWOZ5pt+qfoAkrb0Yum2A4DieStLIUPbBXoO6T95AVJwnA9UKDAuoKjfVvIIAux+4BxZUdqfhouCgo9MdX1XxigMRg5jI= 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 1646045583562428.889510889254; Mon, 28 Feb 2022 02:53:03 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-496-B_vDh_tFOaKw02cgU-WmmA-1; Mon, 28 Feb 2022 05:52:58 -0500 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 931D88066F3; Mon, 28 Feb 2022 10:52:52 +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 C6B8C83194; Mon, 28 Feb 2022 10:52:50 +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 F10FF1809C98; Mon, 28 Feb 2022 10:52:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21SAo5Dd029746 for ; Mon, 28 Feb 2022 05:50:05 -0500 Received: by smtp.corp.redhat.com (Postfix) id EB0678247F; Mon, 28 Feb 2022 10:50:05 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.78]) by smtp.corp.redhat.com (Postfix) with ESMTP id 74F8483075 for ; Mon, 28 Feb 2022 10:50:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646045582; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=XnlKTvDkwmfbT7mTr20FAtDQa1jM4kL5PE630H3psS4=; b=QG3beCHx5vCE7HIWGQBq6Ryvq3nSHu236bbACS8v5tHzGWF0YzLONLf6eVlovRW38YzOEM tMnNq2KnLKEiboe2K35cQSU5qrgF0UCAOP/SmGNpSlL6M+6wez9IbE5RtIjfRJTbQPSLMI Ji5R/KpQwq2VCO/U8mT30Z36INHsPsc= X-MC-Unique: B_vDh_tFOaKw02cgU-WmmA-1 From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH] libxl: remove redundant variable from libxlDomainJobObj Date: Mon, 28 Feb 2022 11:49:23 +0100 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1646045585888100002 Content-Type: text/plain; charset="utf-8" It makes no sense to have 'started' variable in the libxlDomainJobObj as the same one is already in virDomainJobData, but never used. Signed-off-by: Kristina Hanicova Reviewed-by: Michal Privoznik --- src/libxl/libxl_domain.c | 10 +++++----- src/libxl/libxl_domain.h | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index ee031267ca..205049f98a 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -118,7 +118,7 @@ libxlDomainObjBeginJob(libxlDriverPrivate *driver G_GNU= C_UNUSED, VIR_DEBUG("Starting job: %s", libxlDomainJobTypeToString(job)); priv->job.active =3D job; priv->job.owner =3D virThreadSelfID(); - priv->job.started =3D now; + priv->job.current->started =3D now; priv->job.current->jobType =3D VIR_DOMAIN_JOB_UNBOUNDED; =20 return 0; @@ -171,18 +171,18 @@ libxlDomainJobUpdateTime(struct libxlDomainJobObj *jo= b) virDomainJobData *jobData =3D job->current; unsigned long long now; =20 - if (!job->started) + if (!jobData->started) return 0; =20 if (virTimeMillisNow(&now) < 0) return -1; =20 - if (now < job->started) { - job->started =3D 0; + if (now < jobData->started) { + jobData->started =3D 0; return 0; } =20 - jobData->timeElapsed =3D now - job->started; + jobData->timeElapsed =3D now - jobData->started; return 0; } =20 diff --git a/src/libxl/libxl_domain.h b/src/libxl/libxl_domain.h index 475e4a6933..157f480b93 100644 --- a/src/libxl/libxl_domain.h +++ b/src/libxl/libxl_domain.h @@ -46,7 +46,6 @@ struct libxlDomainJobObj { virCond cond; /* Use to coordinate jobs */ enum libxlDomainJob active; /* Currently running job */ int owner; /* Thread which set current job */ - unsigned long long started; /* When the job started */ virDomainJobData *current; /* Statistics for the current job */ }; =20 --=20 2.35.1