diff mbox

[1/2] hw/display/qxl: improve framebuffer error message

Message ID 1390214659-12296-1-git-send-email-alevy@redhat.com
State New
Headers show

Commit Message

Alon Levy Jan. 20, 2014, 10:44 a.m. UTC
Signed-off-by: Alon Levy <alevy@redhat.com>
---
 hw/display/qxl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Markus Armbruster Jan. 20, 2014, 11:55 a.m. UTC | #1
Alon Levy <alevy@redhat.com> writes:

> Signed-off-by: Alon Levy <alevy@redhat.com>
> ---
>  hw/display/qxl.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/display/qxl.c b/hw/display/qxl.c
> index e4f172e..f6af470 100644
> --- a/hw/display/qxl.c
> +++ b/hw/display/qxl.c
> @@ -1367,7 +1367,8 @@ static void qxl_create_guest_primary(PCIQXLDevice *qxl, int loadvm,
>      size = abs(requested_stride) * requested_height;
>      if (size > qxl->vgamem_size) {
>          qxl_set_guest_bug(qxl, "%s: requested primary larger then framebuffer"
> -                               " size", __func__);
> +                               " size %d > %d", __func__, size,
> +                               qxl->vgamem_size);
>          return;
>      }

Shouldn't you use %u or %PRIu32 to print uint32_t qxl->vgamem_size?

Hmm, we're comparing int size to uint32_t vgamem_size, not nice.  Should
size be unsigned?

Since you touch the message anyway, you could fix "larger then" to
"larger than".
diff mbox

Patch

diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index e4f172e..f6af470 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -1367,7 +1367,8 @@  static void qxl_create_guest_primary(PCIQXLDevice *qxl, int loadvm,
     size = abs(requested_stride) * requested_height;
     if (size > qxl->vgamem_size) {
         qxl_set_guest_bug(qxl, "%s: requested primary larger then framebuffer"
-                               " size", __func__);
+                               " size %d > %d", __func__, size,
+                               qxl->vgamem_size);
         return;
     }