]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Drive hot-unplug: reliable parsing of HMP results
authorFrank Schreuder <fschreuder@transip.nl>
Mon, 10 Aug 2015 15:37:30 +0000 (17:37 +0200)
committerJán Tomko <jtomko@redhat.com>
Wed, 12 Aug 2015 16:30:28 +0000 (18:30 +0200)
commit69a3b0df2ddba98d4fcbfa5d188894575c242643
treee4202e1c4dd3833bc96e6b5e7f5e1606e46f312b
parentd5e6d1cfc74b6144d9bc1183b7d111a029ee3fdb
Drive hot-unplug: reliable parsing of HMP results

Hot-unplugging a disk from a guest that supports hot-unplugging generates an error
in the libvirt log when running QEMU with the "-msg timestamp=on" flag.

2015-08-06 10:48:59.945+0000: 11662: error : qemuMonitorTextDriveDel:2594 :
operation failed: deleting drive-virtio-disk4 drive failed:
2015-08-06T10:48:59.945058Z Device 'drive-virtio-disk4' not found

This error is caused because the HMP results are getting prefixed with a timestamp.
Parsing the output is not reliable with STRPREFIX as the results can be prefixed with a timestamp.

Using strstr ensures that parsing the output works whether the results are prefixed or not.

Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Frank Schreuder <fschreuder@transip.nl>
src/qemu/qemu_monitor_text.c