Re: [Qemu-devel] [Bug 1505652] [NEW] An IO error happen when qemu snapshot-create

2015-10-26 Thread Stefan Hajnoczi
On Tue, Oct 13, 2015 at 11:52:26AM -, jiangchi68 wrote:
> My qemu version is 1.7.1,but when I try to make live snapshot by
> libvirt,the libvirt sometimes report an error
> :qemuMonitorJSONCheckError:377 : internal error: unable to execute QEMU
> command 'transaction': An IO error has occurred.
> 
> Here is the command being snpshot create by virsh:
> virsh  snapshot-create snapshot-test.vm   snapshot.xml  --no-metadata  
> --disk-only --reuse-external
> the snapshot.xml:
> 
>   test
>   
> 
>   
> 
>   
> 

Please send your question to libvirt-l...@redhat.com.

It could be related to /home/disk file permissions.



[Qemu-devel] [Bug 1505652] [NEW] An IO error happen when qemu snapshot-create

2015-10-13 Thread jiangchi68
Public bug reported:

My qemu version is 1.7.1,but when I try to make live snapshot by
libvirt,the libvirt sometimes report an error
:qemuMonitorJSONCheckError:377 : internal error: unable to execute QEMU
command 'transaction': An IO error has occurred.

Here is the command being snpshot create by virsh:
virsh  snapshot-create snapshot-test.vm   snapshot.xml  --no-metadata  
--disk-only --reuse-external
the snapshot.xml:

  test
  

  

  



I have read the qemu code about the snapshot create, and I find the qemu when 
call the function handle_aiocb_rw_linear():
static ssize_t handle_aiocb_rw_linear(RawPosixAIOData *aiocb, char *buf)
{
ssize_t offset = 0;
ssize_t len;

while (offset < aiocb->aio_nbytes) {
if (aiocb->aio_type & QEMU_AIO_WRITE) {
len = pwrite(aiocb->aio_fildes,
 (const char *)buf + offset,
 aiocb->aio_nbytes - offset,
 aiocb->aio_offset + offset);
} else {
len = pread(aiocb->aio_fildes,
buf + offset,
aiocb->aio_nbytes - offset,
aiocb->aio_offset + offset);
}
if (len == -1 && errno == EINTR) {
continue;
} else if (len == -1) {
offset = -errno;
break;
} else if (len == 0) {
break;
}
offset += len;
}

return offset;
}

The function pwrite happen error,the errono is 1,and the  error 
describe:"pwrite  failed, Operation not permitted (1, EPERM) because the 
process does not have the appropriate privileges to use the pwrite system call".
The qemu call stack about is:
external_snapshot_prepare()->bdrv_flush()->...->paio_submit->...->handle_aiocb_rw_linear.

** Affects: qemu
 Importance: Undecided
 Status: New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1505652

Title:
  An IO error happen when qemu  snapshot-create

Status in QEMU:
  New

Bug description:
  My qemu version is 1.7.1,but when I try to make live snapshot by
  libvirt,the libvirt sometimes report an error
  :qemuMonitorJSONCheckError:377 : internal error: unable to execute
  QEMU command 'transaction': An IO error has occurred.

  Here is the command being snpshot create by virsh:
  virsh  snapshot-create snapshot-test.vm   snapshot.xml  --no-metadata  
--disk-only --reuse-external
  the snapshot.xml:
  
test

  

  

  

  
  I have read the qemu code about the snapshot create, and I find the qemu when 
call the function handle_aiocb_rw_linear():
  static ssize_t handle_aiocb_rw_linear(RawPosixAIOData *aiocb, char *buf)
  {
  ssize_t offset = 0;
  ssize_t len;

  while (offset < aiocb->aio_nbytes) {
  if (aiocb->aio_type & QEMU_AIO_WRITE) {
  len = pwrite(aiocb->aio_fildes,
   (const char *)buf + offset,
   aiocb->aio_nbytes - offset,
   aiocb->aio_offset + offset);
  } else {
  len = pread(aiocb->aio_fildes,
  buf + offset,
  aiocb->aio_nbytes - offset,
  aiocb->aio_offset + offset);
  }
  if (len == -1 && errno == EINTR) {
  continue;
  } else if (len == -1) {
  offset = -errno;
  break;
  } else if (len == 0) {
  break;
  }
  offset += len;
  }

  return offset;
  }

  The function pwrite happen error,the errono is 1,and the  error 
describe:"pwrite  failed, Operation not permitted (1, EPERM) because the 
process does not have the appropriate privileges to use the pwrite system call".
  The qemu call stack about is:
  
external_snapshot_prepare()->bdrv_flush()->...->paio_submit->...->handle_aiocb_rw_linear.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1505652/+subscriptions