Received: from eggs.gnu.org ([208.118.235.92]:43687) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UV155-0001XW-Mf for qemu-devel@nongnu.org; Wed, 24 Apr 2013 10:54:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UV151-0005B1-0c for qemu-devel@nongnu.org; Wed, 24 Apr 2013 10:53:59 -0400 Received: from mail-ea0-x232.google.com ([2a00:1450:4013:c01::232]:55472) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UV150-0005Ar-Pr for qemu-devel@nongnu.org; Wed, 24 Apr 2013 10:53:54 -0400 Received: by mail-ea0-f178.google.com with SMTP id o10so812177eaj.9 for ; Wed, 24 Apr 2013 07:53:53 -0700 (PDT) Date: Wed, 24 Apr 2013 16:53:50 +0200 From: Stefan Hajnoczi Message-ID: <20130424145350.GG24635@stefanha-thinkpad.redhat.com> References: <1366796802-6205-1-git-send-email-namei.unix@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1366796802-6205-1-git-send-email-namei.unix@gmail.com> Subject: Re: [Qemu-devel] [PATCH] sheepdog: fix loadvm operation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liu Yuan Cc: Kevin Wolf , MORITA Kazutaka , sheepdog@lists.wpkg.org, qemu-devel@nongnu.org, Stefan Hajnoczi On Wed, Apr 24, 2013 at 05:46:41PM +0800, Liu Yuan wrote: > +/* Delete current working VDI by the name */ > +static int sd_delete(BDRVSheepdogState *s, char *name) > +{ > + unsigned int wlen = SD_MAX_VDI_LEN; > + SheepdogVdiReq hdr = { > + .opcode = SD_OP_DEL_VDI, > + .vdi_id = s->inode.vdi_id, > + .data_length = wlen, > + .flags = SD_FLAG_CMD_WRITE, > + }; > + SheepdogVdiRsp *rsp = (SheepdogVdiRsp *)&hdr; > + int fd, ret; > + > + fd = connect_to_sdog(s); > + if (fd < 0) { > + return fd; > + } > + > + ret = send_co_req(fd, (SheepdogReq *)&hdr, name, &wlen); This is a coroutine function, it may yield. It seems sd_delete() and sd_snapshot_goto() are not coroutine functions, so this call is not allowed. You'll see a crash if the socket I/O returns EAGAIN. Then qemu_coroutine_yield() will abort.