Bug 907743 - qemu-ga: empty reason string for OpenFileFailed error
qemu-ga: empty reason string for OpenFileFailed error
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
7.0
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Laszlo Ersek
Virtualization Bugs
:
: 971959 1018655 1022843 (view as bug list)
Depends On:
Blocks: 987757
  Show dependency treegraph
 
Reported: 2013-02-05 02:40 EST by Sibiao Luo
Modified: 2014-06-17 23:22 EDT (History)
12 users (show)

See Also:
Fixed In Version: qemu-kvm-1.5.3-14.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-13 06:00:55 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Sibiao Luo 2013-02-05 02:40:05 EST
Description of problem:
we have fixed the 'qemu-ga: empty reason string for OpenFileFailed error' problem in bug 867983 for rhel6, but maybe the code did not pull in latest rhel7, so i open a bug for tracing this issue in rhel7.

host info:
kernel-3.7.0-0.34.el7
qemu-kvm-1.3.0-3.el7
guest info:
kernel-3.7.0-0.34.el7
pm-utils-1.4.1-22.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.start guest with virtio-serial.
e.g:...-chardev socket,path=/tmp/qga.sock,server,nowait,id=qga0 -device virtio-serial -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0,id=sr0
2.start guest agent inside guest and connect the chardev socket in host side for sending commands to guest.
guest] # /usr/bin/qemu-ga on
host ] # nc -U /tmp/qga.sock
3.send guest-file-open command in the host side to open a none existing directory file.
  
Actual results:
after step 3,
{"execute":"guest-ping"}
{"return": {}}
{"execute":"guest-file-open", "arguments":{"path":"/sluo/test","mode":"w+"}}      
{"error": {"class": "GenericError", "desc": "Could not open '/sluo/test'"}}
{"execute":"guest-file-open", "arguments":{"path":"/sluo/test"}}
{"error": {"class": "GenericError", "desc": "Could not open '/sluo/test'"}}
{"execute":"guest-file-open", "arguments":{"path":"/sluo/test","mode":"r"}}
{"error": {"class": "GenericError", "desc": "Could not open '/sluo/test'"}}
{"execute":"guest-ping"}
{"return": {}}

Expected results:
it can got error information: "No such file or directory", like example:
# nc -U /tmp/qga.sock
{ "execute": "guest-file-open", "arguments": { "path": "/sluo/test" }}
{"error": {"class": "OpenFileFailed", "desc": "Could not open '/sluo/test':
No such file or directory", "data": {"filename": "/sluo/test",
"__com.redhat_error_message": "No such file or directory"}}

Additional info:
Comment 1 Luiz Capitulino 2013-02-05 06:51:48 EST
That's correct, will be fixed soon.
Comment 2 Luiz Capitulino 2013-04-30 11:43:36 EDT
This has been fixed upstream and qemu 1.5.0 will contain this fix, changing status to POST.
Comment 3 Miroslav Rezanina 2013-05-23 08:01:07 EDT
Build in qemu-kvm-1.5.0-1.el7
Comment 4 Qian Guo 2013-10-14 02:29:25 EDT
*** Bug 1018655 has been marked as a duplicate of this bug. ***
Comment 5 Qian Guo 2013-10-14 02:34:49 EDT
Test this bug with components:

# uname -r
3.10.0-33.el7.x86_64
# rpm -q qemu-kvm
qemu-kvm-1.5.3-8.el7.x86_64

Hit this issue, both test qmp and qemu-ga:
For qmp:
start cli w/ qmp:
<qemu-kvm cli> ... -qmp tcp:0:4555,server,nowait


{ "execute": "memsave",
             "arguments": { "val": 10,
                            "size": 100,
                            "filename": "/lll/lsl" } } 
{"error": {"class": "GenericError", "desc": "Could not open '/lll/lsl'"}}

{ "execute": "transaction",
     "arguments": { "actions": [
         { 'type': 'blockdev-snapshot-sync', 'data' : { "device": "drive-virtio-disk0","snapshot-file": "/some/place/my-image","format": "qcow2" } },{ 'type': 'blockdev-snapshot-sync', 'data' : { "device": "ide1-cd0","snapshot-file": "/some/place/my-image2","mode": "existing","format": "qcow2" } } ] } }
{"error": {"class": "DeviceNotFound", "desc": "Device 'drive-virtio-disk0' not found"}}

{ "execute": "change",
             "arguments": { "device": "ide1-cd0",
              "target": "/home/a"}}
{"error": {"class": "GenericError", "desc": "Could not open '/home/a'"}}


For qemu-ga:
{"execute":"guest-file-open", "arguments":{"path":"/sluo/test","mode":"w+"}}
{"error": {"class": "GenericError", "desc": "failed to open file '/sluo/test' (mode: 'w+'): No such file or directory"}}
{"execute":"guest-file-open", "arguments":{"path":"/sluo/test","mode":"r"}}
{"error": {"class": "GenericError", "desc": "failed to open file '/sluo/test' (mode: 'r'): No such file or directory"}}
{"execute":"guest-file-open", "arguments":{"path":"/sluo/test"}}
{"error": {"class": "GenericError", "desc": "failed to open file '/sluo/test' (mode: 'r'): No such file or directory"}}


So will reassign this bug.
Comment 6 Luiz Capitulino 2013-10-15 10:02:44 EDT
Oh, you're right. My series didn't make it for 1.5.0. Thanks for testing!

Re-assigning to Laszlo as he's working on QMP stuff.
Comment 7 Laszlo Ersek 2013-10-31 06:27:31 EDT
38aea1 is a valid commit hash, but it seems unrelated to this BZ:

commit 38aea177d93556aada7c4c7aa530f0050715e293
Merge: b7a3b1c 187f1bc
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Mon Jun 17 08:57:56 2013 -0500

    Merge remote-tracking branch 'pmaydell/configury.next' into staging

I think it must have been a copy/paste error. I believe the commits we need are:

     1  54028d7 error: add error_setg_file_open() helper
     2  bc5741a rng-random: use error_setg_file_open()
     3  dacc26a block: mirror_complete(): use error_setg_file_open()
     4  0eef407 blockdev: use error_setg_file_open()
     5  618da85 cpus: use error_setg_file_open()
     6  7581766 dump: qmp_dump_guest_memory(): use error_setg_file_open()
     7  1befce9 savevm: qmp_xen_save_devices_state(): use error_setg_file_open()
     8  d8b6895 block: bdrv_reopen_prepare(): don't use QERR_OPEN_FILE_FAILED
     9  dbfbc63 qerror: drop QERR_OPEN_FILE_FAILED macro

(From <http://thread.gmane.org/gmane.comp.emulators.qemu/217084>.)
Comment 8 Laszlo Ersek 2013-10-31 06:39:35 EDT
54028d7 has been backported for bug 922010.
Comment 9 Luiz Capitulino 2013-10-31 09:38:38 EDT
Yes, the commits in comment 7 are correct. I pasted git log input (ie. git log 38aea1..dbfbc63).
Comment 10 Laszlo Ersek 2013-10-31 12:04:00 EDT
With the patches backported:

Qga test:

{"execute":"guest-ping"}
{"return": {}}

{"execute":"guest-file-open", "arguments":{"path":"/sluo/test","mode":"w+"}}      
{"error": {"class": "GenericError", "desc": "failed to open file '/sluo/test' (mode: 'w+'): No such file or directory"}}

QMP test (see patch #6 in comment 7):

# virsh qemu-monitor-command fw-seabios7.g-rhel7.e-rhel7 \
'{ "execute" : "dump-guest-memory",  "arguments" : { "paging" : false, "protocol" : "file:/tmp-1/vmcore" }}'

{"id":"libvirt-7","error":{"class":"GenericError","desc":"Could not open '/tmp-1/vmcore': No such file or directory"}}
Comment 12 Miroslav Rezanina 2013-11-06 06:26:20 EST
Fix included in -kvm-1.5.3-14.el7
Comment 14 Sibiao Luo 2013-11-18 01:45:09 EST
Verify this issue on qemu-kvm-1.5.3-19.el7.x86_64 with same steps as comment#0 and comment#10. It can got error information: "No such file or directory", so this issue has been fixed correctly.

host info:
3.10.0-41.el7.x86_64
qemu-kvm-1.5.3-19.el7.x86_64
seabios-1.7.2.2-4.el7.x86_64
guest info:
qemu-guest-agent-1.5.3-19.el7.x86_64

Steps and results:
# nc -U /tmp/qga.sock
{"execute":"guest-ping"}
{"return": {}}

{"execute":"guest-file-open", "arguments":{"path":"/sluo/test","mode":"w+"}}
{"error": {"class": "GenericError", "desc": "failed to open file '/sluo/test' (mode: 'w+'): No such file or directory"}}

{"execute":"guest-file-open", "arguments":{"path":"/sluo/test"}}
{"error": {"class": "GenericError", "desc": "failed to open file '/sluo/test' (mode: 'r'): No such file or directory"}}

{"execute":"guest-file-open", "arguments":{"path":"/sluo/test","mode":"r"}}
{"error": {"class": "GenericError", "desc": "failed to open file '/sluo/test' (mode: 'r'): No such file or directory"}}

{"execute":"guest-ping"}
{"return": {}}

Best Regards,
sluo
Comment 15 Laszlo Ersek 2013-11-21 08:28:42 EST
*** Bug 971959 has been marked as a duplicate of this bug. ***
Comment 16 Laszlo Ersek 2013-12-17 12:49:50 EST
*** Bug 1022843 has been marked as a duplicate of this bug. ***
Comment 18 Ludek Smid 2014-06-13 06:00:55 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

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