From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Xu Subject: Re: [PATCH v2 04/10] migration: detect compression and decompression errors Date: Wed, 28 Mar 2018 17:59:52 +0800 Message-ID: <20180328095952.GG29554@xz-mi> References: <20180327091043.30220-1-xiaoguangrong@tencent.com> <20180327091043.30220-5-xiaoguangrong@tencent.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: kvm@vger.kernel.org, mst@redhat.com, mtosatti@redhat.com, Xiao Guangrong , dgilbert@redhat.com, qemu-devel@nongnu.org, wei.w.wang@intel.com, jiang.biao2@zte.com.cn, pbonzini@redhat.com To: guangrong.xiao@gmail.com Return-path: Content-Disposition: inline In-Reply-To: <20180327091043.30220-5-xiaoguangrong@tencent.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel2=m.gmane.org@nongnu.org Sender: "Qemu-devel" List-Id: kvm.vger.kernel.org On Tue, Mar 27, 2018 at 05:10:37PM +0800, guangrong.xiao@gmail.com wrote: [...] > -static int compress_threads_load_setup(void) > +static int compress_threads_load_setup(QEMUFile *f) > { > int i, thread_count; > > @@ -2665,6 +2685,7 @@ static int compress_threads_load_setup(void) > } > decomp_param[i].stream.opaque = &decomp_param[i]; > > + decomp_param[i].file = f; On the source side the error will be set via: qemu_file_set_error(migrate_get_current()->to_dst_file, blen); Maybe we can do similar things using migrate_incoming_get_current() to avoid caching the QEMUFile multiple times? I think both are not good since qemu_file_set_error() can be called by multiple threads, but it's only setting a fault value so maybe it's fine. Other than that it looks good to me. Thanks, -- Peter Xu