From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH 20/27] tools/libxl: Infrastructure for writing a v2 stream Date: Fri, 10 Jul 2015 11:55:10 +0100 Message-ID: <1436525710.23508.242.camel@citrix.com> References: <1434375880-30914-1-git-send-email-andrew.cooper3@citrix.com> <1434375880-30914-21-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1434375880-30914-21-git-send-email-andrew.cooper3@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Ross Lagerwall , Wei Liu , Yang Hongyang , Ian Jackson , Xen-devel List-Id: xen-devel@lists.xenproject.org On Mon, 2015-06-15 at 14:44 +0100, Andrew Cooper wrote: > +void libxl__stream_write_start(libxl__egc *egc, > + libxl__stream_write_state *stream) > +{ > + libxl__datacopier_state *dc = &stream->dc; > + STATE_AO_GC(stream->ao); > + struct libxl_sr_hdr hdr = { 0 }; > + int ret = 0; > + > + assert(!stream->running); This has the same issue wrt who initialises this when as the restore side. > + stream->running = true; > + > + memset(dc, 0, sizeof(*dc)); > + dc->readwhat = ""; > + dc->copywhat = "suspend header"; > + dc->writewhat = "save/migration stream"; > + dc->ao = ao; > + dc->readfd = -1; > + dc->writefd = stream->fd; > + dc->maxsz = INT_MAX; > + dc->bytes_to_read = INT_MAX; > + dc->callback = stream_header_done; On the read side some of this was nicely encapsulated in a helper. Not a blocker, just an observation for a potential future tidying. So, the only immediate issue is the ->running one, which I suppose will be discussed on the restore side patch and the same conclusion applied here. Ian.