From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 20/27] tools/libxl: Infrastructure for writing a v2 stream Date: Fri, 10 Jul 2015 12:03:55 +0100 Message-ID: <559FA69B.6070808@citrix.com> References: <1434375880-30914-1-git-send-email-andrew.cooper3@citrix.com> <1434375880-30914-21-git-send-email-andrew.cooper3@citrix.com> <1436525710.23508.242.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1436525710.23508.242.camel@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: Ian Campbell Cc: Ross Lagerwall , Wei Liu , Yang Hongyang , Ian Jackson , Xen-devel List-Id: xen-devel@lists.xenproject.org On 10/07/15 11:55, Ian Campbell wrote: > 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. You realise you have moved back onto v1 of the series? This is very different in v2. ~Andrew