From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37216) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVIfq-0002Oi-S5 for qemu-devel@nongnu.org; Thu, 25 Apr 2013 05:41:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVIfm-0007gk-95 for qemu-devel@nongnu.org; Thu, 25 Apr 2013 05:41:06 -0400 Received: from mail-da0-x232.google.com ([2607:f8b0:400e:c00::232]:55358) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVIfm-0007ga-16 for qemu-devel@nongnu.org; Thu, 25 Apr 2013 05:41:02 -0400 Received: by mail-da0-f50.google.com with SMTP id a4so1333216dad.9 for ; Thu, 25 Apr 2013 02:41:00 -0700 (PDT) Date: Thu, 25 Apr 2013 18:40:55 +0900 Message-ID: From: MORITA Kazutaka In-Reply-To: <1366879354-5120-1-git-send-email-namei.unix@gmail.com> References: <1366822079-6582-1-git-send-email-namei.unix@gmail.com> <1366879354-5120-1-git-send-email-namei.unix@gmail.com> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Subject: Re: [Qemu-devel] [sheepdog] [PATCH v3] sheepdog: fix loadvm operation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liu Yuan Cc: Kevin Wolf , sheepdog@lists.wpkg.org, qemu-devel@nongnu.org, Stefan Hajnoczi At Thu, 25 Apr 2013 16:42:34 +0800, Liu Yuan wrote: > > +/* Delete current working VDI on the snapshot chain */ > +static bool sd_delete(BDRVSheepdogState *s) > +{ > + unsigned int wlen = SD_MAX_VDI_LEN, rlen = 0; > + 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 false; > + } > + > + ret = do_req(fd, (SheepdogReq *)&hdr, s->name, &wlen, &rlen); > + closesocket(fd); > + if (ret || (rsp->result != SD_RES_SUCCESS && > + rsp->result != SD_RES_NO_VDI)) { > + error_report("%s, %s", sd_strerror(rsp->result), s->name); > + return false; > + } > + > + return true; > +} Isn't it better to show an error message when the result code is SD_RES_NO_VDI? Thanks, Kazutaka