From nobody Thu May 2 05:30:18 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=1601388960; cv=none; d=zohomail.com; s=zohoarc; b=hrzFjlZ+KqmJdocHbsUsbjFA49op4MjTzuoE5OgjyDOG2V+8j7KzxS0+tkX0sxjUAf4/nDhKsQ0J0QNYTtapKGkgDgeeVBi+YxQ9/9LZgGmGyg22Gb+dFSyO7un/4VPcHS2dEyxg6WdXuSbfIaLDbZyoEVt+d1laztWuSSk5940= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601388960; 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=MMW3RIcdncdFmJnsD+S8GJV52TuquA+Bz8QvxEwSQsU=; b=OR2K4J1C+NVKFcuOxUUYkIvfQKckgXAm9R/6unkpTXwEjpTj71RFNRK7BxT8E+9BN2kQxw+1sHGu5xpedFdoel+RXB3ZS8FXd7EwtThTjpL4i64PB7GZdV0A5Rai6KeZnygNUnoRu6mF3z8Gx84oOb4LPlKM/I+Lz6oTbTBPQHc= 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 1601388960369683.5003055458964; Tue, 29 Sep 2020 07:16:00 -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-141-mW2f2wqOMBiQMs_APfUY0w-1; Tue, 29 Sep 2020 10:15:56 -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 509C8802B69; Tue, 29 Sep 2020 14:15:50 +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 C055F5579B; Tue, 29 Sep 2020 14:15:48 +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 728311832FC1; Tue, 29 Sep 2020 14:15:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08TEFhkr015160 for ; Tue, 29 Sep 2020 10:15:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id B37611002C0E; Tue, 29 Sep 2020 14:15:43 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B0541002C0D for ; Tue, 29 Sep 2020 14:15:42 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601388959; 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=MMW3RIcdncdFmJnsD+S8GJV52TuquA+Bz8QvxEwSQsU=; b=CQxdtADvlsrO97e927/9m5I6P4XpQU4GsvRU2suQXe4VgghnDloz+vDCJMxUK+HHAoNDKe HgAj0KPkmVxmOk19q8jI1UT5QchshUZKTjEblIDYEINP/ntTY6QJVQb9UhbNbLGJnxWMY9 v/Ay5hee85Z+yS2nRc7AF4xvRI8WUdU= X-MC-Unique: mW2f2wqOMBiQMs_APfUY0w-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/6] qemu: migration: Rename qemuMigrationBakeCookie to qemuMigrationCookieFormat Date: Tue, 29 Sep 2020 16:15:31 +0200 Message-Id: <4c13316caea572d5df8face8cc0fb734b2984f9e.1601388825.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Use a more descriptive name and move the verb to the end so that the functions conform with the naming policy. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_migration.c | 28 ++++++++++++++-------------- src/qemu/qemu_migration_cookie.c | 14 +++++++------- src/qemu/qemu_migration_cookie.h | 14 +++++++------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 5708334d2f..33591ba26b 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2257,10 +2257,10 @@ qemuMigrationSrcBeginPhase(virQEMUDriverPtr driver, priv->origname, priv, NULL, 0, 0))) return NULL; - if (qemuMigrationBakeCookie(mig, driver, vm, - QEMU_MIGRATION_SOURCE, - cookieout, cookieoutlen, - cookieFlags) < 0) + if (qemuMigrationCookieFormat(mig, driver, vm, + QEMU_MIGRATION_SOURCE, + cookieout, cookieoutlen, + cookieFlags) < 0) return NULL; if (flags & VIR_MIGRATE_OFFLINE) { @@ -2758,9 +2758,9 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver, goto stopjob; done: - if (qemuMigrationBakeCookie(mig, driver, vm, - QEMU_MIGRATION_DESTINATION, - cookieout, cookieoutlen, cookieFlags) < 0)= { + if (qemuMigrationCookieFormat(mig, driver, vm, + QEMU_MIGRATION_DESTINATION, + cookieout, cookieoutlen, cookieFlags) < = 0) { /* We could tear down the whole guest here, but * cookie data is (so far) non-critical, so that * seems a little harsh. We'll just warn for now. @@ -3917,9 +3917,9 @@ qemuMigrationSrcRun(virQEMUDriverPtr driver, QEMU_MIGRATION_COOKIE_STATS; if (qemuMigrationCookieAddPersistent(mig, &persistDef) < 0 || - qemuMigrationBakeCookie(mig, driver, vm, - QEMU_MIGRATION_SOURCE, - cookieout, cookieoutlen, cookieFlags) < 0)= { + qemuMigrationCookieFormat(mig, driver, vm, + QEMU_MIGRATION_SOURCE, + cookieout, cookieoutlen, cookieFlags) < = 0) { VIR_WARN("Unable to encode migration cookie"); } @@ -5401,10 +5401,10 @@ qemuMigrationDstFinish(virQEMUDriverPtr driver, priv->job.completed->statsType =3D QEMU_DOMAIN_JOB_STATS_TYPE_= MIGRATION; } - if (qemuMigrationBakeCookie(mig, driver, vm, - QEMU_MIGRATION_DESTINATION, - cookieout, cookieoutlen, - QEMU_MIGRATION_COOKIE_STATS) < 0) + if (qemuMigrationCookieFormat(mig, driver, vm, + QEMU_MIGRATION_DESTINATION, + cookieout, cookieoutlen, + QEMU_MIGRATION_COOKIE_STATS) < 0) VIR_WARN("Unable to encode migration cookie"); /* Remove completed stats for post-copy, everything but timing fie= lds diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_coo= kie.c index 3ea46e1527..124f61e3ea 100644 --- a/src/qemu/qemu_migration_cookie.c +++ b/src/qemu/qemu_migration_cookie.c @@ -1389,13 +1389,13 @@ qemuMigrationCookieXMLParseStr(qemuMigrationCookieP= tr mig, int -qemuMigrationBakeCookie(qemuMigrationCookiePtr mig, - virQEMUDriverPtr driver, - virDomainObjPtr dom, - qemuMigrationParty party, - char **cookieout, - int *cookieoutlen, - unsigned int flags) +qemuMigrationCookieFormat(qemuMigrationCookiePtr mig, + virQEMUDriverPtr driver, + virDomainObjPtr dom, + qemuMigrationParty party, + char **cookieout, + int *cookieoutlen, + unsigned int flags) { qemuDomainObjPrivatePtr priv =3D dom->privateData; diff --git a/src/qemu/qemu_migration_cookie.h b/src/qemu/qemu_migration_coo= kie.h index 95e7edb899..587f4206b7 100644 --- a/src/qemu/qemu_migration_cookie.h +++ b/src/qemu/qemu_migration_cookie.h @@ -152,13 +152,13 @@ struct _qemuMigrationCookie { int -qemuMigrationBakeCookie(qemuMigrationCookiePtr mig, - virQEMUDriverPtr driver, - virDomainObjPtr dom, - qemuMigrationParty party, - char **cookieout, - int *cookieoutlen, - unsigned int flags); +qemuMigrationCookieFormat(qemuMigrationCookiePtr mig, + virQEMUDriverPtr driver, + virDomainObjPtr dom, + qemuMigrationParty party, + char **cookieout, + int *cookieoutlen, + unsigned int flags); qemuMigrationCookiePtr qemuMigrationEatCookie(virQEMUDriverPtr driver, --=20 2.26.2 From nobody Thu May 2 05:30:18 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=1601388983; cv=none; d=zohomail.com; s=zohoarc; b=VstmvMb/onZXXwZdQ6jw3qeQPT7fHzwwmcRpCZg/ZF9uxLK69mVLDCM+cpoCnkgNf1BSBI1lAsGEBlazAcV8780L8lb7I1WtPuciloD3K2PMv6KNh/+3ZsadfW8CVsr6YvKIRkVe2BJ3zC5PZYmYw3reOe40u+13ox9EBog6NQY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601388983; 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=Y1+FmgT5NA7IoRIncNSismhNHtAr8ilFb+condBh+2A=; b=lAn/bBBPOpEDbEc+7l09cntgPY6S3KSqur2R9tHiPbYNNFzurkps8i9IHI50uiJ644830hfdZOgzlTq0IHXU8eGtJKtpgqhWrMY1ZqlE75RExM3zCI9fGYRdAfQ+vhKKHUkoSPd9ph5IAN14dPE0vakB1NJiQxpr0HpamEFaw2U= 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 1601388983403847.4175696555762; Tue, 29 Sep 2020 07:16:23 -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-501-enr3_ovAM5qO_wuiG3NJ3g-1; Tue, 29 Sep 2020 10:16:17 -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 01BB919080C9; Tue, 29 Sep 2020 14:16:06 +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 D22FE5DA2A; Tue, 29 Sep 2020 14:16:05 +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 9D6341832FC5; Tue, 29 Sep 2020 14:16:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08TEFjMl015168 for ; Tue, 29 Sep 2020 10:15:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3E88B1002C0C; Tue, 29 Sep 2020 14:15:45 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 769921002C0A for ; Tue, 29 Sep 2020 14:15:43 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601388982; 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=Y1+FmgT5NA7IoRIncNSismhNHtAr8ilFb+condBh+2A=; b=Hb5cTGcxUHKft7XCeJsn5rYY3Fvchte8dvm+EW2M2Wftk6V/ZKOHDAUjNNuDnu5BaIBUpx vf45mAWXoILFh7DDpU6goN4LYkq5wZTd1hxky6jpmxo1f1yDhTiw8H3IjgjF+A5z5qhX7q EmIokPfJbCg8UDRFJuufkzP+/mG34Ws= X-MC-Unique: enr3_ovAM5qO_wuiG3NJ3g-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/6] qemuMigrationCookieNew: Refactor allocation and cleanup Date: Tue, 29 Sep 2020 16:15:32 +0200 Message-Id: <92f87338ee8e1ad6d3efde44412bd137e0003a65.1601388825.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Move around some code so that we can get rid of the 'cleanup:' label. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_migration_cookie.c | 35 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_coo= kie.c index 124f61e3ea..a04b74f092 100644 --- a/src/qemu/qemu_migration_cookie.c +++ b/src/qemu/qemu_migration_cookie.c @@ -280,31 +280,30 @@ qemuMigrationCookieNew(const virDomainDef *def, const char *origname) { qemuMigrationCookiePtr mig =3D NULL; - const char *name; + unsigned char localHostUUID[VIR_UUID_BUFLEN]; + g_autofree char *localHostname =3D NULL; - if (VIR_ALLOC(mig) < 0) - goto error; - - if (origname) - name =3D origname; - else - name =3D def->name; - mig->name =3D g_strdup(name); - memcpy(mig->uuid, def->uuid, VIR_UUID_BUFLEN); + if (!(localHostname =3D virGetHostname())) + return NULL; - if (!(mig->localHostname =3D virGetHostname())) - goto error; - if (virGetHostUUID(mig->localHostuuid) < 0) { + if (virGetHostUUID(localHostUUID) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Unable to obtain host UUID")); - goto error; + return NULL; } - return mig; + mig =3D g_new0(qemuMigrationCookie, 1); - error: - qemuMigrationCookieFree(mig); - return NULL; + if (origname) + mig->name =3D g_strdup(origname); + else + mig->name =3D g_strdup(def->name); + + memcpy(mig->uuid, def->uuid, VIR_UUID_BUFLEN); + memcpy(mig->localHostuuid, localHostUUID, VIR_UUID_BUFLEN); + mig->localHostname =3D g_steal_pointer(&localHostname); + + return mig; } --=20 2.26.2 From nobody Thu May 2 05:30:18 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=1601388978; cv=none; d=zohomail.com; s=zohoarc; b=KlHig3/0BD0BFheYg8pxVN2FD5Pe18eCFPe0uIUCKCeZQCxAvFq3HKySSyrxN1IuRzJmIX9Nyg4v6hVUdnQHcYEuIwMvap2xx3Q2junE//MZJoXpz2JzP0Jk3L1bYEjz+YmJMSY0BRSFoPlWCY0todEG6HCLfa5MlwyTAHV/KXI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601388978; 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=k92BIsUz/gXf8pckZ8u/DoxpaMyJqW6coRL7K0Qktlc=; b=KwQ8D4Ee1Slo8NVnTrB3MNzTRTMfeRmX2SY4kA5q5glN7w3CueP5xfB6zjHFFHutQ0t31xCXeWgjwFU+AgfMygz5AbJRMmo0pFnuCBc5jgjspUp1ZqfJhS1pSKuytU0kfhFN0RfgQ9gO803K0+LM9EVHbCnCijf8R1k15K5qyGI= 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 1601388978945227.76868321426957; Tue, 29 Sep 2020 07:16:18 -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-316-9o9OSsvSOqyrJjEq8VWeDQ-1; Tue, 29 Sep 2020 10:16:11 -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 F10728030C6; Tue, 29 Sep 2020 14:16:04 +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 CDC085DA2A; Tue, 29 Sep 2020 14:16:04 +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 984BF44A62; Tue, 29 Sep 2020 14:16:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08TEFk8B015177 for ; Tue, 29 Sep 2020 10:15:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id 537571002C0E; Tue, 29 Sep 2020 14:15:46 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id B173D1002C0A for ; Tue, 29 Sep 2020 14:15:45 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601388977; 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=k92BIsUz/gXf8pckZ8u/DoxpaMyJqW6coRL7K0Qktlc=; b=SR1qJAmwExmFPfqbNS06/vBmTgFQrsoy9ibR98ArxdcmpCdChRV+OehiE3BFnRjqS7Zh7O 7PnOPhYW9qh1Y6TrbKlcXZCGxqwg2MmcVLwhmmfp9EmnVTjdnFvWYJ1BuzglTUQ/QMXZHm dQzOk3LEC277Gm6/ZgJvpYZW5yMvEBo= X-MC-Unique: 9o9OSsvSOqyrJjEq8VWeDQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/6] qemuMigrationCookieNew: Export Date: Tue, 29 Sep 2020 16:15:33 +0200 Message-Id: <1dd424afa83fb4d0e0c41cde3e90c1f7b8c9f64d.1601388825.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Allow direct use rather than going through qemuMigrationEatCookie with NULL/0 arguments. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_migration_cookie.c | 2 +- src/qemu/qemu_migration_cookie.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_coo= kie.c index a04b74f092..f5c16a8d16 100644 --- a/src/qemu/qemu_migration_cookie.c +++ b/src/qemu/qemu_migration_cookie.c @@ -275,7 +275,7 @@ qemuMigrationCookieNetworkAlloc(virQEMUDriverPtr driver= G_GNUC_UNUSED, } -static qemuMigrationCookiePtr +qemuMigrationCookiePtr qemuMigrationCookieNew(const virDomainDef *def, const char *origname) { diff --git a/src/qemu/qemu_migration_cookie.h b/src/qemu/qemu_migration_coo= kie.h index 587f4206b7..dee1e9c8b9 100644 --- a/src/qemu/qemu_migration_cookie.h +++ b/src/qemu/qemu_migration_cookie.h @@ -151,6 +151,10 @@ struct _qemuMigrationCookie { }; +qemuMigrationCookiePtr +qemuMigrationCookieNew(const virDomainDef *def, + const char *origname); + int qemuMigrationCookieFormat(qemuMigrationCookiePtr mig, virQEMUDriverPtr driver, --=20 2.26.2 From nobody Thu May 2 05:30:18 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=1601388983; cv=none; d=zohomail.com; s=zohoarc; b=in3/FWSfEflIO5Dz0AOAXpsdxIQ6+RKutx0L++KFNfEajPhle4y2IqD4ZIe23kDFstbOz+n0q66TG2hkwRHPF/lCETuPw0r2SL9ri1k0PdpnO7HjhPXzuvy4RPWC5/1Vb0kEh6XVv8dtJN+vWWbCplB1PLlUcCbfmB6xfEvHCfw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601388983; 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=1ZuVEQTiL5jlJODwC/CvurlrShjkR9an74Nw6gvbUWM=; b=RhpCet/Wjp/vRCSxxAPiSAPnBVpKu2LFoXkkQDcqGLq+f0Cq1+aqCE7ajLX+9b2s2Rw93v9JlL4AB/5HLyqtzNvp74Dk+I4mw70bxHwA7INasef3OY3YcEn+nMlo/gTCxDTNnAYWRKJWdSc4H1gD57toYy9jG6SEVVqxL6vHGnE= 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 1601388983810510.1928734179263; Tue, 29 Sep 2020 07:16:23 -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-169-tEBFerlpPfi3xdCoQP3AGw-1; Tue, 29 Sep 2020 10:16:18 -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 8DA4B80B71B; Tue, 29 Sep 2020 14:16:07 +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 6EADF7366D; Tue, 29 Sep 2020 14:16:07 +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 3AA2D1832FC5; Tue, 29 Sep 2020 14:16:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08TEFliR015191 for ; Tue, 29 Sep 2020 10:15:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id D0A841001281; Tue, 29 Sep 2020 14:15:47 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2743F1002C0D for ; Tue, 29 Sep 2020 14:15:46 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601388982; 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=1ZuVEQTiL5jlJODwC/CvurlrShjkR9an74Nw6gvbUWM=; b=XY9MZM7nbHwZHXrZ6JPxgO/FqUIYmnruuhKtrvNgoW6yrIQFC0gpD99rwltv0bbgaRd4hq ec8q9XQqYO+vRVz9akfGQE8Wb9gEN7SfPUffl1znA30XpqflIvtbHEPz1gtu/upKcoSKfc ZkTbxxL6PfiAbYVM0YULo7dRQ44GSEY= X-MC-Unique: tEBFerlpPfi3xdCoQP3AGw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 4/6] qemuMigrationSrcBeginPhase: Use qemuMigrationCookieNew Date: Tue, 29 Sep 2020 16:15:34 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" We need an empty cookie, so use qemuMigrationCookieNew instead of qemuMigrationEatCookie with NULL/0 arguments. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_migration.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 33591ba26b..7017058089 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2253,8 +2253,7 @@ qemuMigrationSrcBeginPhase(virQEMUDriverPtr driver, if (!(flags & VIR_MIGRATE_OFFLINE)) cookieFlags |=3D QEMU_MIGRATION_COOKIE_CAPS; - if (!(mig =3D qemuMigrationEatCookie(driver, vm->def, - priv->origname, priv, NULL, 0, 0))) + if (!(mig =3D qemuMigrationCookieNew(vm->def, priv->origname))) return NULL; if (qemuMigrationCookieFormat(mig, driver, vm, --=20 2.26.2 From nobody Thu May 2 05:30:18 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=1601388962; cv=none; d=zohomail.com; s=zohoarc; b=oKdDU8+qkJQzJ1qSHGXoerMGl49rjyFA9tTXD1XMNFeJP+TF0QEqfQ/KIUqFsYbDN5Gi6OnHPmFm7XifTUkvehVmeF5eBAal6kD5+DKrQ2mZgExoc3cswmpumnTotJuHtGiF6IBbJ7E9kxlEb5pmoqgrB7zGLN08+Aro49vYY3Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601388962; 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=XGWzPJfEen92ONHCr+u8kLIh0DQxsVAWxLg3wEQTbjs=; b=deeqxgrCe0jTOLun3yUSoAMOBinOB4G/GKG3MwTNjW616WDmBvRi5zsal2mluZnLD/48W9HRUTBx1B0X62kiR/5Y4ReUQUG0HxsakfDN58Ng1ZBNUKSSV2ybeZF2+ikD/0YRjWRVE882H7kgqAZ8fyFJKUMfdCm6wZxHoE6pVYw= 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 1601388962657187.63420584590995; Tue, 29 Sep 2020 07:16: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-355-pLoPZQUFNJqqbSYiF-OMtg-1; Tue, 29 Sep 2020 10:15:58 -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 ECF0819080D2; Tue, 29 Sep 2020 14:15:50 +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 CC6AC81C40; Tue, 29 Sep 2020 14:15: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 9766B44A5D; Tue, 29 Sep 2020 14:15:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08TEFmQL015203 for ; Tue, 29 Sep 2020 10:15:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id DBEC11001281; Tue, 29 Sep 2020 14:15:48 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 494401002C0C for ; Tue, 29 Sep 2020 14:15:48 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601388961; 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=XGWzPJfEen92ONHCr+u8kLIh0DQxsVAWxLg3wEQTbjs=; b=F4tKoaBA1Rc1TxhYKckqXdPlzhlE1AZ6D+2MGln4F3iImDCKPNzqUSMG5VcvFse7wbpAbt z1Gi4Bm83wUws8shwZwWDWQx18+iJbJaUhTZ9cbH+LJlexghmfhxlpfsqeHTnGwsTsZP8y i0S+ulsZBrAtkpiFzIq7Tdpr3dnguFk= X-MC-Unique: pLoPZQUFNJqqbSYiF-OMtg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 5/6] qemuMigrationCookieXMLFormatStr: Remove Date: Tue, 29 Sep 2020 16:15:35 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" There is just one caller, inline the code. This also optimizes the code as we no longer have to calculate length of the output XML as it's actually stored in the buffer struct. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_migration_cookie.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_coo= kie.c index f5c16a8d16..1596ab914b 100644 --- a/src/qemu/qemu_migration_cookie.c +++ b/src/qemu/qemu_migration_cookie.c @@ -861,20 +861,6 @@ qemuMigrationCookieXMLFormat(virQEMUDriverPtr driver, } -static char * -qemuMigrationCookieXMLFormatStr(virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps, - qemuMigrationCookiePtr mig) -{ - g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; - - if (qemuMigrationCookieXMLFormat(driver, qemuCaps, &buf, mig) < 0) - return NULL; - - return virBufferContentAndReset(&buf); -} - - static qemuMigrationCookieGraphicsPtr qemuMigrationCookieGraphicsXMLParse(xmlXPathContextPtr ctxt) { @@ -1397,6 +1383,7 @@ qemuMigrationCookieFormat(qemuMigrationCookiePtr mig, unsigned int flags) { qemuDomainObjPrivatePtr priv =3D dom->privateData; + g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; if (!cookieout || !cookieoutlen) return 0; @@ -1441,10 +1428,11 @@ qemuMigrationCookieFormat(qemuMigrationCookiePtr mi= g, qemuMigrationCookieAddCaps(mig, dom, party) < 0) return -1; - if (!(*cookieout =3D qemuMigrationCookieXMLFormatStr(driver, priv->qem= uCaps, mig))) + if (qemuMigrationCookieXMLFormat(driver, priv->qemuCaps, &buf, mig) < = 0) return -1; - *cookieoutlen =3D strlen(*cookieout) + 1; + *cookieoutlen =3D virBufferUse(&buf) + 1; + *cookieout =3D virBufferContentAndReset(&buf); VIR_DEBUG("cookielen=3D%d cookie=3D%s", *cookieoutlen, *cookieout); --=20 2.26.2 From nobody Thu May 2 05:30:18 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=1601388994; cv=none; d=zohomail.com; s=zohoarc; b=PIb/cWTiTFgxHA//Hg4zkUcDiXKPd6LpJrXEt3Wpeju/sLoa5z8rEZiDAnz/aL4HroDm8qSvipySVflapC9SxgZQrAGo/8GexisrWdsofdUwfgW5h9aqgKK8AIkUMxA6cCqb93+YNhFc0YyGyuSqyecI+TIDEDVQ6m8YAPBQaOY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601388994; 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=qPXtc/VCwJZH232+XIlhLcLPiRgSuF5xtkNw+BSUg2Q=; b=AuY4pjzAizV59TGKEBDXzxc19M1vakbX/Vs2Aez2zJGoy5CqqQucAib3LIUWIQ77wA882TUqlghQ0VRFpxgyLoPHiUtFbnuCuqIq59bDqbBTOHA7T5shUNzHcOkE99Tp9UGNTDu5uEvShhI5dGwV23POEx1o4o5Zv60WBO/g7Y8= 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 1601388994293602.8023179384769; Tue, 29 Sep 2020 07:16: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-173-Nkq4Fw5CO7-MiPqGOhCwyw-1; Tue, 29 Sep 2020 10:16:25 -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 9931110BBEDD; Tue, 29 Sep 2020 14:16:10 +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 2697E277D0; Tue, 29 Sep 2020 14:16:10 +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 D5F2F1832FC4; Tue, 29 Sep 2020 14:16:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08TEFog8015210 for ; Tue, 29 Sep 2020 10:15:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 365E31001281; Tue, 29 Sep 2020 14:15:50 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 549851002C13 for ; Tue, 29 Sep 2020 14:15:49 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601388993; 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=qPXtc/VCwJZH232+XIlhLcLPiRgSuF5xtkNw+BSUg2Q=; b=bMrHN9Cu2vt2p8qw6UzEoEoZvlxdBoaGNDcl9mDSCa8spIY1Ha9PSM3qoZvxf+iESji6GH 9patu5BbFEFcoHG3X64CbGKIFXQJdpczPvl7kCm9mt765gMPkOw5iirnZ3tfb7/Wq4BDff p+RDfHeck/3Akby690impEIG30XGlqY= X-MC-Unique: Nkq4Fw5CO7-MiPqGOhCwyw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 6/6] qemu: migration: Rename qemuMigrationEatCookie to qemuMigrationCookieParse Date: Tue, 29 Sep 2020 16:15:36 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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" Use a more descriptive name and move the verb to the end so that the functions conform with the naming policy. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_migration.c | 38 ++++++++++++++++---------------- src/qemu/qemu_migration_cookie.c | 14 ++++++------ src/qemu/qemu_migration_cookie.h | 14 ++++++------ 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 7017058089..009b556d0a 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2592,15 +2592,15 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver, /* Parse cookie earlier than adding the domain onto the * domain list. Parsing/validation may fail and there's no * point in having the domain in the list at that point. */ - if (!(mig =3D qemuMigrationEatCookie(driver, *def, origname, NULL, - cookiein, cookieinlen, - QEMU_MIGRATION_COOKIE_LOCKSTATE | - QEMU_MIGRATION_COOKIE_NBD | - QEMU_MIGRATION_COOKIE_MEMORY_HOTPLU= G | - QEMU_MIGRATION_COOKIE_CPU_HOTPLUG | - QEMU_MIGRATION_COOKIE_CPU | - QEMU_MIGRATION_COOKIE_ALLOW_REBOOT | - QEMU_MIGRATION_COOKIE_CAPS))) + if (!(mig =3D qemuMigrationCookieParse(driver, *def, origname, NULL, + cookiein, cookieinlen, + QEMU_MIGRATION_COOKIE_LOCKSTATE | + QEMU_MIGRATION_COOKIE_NBD | + QEMU_MIGRATION_COOKIE_MEMORY_HOTP= LUG | + QEMU_MIGRATION_COOKIE_CPU_HOTPLUG= | + QEMU_MIGRATION_COOKIE_CPU | + QEMU_MIGRATION_COOKIE_ALLOW_REBOO= T | + QEMU_MIGRATION_COOKIE_CAPS))) goto cleanup; if (!(vm =3D virDomainObjListAdd(driver->domains, *def, @@ -3112,9 +3112,9 @@ qemuMigrationSrcConfirmPhase(virQEMUDriverPtr driver, ? QEMU_MIGRATION_PHASE_CONFIRM3 : QEMU_MIGRATION_PHASE_CONFIRM3_CANCELLED); - if (!(mig =3D qemuMigrationEatCookie(driver, vm->def, priv->origname, = priv, - cookiein, cookieinlen, - QEMU_MIGRATION_COOKIE_STATS))) + if (!(mig =3D qemuMigrationCookieParse(driver, vm->def, priv->origname= , priv, + cookiein, cookieinlen, + QEMU_MIGRATION_COOKIE_STATS))) return -1; if (retcode =3D=3D 0) @@ -3662,11 +3662,11 @@ qemuMigrationSrcRun(virQEMUDriverPtr driver, } } - mig =3D qemuMigrationEatCookie(driver, vm->def, priv->origname, priv, - cookiein, cookieinlen, - cookieFlags | - QEMU_MIGRATION_COOKIE_GRAPHICS | - QEMU_MIGRATION_COOKIE_CAPS); + mig =3D qemuMigrationCookieParse(driver, vm->def, priv->origname, priv, + cookiein, cookieinlen, + cookieFlags | + QEMU_MIGRATION_COOKIE_GRAPHICS | + QEMU_MIGRATION_COOKIE_CAPS); if (!mig) goto error; @@ -5198,8 +5198,8 @@ qemuMigrationDstFinish(virQEMUDriverPtr driver, * even though VIR_MIGRATE_PERSIST_DEST was not used. */ cookie_flags |=3D QEMU_MIGRATION_COOKIE_PERSISTENT; - if (!(mig =3D qemuMigrationEatCookie(driver, vm->def, priv->origname, = priv, - cookiein, cookieinlen, cookie_flags= ))) + if (!(mig =3D qemuMigrationCookieParse(driver, vm->def, priv->origname= , priv, + cookiein, cookieinlen, cookie_fla= gs))) goto endjob; if (flags & VIR_MIGRATE_OFFLINE) { diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_coo= kie.c index 1596ab914b..c128f541dd 100644 --- a/src/qemu/qemu_migration_cookie.c +++ b/src/qemu/qemu_migration_cookie.c @@ -1441,13 +1441,13 @@ qemuMigrationCookieFormat(qemuMigrationCookiePtr mi= g, qemuMigrationCookiePtr -qemuMigrationEatCookie(virQEMUDriverPtr driver, - const virDomainDef *def, - const char *origname, - qemuDomainObjPrivatePtr priv, - const char *cookiein, - int cookieinlen, - unsigned int flags) +qemuMigrationCookieParse(virQEMUDriverPtr driver, + const virDomainDef *def, + const char *origname, + qemuDomainObjPrivatePtr priv, + const char *cookiein, + int cookieinlen, + unsigned int flags) { g_autoptr(qemuMigrationCookie) mig =3D NULL; diff --git a/src/qemu/qemu_migration_cookie.h b/src/qemu/qemu_migration_coo= kie.h index dee1e9c8b9..f2801b2704 100644 --- a/src/qemu/qemu_migration_cookie.h +++ b/src/qemu/qemu_migration_cookie.h @@ -165,13 +165,13 @@ qemuMigrationCookieFormat(qemuMigrationCookiePtr mig, unsigned int flags); qemuMigrationCookiePtr -qemuMigrationEatCookie(virQEMUDriverPtr driver, - const virDomainDef *def, - const char *origname, - qemuDomainObjPrivatePtr priv, - const char *cookiein, - int cookieinlen, - unsigned int flags); +qemuMigrationCookieParse(virQEMUDriverPtr driver, + const virDomainDef *def, + const char *origname, + qemuDomainObjPrivatePtr priv, + const char *cookiein, + int cookieinlen, + unsigned int flags); void qemuMigrationCookieFree(qemuMigrationCookiePtr mig); --=20 2.26.2