From nobody Mon Nov 25 14:44:53 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=1602770583; cv=none; d=zohomail.com; s=zohoarc; b=KFyR7BNtPjtbBH3G0cXNPIRIAbTfT49QVrcLx1MyVThVH4fCJtF5YPlyMmcCfem5YZmoDeXV7asRFo9Kb4qavid/lGuGi1q6i/FjIau6S3dIcyYwNp2SbgZd53dU9RMRDNBxVYk/r3W5P8KG3ZeViJ8vVlVoDcjtQpQ0eyNOkiU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602770583; 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=fcvyvW2H/YXD9F0zbSBJwsvUV/ZRavf+P038hsrtsPA=; b=ZSgqQafnhiDCJCYO0AC6/+StLL+87fKKNtxzazBvL3IfQPDldfTurH6dkHl98qoePOgGgUdbGfdlYx19KD/IN7K4JYSvizezBkAeEpROqOeOVyZjLXhRC9rthl8xpd+HFyN8hz8gruxWfE7/o0/TZeR+TKShz9GfajCyePR84do= 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 1602770582955469.4733394320082; Thu, 15 Oct 2020 07:03:02 -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-34-uhGUQl-lM3SVjU9BO165-g-1; Thu, 15 Oct 2020 10:02:57 -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 1F7BA108E1BE; Thu, 15 Oct 2020 14:01:44 +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 EC09919C66; Thu, 15 Oct 2020 14:01:43 +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 AF624181A050; Thu, 15 Oct 2020 14:01:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 09FE0E87002746 for ; Thu, 15 Oct 2020 10:00:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9D75C5C22D; Thu, 15 Oct 2020 14:00:14 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.193.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1C5145C1BD for ; Thu, 15 Oct 2020 14:00:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602770580; 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=fcvyvW2H/YXD9F0zbSBJwsvUV/ZRavf+P038hsrtsPA=; b=gJJMjSaooRhXXHeCqTRVgAqlSsyMg/9XnBPrVsw02NR5qjKO9m4mr0dUHjIM8bkr7DKRdt IhUBnRYkaYRjF1ooV2WKtwAiRzXj1hAZ5fO5QrU4OjAZTOYuYyhFQfS1/wd1emqQAYxqTm nl9syA0aO9gYGLAhkJPsIpOq0IqLkc8= X-MC-Unique: uhGUQl-lM3SVjU9BO165-g-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/5] hyperv: Reindent hypervInvokeMethod() body Date: Thu, 15 Oct 2020 16:00:07 +0200 Message-Id: <700ec8567b49f8afb41c10fc8dd80775e0842ab1.1602770344.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Michal Privoznik --- src/hyperv/hyperv_wmi.c | 92 ++++++++++++++++++++--------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c index 78d15e2a43..779f4265b5 100644 --- a/src/hyperv/hyperv_wmi.c +++ b/src/hyperv/hyperv_wmi.c @@ -791,14 +791,14 @@ hypervInvokeMethod(hypervPrivate *priv, =20 if (hypervCreateInvokeXmlDoc(params, ¶msDocRoot) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Could not create XML document")); + _("Could not create XML document")); goto cleanup; } =20 methodNode =3D xml_parser_get_root(paramsDocRoot); if (!methodNode) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Could not get root of XML document")); + _("Could not get root of XML document")); goto cleanup; } =20 @@ -807,25 +807,25 @@ hypervInvokeMethod(hypervPrivate *priv, p =3D &(params->params[i]); =20 switch (p->type) { - case HYPERV_SIMPLE_PARAM: - if (hypervSerializeSimpleParam(p, params->resourceUri, - &methodNode) < 0) - goto cleanup; - break; - case HYPERV_EPR_PARAM: - if (hypervSerializeEprParam(p, priv, params->resourceUri, - &methodNode) < 0) - goto cleanup; - break; - case HYPERV_EMBEDDED_PARAM: - if (hypervSerializeEmbeddedParam(p, params->resourceUri, - &methodNode) < 0) - goto cleanup; - break; - default: - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Unknown parameter type")); + case HYPERV_SIMPLE_PARAM: + if (hypervSerializeSimpleParam(p, params->resourceUri, + &methodNode) < 0) goto cleanup; + break; + case HYPERV_EPR_PARAM: + if (hypervSerializeEprParam(p, priv, params->resourceUri, + &methodNode) < 0) + goto cleanup; + break; + case HYPERV_EMBEDDED_PARAM: + if (hypervSerializeEmbeddedParam(p, params->resourceUri, + &methodNode) < 0) + goto cleanup; + break; + default: + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unknown parameter type")); + goto cleanup; } } =20 @@ -840,7 +840,7 @@ hypervInvokeMethod(hypervPrivate *priv, =20 /* do the invoke */ response =3D wsmc_action_invoke(priv->client, params->resourceUri, opt= ions, - params->method, paramsDocRoot); + params->method, paramsDocRoot); =20 /* check return code of invocation */ returnValue_xpath =3D g_strdup_printf("/s:Envelope/s:Body/p:%s_OUTPUT/= p:ReturnValue", @@ -888,43 +888,43 @@ hypervInvokeMethod(hypervPrivate *priv, virBufferEscapeSQL(&query, "where InstanceID =3D \"%s\"", inst= anceID); =20 if (hypervGetWmiClassList(priv, Msvm_ConcreteJob_WmiInfo, &que= ry, - (hypervObject **)&job) < 0 || job =3D=3D NULL) + (hypervObject **)&job) < 0 || job = =3D=3D NULL) goto cleanup; =20 jobState =3D job->data.common->JobState; switch (jobState) { - case MSVM_CONCRETEJOB_JOBSTATE_NEW: - case MSVM_CONCRETEJOB_JOBSTATE_STARTING: - case MSVM_CONCRETEJOB_JOBSTATE_RUNNING: - case MSVM_CONCRETEJOB_JOBSTATE_SHUTTING_DOWN: - hypervFreeObject(priv, (hypervObject *)job); - job =3D NULL; - g_usleep(100 * 1000); /* sleep 100 ms */ - timeout -=3D 100; - continue; - case MSVM_CONCRETEJOB_JOBSTATE_COMPLETED: - completed =3D true; - break; - case MSVM_CONCRETEJOB_JOBSTATE_TERMINATED: - case MSVM_CONCRETEJOB_JOBSTATE_KILLED: - case MSVM_CONCRETEJOB_JOBSTATE_EXCEPTION: - case MSVM_CONCRETEJOB_JOBSTATE_SERVICE: - goto cleanup; - default: - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Unknown invocation state")); - goto cleanup; + case MSVM_CONCRETEJOB_JOBSTATE_NEW: + case MSVM_CONCRETEJOB_JOBSTATE_STARTING: + case MSVM_CONCRETEJOB_JOBSTATE_RUNNING: + case MSVM_CONCRETEJOB_JOBSTATE_SHUTTING_DOWN: + hypervFreeObject(priv, (hypervObject *)job); + job =3D NULL; + g_usleep(100 * 1000); /* sleep 100 ms */ + timeout -=3D 100; + continue; + case MSVM_CONCRETEJOB_JOBSTATE_COMPLETED: + completed =3D true; + break; + case MSVM_CONCRETEJOB_JOBSTATE_TERMINATED: + case MSVM_CONCRETEJOB_JOBSTATE_KILLED: + case MSVM_CONCRETEJOB_JOBSTATE_EXCEPTION: + case MSVM_CONCRETEJOB_JOBSTATE_SERVICE: + goto cleanup; + default: + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unknown invocation state")); + goto cleanup; } } if (!completed && timeout < 0) { virReportError(VIR_ERR_OPERATION_TIMEOUT, - _("Timeout waiting for %s invocation"), params->method= ); + _("Timeout waiting for %s invocation"), params-= >method); goto cleanup; } } else if (returnCode !=3D CIM_RETURNCODE_COMPLETED_WITH_NO_ERROR) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Invocation of %s returne= d an error: %s (%d)"), - params->method, hypervReturnCodeToString(returnCode), - returnCode); + params->method, hypervReturnCodeToString(returnCode= ), + returnCode); goto cleanup; } =20 --=20 2.26.2