]> 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)
committerEric Blake <eblake@redhat.com>
Thu, 1 Nov 2012 21:51:58 +0000 (15:51 -0600)
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)

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

index f372199e3673392becb5a75817848a25c1cc9008..0db7cc472106fc1331b15f75393f0176417de3b2 100644 (file)
@@ -3677,9 +3677,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 7f5c3e37558af5543ada69e67a5db594e35b8bb0..b2ff334984efa66abf2ec38b0aa328b5b00db8cb 100644 (file)
@@ -3193,9 +3193,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] == ' ') {