RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 880097 - qemu-kvm fail to re-used the configuration of virtual devices saved with writeconfig
Summary: qemu-kvm fail to re-used the configuration of virtual devices saved with writ...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Virtualization Maintenance
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-26 09:13 UTC by Sibiao Luo
Modified: 2012-11-27 02:25 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-11-26 10:26:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
dumps the virtual machine devices configuration to dump.cfg file via 'writeconfig'. (1.15 KB, application/octet-stream)
2012-11-26 09:17 UTC, Sibiao Luo
no flags Details

Description Sibiao Luo 2012-11-26 09:13:34 UTC
Description of problem:
Dumps the current virtual machine devices configuration to a text file via writeconfig, but the qemu-kvm fail to read it from a file which was previously either saved with 'writeconfig'. 
btw, if i add '-net none' to the 'readconfig' command line, it can boot up successfully.

Version-Release number of selected component (if applicable):
host info:
# uname -r && rpm -q qemu-kvm
2.6.32-344.el6.x86_64
qemu-kvm-0.12.1.2-2.337.el6.x86_64
guest info:
windows_2012_x64

How reproducible:
100%

Steps to Reproduce:
1.Dumps the current virtual machine devices configuration to a text file via writeconfig.
# /usr/libexec/qemu-kvm -M rhel6.4.0 -cpu Opteron_G2 -enable-kvm -m 2048 -smp 2,sockets=2,cores=1,threads=1 -usb -device usb-tablet,id=input0 -name sluo_operation -uuid 4829519d-1ac7-4cbd-babb-0267f47d2087 -rtc base=localtime,clock=host,driftfix=slew -drive file=/home/windows_2012_sluo_x64.raw,if=none,id=drive-virtio-disk0,format=raw,cache=none,werror=stop,rerror=stop -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=2C:41:38:B6:40:11,bus=pci.0,addr=0x4 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 -drive file=/home/my-data-disk.raw,if=none,id=data-disk,format=raw,cache=none,werror=stop,rerror=stop -device virtio-blk-pci,bus=pci.0,addr=0x6,drive=data-disk,id=sluo-disk -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -vnc :1 -boot menu=on -writeconfig /home/dump.cfg
2.read the configuration dump of virtual devices.
# /usr/libexec/qemu-kvm -M rhel6.4.0 -cpu Opteron_G2 -enable-kvm -m 2048 -smp 2,sockets=2,cores=1,threads=1 -usb -name sluo_operation -uuid 4829519d-1ac7-4cbd-babb-0267f47d2087 -vnc :1 -boot menu=on -readconfig /home/dump.cfg
  
Actual results:
after step 1, it can dump the virtual devices successfully, i will attach the dump file later.
Note: I did not see any about the [cpudef] in the dump file in the rhel6.4, but i remember that the rhel6.3GA can do it successfully, please help me check it.
after step 2, it will fail to boot up and prompt as following,
qemu-kvm:/home/dump.txt:22: PCI: devfn 24 not available for virtio-blk-pci, in use by rtl8139
qemu-kvm:/home/dump.txt:22: Device 'virtio-blk-pci' could not be initialized

Expected results:
qemu can read the virtual devices configuration saved with 'writeconfig' instead of entering the devices configuration options on the command line each time you want to run a virtual machine.

Additional info:

Comment 1 Sibiao Luo 2012-11-26 09:17:12 UTC
Created attachment 651824 [details]
dumps the virtual machine devices configuration to dump.cfg file via 'writeconfig'.

Comment 5 Michael S. Tsirkin 2012-11-26 10:26:21 UTC
help text is explicit:
-net none       use it alone to have zero network devices. If no -net option
                is provided, the default is '-net nic -net user'

so without -net none you have requested the default nic (rtl8139)
which conflicts with the configuration you are trying to read in.

Comment 6 Sibiao Luo 2012-11-27 01:41:57 UTC
(In reply to comment #5)
> help text is explicit:
> -net none       use it alone to have zero network devices. If no -net option
>                 is provided, the default is '-net nic -net user'
> 
> so without -net none you have requested the default nic (rtl8139)
> which conflicts with the configuration you are trying to read in.

ok, thanks for your checking. mst, how about the [cpudef] in the dump file ? I did not see any about the [cpudef] in the dump file in the rhel6.4, but i remember that the rhel6.3GA can do it successfully, please help me check it.

Comment 7 Sibiao Luo 2012-11-27 01:51:08 UTC
(In reply to comment #5)
> help text is explicit:
> -net none       use it alone to have zero network devices. If no -net option
>                 is provided, the default is '-net nic -net user'
> 
> so without -net none you have requested the default nic (rtl8139)
> which conflicts with the configuration you are trying to read in.

btw, why it fail to prompt that relate to the 'PCI: devfn 24 not available for virtio-blk-pci' and ''virtio-blk-pci' could not be initialized'? doest the prompt have no any problem ? 

qemu-kvm:/home/dump.txt:22: PCI: devfn 24 not available for virtio-blk-pci, in use by rtl8139
qemu-kvm:/home/dump.txt:22: Device 'virtio-blk-pci' could not be initialized

Comment 8 Sibiao Luo 2012-11-27 02:25:07 UTC
(In reply to comment #7)
> btw, why it fail to prompt that relate to the 'PCI: devfn 24 not available
> for virtio-blk-pci' and ''virtio-blk-pci' could not be initialized'? doest
> the prompt have no any problem ? 
> 
> qemu-kvm:/home/dump.txt:22: PCI: devfn 24 not available for virtio-blk-pci,
> in use by rtl8139
> qemu-kvm:/home/dump.txt:22: Device 'virtio-blk-pci' could not be initialized

hmm...the rtl8139 was added by default to the addr = 0x3, so it was conflicts with the 'virtio-blk-pci' which i assigned the addr=0x3. 

I have tried two scenarios:
- boot a guest without network device and assign the addr for each pci device(system addr=0x3, balloon addr=0x4, data disk addr=0x5), it fail to boot.

# /usr/libexec/qemu-kvm -M rhel6.3.0 -enable-kvm -m 4096 -smp 4,sockets=2,cores=2,threads=1 -usb -device usb-tablet,id=input0 -name image_streaming -uuid 990ea161-6b67-47b2-b803-19fb01d30d30 -rtc base=localtime,clock=host,driftfix=slew -drive file=/mnt/windows_7_ultimate_sp1_x64.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -spice port=5931,disable-ticketing -vga qxl -global qxl-vga.vram_size=67108864 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 -drive file=/mnt/small-data-disk.qcow2,if=none,id=data-disk,format=qcow2,cache=none,werror=stop,rerror=stop -device virtio-blk-pci,bus=pci.0,addr=0x5,drive=data-disk,id=sluo-disk -monitor stdio 
do_spice_init: starting 0.10.1
spice_server_add_interface: SPICE_INTERFACE_MIGRATION
spice_server_add_interface: SPICE_INTERFACE_KEYBOARD
spice_server_add_interface: SPICE_INTERFACE_MOUSE
spice_server_add_interface: SPICE_INTERFACE_QXL
red_worker_main: begin
display_channel_create: create display channel
cursor_channel_create: create cursor channel
qemu-kvm: -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1: PCI: devfn 24 not available for virtio-blk-pci, in use by rtl8139
qemu-kvm: -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1: Device 'virtio-blk-pci' could not be initialized

- boot a guest without network device and assign the addr for each pci device(system addr=0x4, balloon addr=0x5, data disk addr=0x6), it can boot successfully, and check that the rtl8139 was added to the addr=0x3.

# /usr/libexec/qemu-kvm -M rhel6.3.0 -enable-kvm -m 4096 -smp 4,sockets=2,cores=2,threads=1 -usb -device usb-tablet,id=input0 -name image_streaming -uuid 990ea161-6b67-47b2-b803-19fb01d30d30 -rtc base=localtime,clock=host,driftfix=slew -drive file=/mnt/windows_7_ultimate_sp1_x64.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -spice port=5931,disable-ticketing -vga qxl -global qxl-vga.vram_size=67108864 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 -drive file=/mnt/small-data-disk.qcow2,if=none,id=data-disk,format=qcow2,cache=none,werror=stop,rerror=stop -device virtio-blk-pci,bus=pci.0,addr=0x6,drive=data-disk,id=sluo-disk -monitor stdio


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