[libvirt] [PATCH] QXL: fix reloading of vram64 attribute

Commit b4a5fd95 introduced vram64 attribute for QXL video device but there were two issues. Only function qemuMonitorJSONUpdateVideoVram64Size should update the vram64 attribute and also the value is in MiB, not in B. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_monitor_json.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index e140d0e..d068c3d 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -1437,17 +1437,6 @@ qemuMonitorJSONUpdateVideoMemorySize(qemuMonitorPtr mon, } video->vram = prop.val.ul / 1024; - if (video->vram64 != 0) { - if (qemuMonitorJSONGetObjectProperty(mon, path, - "vram64_size_mb", &prop) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("QOM Object '%s' has no property 'vram64_size_mb'"), - path); - return -1; - } - video->vram64 = prop.val.ul / 1024; - } - if (qemuMonitorJSONGetObjectProperty(mon, path, "ram_size", &prop) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("QOM Object '%s' has no property 'ram_size'"), @@ -1509,7 +1498,7 @@ qemuMonitorJSONUpdateVideoVram64Size(qemuMonitorPtr mon, path); return -1; } - video->vram64 = prop.val.ul / 1024; + video->vram64 = prop.val.ul * 1024; } break; case VIR_DOMAIN_VIDEO_TYPE_VGA: -- 2.8.1

On 04/13/2016 04:21 AM, Pavel Hrdina wrote:
Commit b4a5fd95 introduced vram64 attribute for QXL video device but there were two issues. Only function qemuMonitorJSONUpdateVideoVram64Size should update the vram64 attribute and also the value is in MiB, not in B.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_monitor_json.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index e140d0e..d068c3d 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -1437,17 +1437,6 @@ qemuMonitorJSONUpdateVideoMemorySize(qemuMonitorPtr mon, } video->vram = prop.val.ul / 1024;
- if (video->vram64 != 0) { - if (qemuMonitorJSONGetObjectProperty(mon, path, - "vram64_size_mb", &prop) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("QOM Object '%s' has no property 'vram64_size_mb'"), - path); - return -1; - } - video->vram64 = prop.val.ul / 1024; - } - if (qemuMonitorJSONGetObjectProperty(mon, path, "ram_size", &prop) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("QOM Object '%s' has no property 'ram_size'"), @@ -1509,7 +1498,7 @@ qemuMonitorJSONUpdateVideoVram64Size(qemuMonitorPtr mon, path); return -1; } - video->vram64 = prop.val.ul / 1024; + video->vram64 = prop.val.ul * 1024; } break; case VIR_DOMAIN_VIDEO_TYPE_VGA:
ACK, but sounds like this is something that should be tested with qemuhotplugtest.c ? - Cole
participants (2)
-
Cole Robinson
-
Pavel Hrdina