From nobody Thu Jul 10 04:26:03 2025 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1653391584; cv=none; d=zohomail.com; s=zohoarc; b=ROG+PAoQhtrF+hPQE5vvWs2jqZ6VlpSPx2pDND3/9xk2LnSVfmma25s6JAGaHsh9w1GWNHevDbHqFqdaq9y+jD3LjxkthW1ycObccIE6sd2WbuFR15+2907QUIeouXIxmHlRVF54JtxZJwCSSa336dXNEjluCt7i1Vzh7vTeldU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653391584; h=Content-Type:Content-Transfer-Encoding:Cc: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=t92MZvuFr2lO0iUw/Ivw7ms1vtMxSzOcJvYJhDe6WPQ=; b=E0BPNHJ+iOwDdBDMBpajhNJbiGEUCWxy2F4UgY70NISBTvl7yFd3YEQSwI0KSq5tEw6gXzWdrFUfE4tVPGH4YRyA6YANjLNgW+FdByxdXnipjcjhbeMvxaTpDIMhmtMKs+ioUmHBTehLuR8nDPALtQLsmMkCMUdackIGhU7/ySQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1653391584118554.9065521408035; Tue, 24 May 2022 04:26:24 -0700 (PDT) Received: from localhost ([::1]:55864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntSgB-0005n2-38 for importer2@patchew.org; Tue, 24 May 2022 07:26:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60726) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntSJR-0005lv-9C for qemu-devel@nongnu.org; Tue, 24 May 2022 07:02:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:46262) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntSJL-0003Mw-Ji for qemu-devel@nongnu.org; Tue, 24 May 2022 07:02:52 -0400 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-128-6XfevyJAPqiqR3vtat6e_g-1; Tue, 24 May 2022 07:02:42 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 85B25858EED; Tue, 24 May 2022 11:02:42 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.159]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7FFBE1121315; Tue, 24 May 2022 11:02:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653390164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t92MZvuFr2lO0iUw/Ivw7ms1vtMxSzOcJvYJhDe6WPQ=; b=QnIv6oJggB7LnCeWu9YwjeOpGjcgkO/w3pA/vNbOPMh/xlhA+nfPJnLXRjJSPgT2x8h0mL VvAFlT8RZoBI7/Gh2Jm25NFw63ENlpscYQ4atyGmVSeW2rpOZzRqsy30qzmSFOLGeq+aGF oHwI0XqhsogqF9pHn7DcnwR65XeRTXM= X-MC-Unique: 6XfevyJAPqiqR3vtat6e_g-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , "Dr. David Alan Gilbert" , qemu-block@nongnu.org, Stefan Hajnoczi , Hailiang Zhang , Juan Quintela , Fam Zheng Subject: [PATCH 02/20] migration: switch to use QIOChannelNull for dummy channel Date: Tue, 24 May 2022 12:02:17 +0100 Message-Id: <20220524110235.145079-3-berrange@redhat.com> In-Reply-To: <20220524110235.145079-1-berrange@redhat.com> References: <20220524110235.145079-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1653391585908100001 This removes one further custom impl of QEMUFile, in favour of a QIOChannel based impl. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Eric Blake --- migration/ram.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 5f5e37f64d..89082716d6 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -32,11 +32,13 @@ #include "qemu/bitmap.h" #include "qemu/madvise.h" #include "qemu/main-loop.h" +#include "io/channel-null.h" #include "xbzrle.h" #include "ram.h" #include "migration.h" #include "migration/register.h" #include "migration/misc.h" +#include "migration/qemu-file-channel.h" #include "qemu-file.h" #include "postcopy-ram.h" #include "page_cache.h" @@ -457,8 +459,6 @@ static QemuThread *compress_threads; */ static QemuMutex comp_done_lock; static QemuCond comp_done_cond; -/* The empty QEMUFileOps will be used by file in CompressParam */ -static const QEMUFileOps empty_ops =3D { }; =20 static QEMUFile *decomp_file; static DecompressParam *decomp_param; @@ -569,7 +569,8 @@ static int compress_threads_save_setup(void) /* comp_param[i].file is just used as a dummy buffer to save data, * set its ops to empty. */ - comp_param[i].file =3D qemu_fopen_ops(NULL, &empty_ops, false); + comp_param[i].file =3D qemu_fopen_channel_output( + QIO_CHANNEL(qio_channel_null_new())); comp_param[i].done =3D true; comp_param[i].quit =3D false; qemu_mutex_init(&comp_param[i].mutex); --=20 2.36.1