Bug 1180956

Summary: emulated pflash is writable but does not support snapshot
Product: Red Hat Enterprise Linux 7 Reporter: Xiaoqing Wei <xwei>
Component: qemu-kvmAssignee: Laszlo Ersek <lersek>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: unspecified    
Version: 7.1CC: drjones, juzhang, rbalakri, virt-bugs, virt-maint
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1180955 Environment:
Last Closed: 2015-01-27 12:29:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1180955    
Bug Blocks:    

Description Xiaoqing Wei 2015-01-12 03:22:34 UTC
Since qemu-kvm on rhel also supports pflash emulation, cloning bz

version: qemu-kvm-1.5.3-84.el7


+++ This bug was initially created as a clone of Bug #1180955 +++

Description of problem:

emulated pflash is writable but does not support snapshot

Version-Release number of selected component (if applicable):
qemu-kvm-rhev-2.1.2-18.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. boot a VM with emulated writable pflash, any OVMF guest will do

/bin/qemu-kvm -monitor stdio \
    -S  -sandbox on  \
    -name 'virt-tests-vm1'  \
    -sandbox off  \
    -M pc  \
    -nodefaults  \
    -vga std  \
    -chardev socket,id=qmp_id_qmpmonitor1,path=/tmp/monitor-qmpmonitor1-20150106-160534-yVzEUp2K,server,nowait \
    -mon chardev=qmp_id_qmpmonitor1,mode=control  \
    -chardev socket,id=serial_id_serial0,path=/tmp/serial-serial0-20150106-160534-yVzEUp2K,server,nowait \
    -device isa-serial,chardev=serial_id_serial0  \
    -chardev socket,id=seabioslog_id_20150106-160534-yVzEUp2K,path=/tmp/seabios-20150106-160534-yVzEUp2K,server,nowait \
    -device isa-debugcon,chardev=seabioslog_id_20150106-160534-yVzEUp2K,iobase=0x402 \
    -device ich9-usb-uhci1,id=usb1,bus=pci.0,addr=03 \
    -drive id=drive_image1,if=none,cache=none,snapshot=off,aio=native,file='/home/kvm_autotest_root/images/win2012-64r2-virtio.qcow2' \
    -device virtio-blk-pci,id=image1,drive=drive_image1,bootindex=0,bus=pci.0,addr=04 \
    -device e1000,mac=9a:1b:1c:1d:1e:1f,id=id7wa53p,netdev=idQ2cvBM,bus=pci.0,addr=05  \
    -netdev tap,id=idQ2cvBM,vhost=on  \
    -m 4096  \
    -smp 4,maxcpus=4,cores=2,threads=1,sockets=2  \
    -cpu 'SandyBridge',+kvm_pv_unhalt,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time \
    -drive id=drive_cd1,if=none,snapshot=off,aio=native,media=cdrom,file='/home/kvm_autotest_root/iso/ISO/Win2012R2/en_windows_server_2012_r2_x64_dvd_2707946.iso' \
    -device ide-cd,id=cd1,drive=drive_cd1,bootindex=1,bus=ide.0,unit=0 \
    -drive id=drive_winutils,if=none,snapshot=off,aio=native,media=cdrom,file='/home/kvm_autotest_root/iso/windows/winutils.iso' \
    -device ide-cd,id=winutils,drive=drive_winutils,bootindex=2,bus=ide.0,unit=1 \
    -drive id=drive_unattended,if=none,snapshot=off,aio=native,media=cdrom,file='/root/uefi.iso' \
    -device ide-cd,id=unattended,drive=drive_unattended,bootindex=3,bus=ide.1,unit=0 \
    -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1  \
    -rtc base=utc,clock=host,driftfix=slew  \
    -vnc :0  \
    -boot order=cdn,once=d,menu=off,strict=off  \
    -drive file='/usr/share/OVMF/OVMF_CODE.fd',if=pflash,format=raw,unit=0,readonly=on \
    -drive file='/home/kvm_autotest_root/images/win2012-64r2-virtio.qcow2.fd',if=pflash,format=raw,unit=1 \
    -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x1a \
    -global PIIX4_PM.disable_s4=0  -global PIIX4_PM.disable_s3=0  \
    -enable-kvm

2. (qemu) cont
(qemu) ? savevm 
savevm [tag|id] -- save a VM snapshot. If no tag or id are provided, a new snapshot is created
(qemu) savevm 11-09
Device 'pflash1' is writable but does not support snapshots.
(qemu) info block
drive_image1: /home/kvm_autotest_root/images/win2012-64r2-virtio.qcow2 (qcow2)

drive_cd1: /home/kvm_autotest_root/iso/ISO/Win2012R2/en_windows_server_2012_r2_x64_dvd_2707946.iso (raw, read-only)
    Removable device: not locked, tray closed

drive_winutils: /home/kvm_autotest_root/iso/windows/winutils.iso (raw, read-only)
    Removable device: not locked, tray closed

drive_unattended: /root/uefi.iso (raw, read-only)
    Removable device: not locked, tray closed

pflash0: /usr/share/OVMF/OVMF_CODE.fd (raw, read-only)

pflash1: /home/kvm_autotest_root/images/win2012-64r2-virtio.qcow2.fd (raw)
(qemu) info snapshots 
There is no snapshot available.

3.

Actual results:
emulated pflash is writable but does not support snapshot

Expected results:
guest could do savevm with emulated pflash.
or if this is intend not to support, we should have it documented.
Additional info:

Comment 2 Laszlo Ersek 2015-01-12 11:18:23 UTC
do_savevm() in [savevm.c] is right to reject snapshotting requests for any raw-formatted drive. The solution is to format the varstore pflash as qcow2, which is primarily a libvirt question, and secondarily an OVMF / AAVMF spec file question.

Please see my analysis in the clone origin bug, bug 1180955 comment 2.

Comment 3 Laszlo Ersek 2015-01-13 21:25:48 UTC
Bug 1180955 comment 7 explains why we can't have nice things.

Comment 4 Laszlo Ersek 2015-01-27 12:29:58 UTC
Closing again... see bug 1180955 comment 11.

Comment 5 Laszlo Ersek 2015-01-27 12:42:21 UTC

*** This bug has been marked as a duplicate of bug 1180955 ***