]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Keep QEMU host drive prefix in BlkIoTune
authorStefan Hajnoczi <stefanha@redhat.com>
Thu, 1 Nov 2012 17:20:55 +0000 (18:20 +0100)
committerCole Robinson <crobinso@redhat.com>
Sun, 9 Dec 2012 22:48:11 +0000 (17:48 -0500)
The QEMU -drive id= begins with libvirt's QEMU host drive prefix
("drive-"), which is stripped off in several places two convert between
host ("-drive") and guest ("-device") device names.

In the case of BlkIoTune it is unnecessary to strip the QEMU host drive
prefix because we operate on "info block"/"query-block" output that uses
host drive names.

Stripping the prefix incorrectly caused string comparisons to fail since
we were comparing the guest device name against the host device name.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit 04ee70bfda21bfdb48b55f074aed25fc75bb9226)

AUTHORS
src/qemu/qemu_monitor_json.c
src/qemu/qemu_monitor_text.c

diff --git a/AUTHORS b/AUTHORS
index 41e6bd55ca6a1ac1238e54064e86140cc961fd36..6390df809c1a526bcda4940c9f45d8a84044579b 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -242,6 +242,7 @@ Patches have also been contributed by:
   Eiichi Tsukata       <eiichi.tsukata.xh@hitachi.com>
   Wido den Hollander   <wido@widodh.nl>
   Gene Czarcinski      <gene@czarc.net>
+  Stefan Hajnoczi      <stefanha@redhat.com>
 
   [....send patches to get your name here....]
 
index 4bb09d9b461b5cf01b33215705f7953cab275f14..072736b31f1aa6883ccceac6adbc70e468edfa8a 100644 (file)
@@ -3518,9 +3518,6 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr result,
             goto cleanup;
         }
 
-       if(STRPREFIX(current_dev, QEMU_DRIVE_HOST_PREFIX))
-            current_dev += strlen(QEMU_DRIVE_HOST_PREFIX);
-
         if (STREQ(current_dev, device))
             continue;
 
index ddc86ef647a00578988a7a3f4abf33dbb9b43053..3c61d3263c371df749e98fe3b3bf7be82641fe7c 100644 (file)
@@ -3367,9 +3367,6 @@ qemuMonitorTextParseBlockIoThrottle(const char *result,
     p = result;
 
     while (*p) {
-        if (STRPREFIX(p, QEMU_DRIVE_HOST_PREFIX))
-            p += strlen(QEMU_DRIVE_HOST_PREFIX);
-
         if (STREQLEN(p, device, devnamelen) &&
             p[devnamelen] == ':' && p[devnamelen+1] == ' ') {