[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] sheepdog: fix loadvm operation
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH] sheepdog: fix loadvm operation |
Date: |
Wed, 24 Apr 2013 16:53:50 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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.