Bug 831708
Summary: | Spice-Server, VM Creation works when a bad value is entered for streaming-video | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Vimal Patel <vipatel> |
Component: | qemu-kvm | Assignee: | Uri Lublin <uril> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | low | Docs Contact: | |
Priority: | low | ||
Version: | 6.3 | CC: | acathrow, bsarathy, cfergeau, chayang, dblechte, dyasny, juzhang, mkenneth, virt-maint |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | qemu-kvm-0.12.1.2-2.320.el6 | Doc Type: | Bug Fix |
Doc Text: |
Before Fix:
When a bad value was given for qemu-kvm command line "-spice" option "streaming-video", it was ignored. The default value was used and the VM was running.
After Fix:
When a bad value is given for qemu-kvm command line "-spice" option "streaming-video", an error message is shown and the program exits.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2013-02-21 07:37:09 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: |
Description
Vimal Patel
2012-06-13 15:51:58 UTC
When using libvirt to start VMs, this problem would not happen. Currently, when a bad param is given to the -spice streaming-video option, it is ignored and the default ("filter") value is used. Looking at the code, I found that spice_server_set_streaming_video() (spice-server) does returns -1 on bad param. The calling function qemu_spice_init (qemu-kvm) does not check the return value. I'm not sure if using the default value on bad param done on purpose or not. If we want to fix this bug, the return value should be looked at, and if it's -1 (or <0) exit the program From our testing, We found that an invalid value entered from streaming-video is the only spice value that lets the VM be launched instead of returning an error. For the other cases (image compression, wan compression, playback compression, bad port value), the VM does not get launched and returns an error. Took me a while to understand why streaming-video was behaving differently from the other options, and actually I think this can be fixed with a simple one-line patch: diff --git a/ui/spice-core.c b/ui/spice-core.c index 4fc48f8..3eed1da 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -344,7 +344,7 @@ static const char *stream_video_names[] = { [ SPICE_STREAM_VIDEO_FILTER ] = "filter", }; #define parse_stream_video(_name) \ - name2enum(_name, stream_video_names, ARRAY_SIZE(stream_video_names)) + parse_name(_name, "stream video control", stream_video_names, ARRAY_SIZE(stream_video_names)) static const char *compression_names[] = { [ SPICE_IMAGE_COMPRESS_OFF ] = "off", (In reply to comment #4) Yes, that should fix it. Patch sent to qemu-devel, thanks for confirming the patch makes sense! Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Before Fix: When a bad value was given for qemu-kvm command line "-spice" option "streaming-video", it was ignored. The default value was used and the VM was running. After Fix: When a bad value is given for qemu-kvm command line "-spice" option "streaming-video", an error message is shown and the program exits. Reproduced with qemu-kvm-0.12.1.2-2.312.el6.x86_64, spice-server-0.10.1-10.el6.x86_64. Steps: 1. passing invalid value to streaming-video CLI: /usr/libexec/qemu-kvm -M rhel6.3.0 -enable-kvm -m 2048 -smp 4,sockets=2,cores=2,threads=1 -drive file=test.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,serial=f82002eb-520c-469b-90c2-663277e90437,cache=none,werror=stop,rerror=stop,aio=native -device virtio-blk-pci,scsi=off,bus=pci.0,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -netdev tap,id=hostnet0,vhost=on -device virtio-net-pci,netdev=hostnet0,id=net0,mac=00:1a:4a:42:0b:38,bus=pci.0 -k en-us -vga qxl -spice port=5900,disable-ticketing,image-compression=auto_glz,jpeg-wan-compression=auto,zlib-glz-wan-compression=auto,streaming-video=bad_value,playback-compression=on -monitor stdio ^^^^^^^^^ Actual Result: Guest successfully booted up instead of quitting on error. Did same tests on image-compression, jpeg-wan-compression, zlib-glz-wan-compression=auto, playback-compression=on. All caused qemu-kvm quitted on invalid error. Detail error info: 1. image-compression=bad_value spice: invalid image compression: bad_value 2. 2.1 jpeg-wan-compression=bad_value spice: invalid wan compression: bad_value 2.2 zlib-glz-wan-compression=bad_value spice: invalid wan compression: bad_value 3. playback-compression=bad_value qemu-kvm: -spice port=5900,disable-ticketing,image-compression=auto_glz,jpeg-wan-compression=auto,zlib-glz-wan-compression=auto,streaming-video=filter,playback-compression=bad_value: Parameter 'playback-compression' expects 'on' or 'off' parse error: port=5900,disable-ticketing,image-compression=auto_glz,jpeg-wan-compression=auto,zlib-glz-wan-compression=auto,streaming-video=filter,playback-compression=bad_value Verified on: RHEL 6.3, using qemu-kvm-0.12.1.2-2.320.el6.x86_64, that qemu-kvm no longer allows the VM to be launched if an invalid value is set for streaming-video. It now exits and displays the error message: spice: invalid stream video control: <invalid value> Also verified that the 3 valid values of off, all, and filter work properly. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2013-0527.html |