mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-15 17:15:18 +00:00
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 <stefanha@redhat.com> (cherry picked from commit 04ee70bfda21bfdb48b55f074aed25fc75bb9226)
This commit is contained in:
parent
3feed5c100
commit
759c7195f0
@ -3677,9 +3677,6 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr result,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(STRPREFIX(current_dev, QEMU_DRIVE_HOST_PREFIX))
|
|
||||||
current_dev += strlen(QEMU_DRIVE_HOST_PREFIX);
|
|
||||||
|
|
||||||
if (STREQ(current_dev, device))
|
if (STREQ(current_dev, device))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -3193,9 +3193,6 @@ qemuMonitorTextParseBlockIoThrottle(const char *result,
|
|||||||
p = result;
|
p = result;
|
||||||
|
|
||||||
while (*p) {
|
while (*p) {
|
||||||
if (STRPREFIX(p, QEMU_DRIVE_HOST_PREFIX))
|
|
||||||
p += strlen(QEMU_DRIVE_HOST_PREFIX);
|
|
||||||
|
|
||||||
if (STREQLEN(p, device, devnamelen) &&
|
if (STREQLEN(p, device, devnamelen) &&
|
||||||
p[devnamelen] == ':' && p[devnamelen+1] == ' ') {
|
p[devnamelen] == ':' && p[devnamelen+1] == ' ') {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user