From 39a427e8ba52d502d510f5c088018863c0bc4c90 Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Thu, 1 Nov 2012 18:20:55 +0100 Subject: [PATCH] qemu: Keep QEMU host drive prefix in BlkIoTune 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 (cherry picked from commit 04ee70bfda21bfdb48b55f074aed25fc75bb9226) --- AUTHORS | 1 + src/qemu/qemu_monitor_json.c | 3 --- src/qemu/qemu_monitor_text.c | 3 --- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/AUTHORS b/AUTHORS index 41e6bd55ca..6390df809c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -242,6 +242,7 @@ Patches have also been contributed by: Eiichi Tsukata Wido den Hollander Gene Czarcinski + Stefan Hajnoczi [....send patches to get your name here....] diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 4bb09d9b46..072736b31f 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -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; diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c index ddc86ef647..3c61d3263c 100644 --- a/src/qemu/qemu_monitor_text.c +++ b/src/qemu/qemu_monitor_text.c @@ -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] == ' ') {