Bug 1271452 - An IO error happens when qemu create snapshot
An IO error happens when qemu create snapshot
Status: CLOSED CANTFIX
Product: Fedora
Classification: Fedora
Component: qemu (Show other bugs)
rawhide
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Fedora Virtualization Maintainers
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-13 22:55 EDT by jiangchi68
Modified: 2015-10-16 04:46 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-10-15 16:09:46 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description jiangchi68 2015-10-13 22:55:29 EDT
Description of problem:
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.

Version-Release number of selected component (if applicable):
qemu 1.7.1

How reproducible:
sometimes

Steps to Reproduce:
1.virsh start snapshot-test.vm
2.create snapshot.xml file:
<domainsnapshot>
  <description>test</description>
  <disks>
    <disk name='vda' snapshot="external">
      <source dev='/home/disk/sbd8' file='/home/disk/sdb8' type="block"/>
    </disk>
  </disks>
</domainsnapshot>
3.virsh snapshot-create snapshot-test.vm snapshot.xml --no-metadata --disk-only --reuse-external

Additional info:
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.
Comment 1 Cole Robinson 2015-10-14 08:53:00 EDT
(In reply to jiangchi68 from comment #0)
> Description of problem:
> 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.
> 
> Version-Release number of selected component (if applicable):
> qemu 1.7.1
> 

Is this really your qemu version? because that's very old. What's

rpm -q qemu-system-x86 libvirt-daemon
Comment 2 jiangchi68 2015-10-14 22:21:18 EDT
(In reply to Cole Robinson from comment #1)
> (In reply to jiangchi68 from comment #0)
> > Description of problem:
> > 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.
> > 
> > Version-Release number of selected component (if applicable):
> > qemu 1.7.1
> > 
> 
> Is this really your qemu version? because that's very old. What's
> 
> rpm -q qemu-system-x86 libvirt-daemon

I sure my qemu version is 1.7.1 and libvirtd version is 1.2.9. I do not know why happen   "pwrite failed, Operation not permitted (1, EPERM)".
Comment 3 Cole Robinson 2015-10-15 16:09:46 EDT
Every currently supported version of fedora has a much newer qemu that 1.7.0. So please update to a new fedora version, and if you can still reproduce, file a new bug.
Comment 4 jiangchi68 2015-10-16 04:46:31 EDT
My system is fedroa 17,and I compile a qemu 2.4.0.But,the error still happens.

Note You need to log in before you can comment on or make changes to this bug.