From: Avi Kivity <avi@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: Uri Lublin <uril@redhat.com>, Ryan Harper <ryanh@us.ibm.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH] kvm-autotest: stepeditor: clear image if width, height, or data are invalid
Date: Sun, 05 Apr 2009 15:31:03 +0300 [thread overview]
Message-ID: <49D8A487.9060803@redhat.com> (raw)
In-Reply-To: <1238794446-sup-7467@blackpad>
Eduardo Habkost wrote:
>>>>> SPACE_RGB, False, 8, w, h, w*3)
>>>>>
>> Traceback (most recent call last):
>> File "<stdin>", line 1, in ?
>> MemoryError
>>
>
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> client/tests/kvm_runtest_2/stepeditor.py | 14 +++++++++-----
> 1 files changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/client/tests/kvm_runtest_2/stepeditor.py b/client/tests/kvm_runtest_2/stepeditor.py
> index caaf47b..383834b 100755
> --- a/client/tests/kvm_runtest_2/stepeditor.py
> +++ b/client/tests/kvm_runtest_2/stepeditor.py
> @@ -488,14 +488,18 @@ Utilities
> vscrollbar = self.scrolledwindow.get_vscrollbar()
> vscrollbar.set_range(0, h)
>
> + def clear_image(self):
> + self.image.clear()
> + self.image_width = 0
> + self.image_height = 0
> + self.image_data = ""
> +
> def set_image_from_file(self, filename):
> if not filename or not os.path.exists(filename):
> - self.image.clear()
> - self.image_width = 0
> - self.image_height = 0
> - self.image_data = ""
> - return
> + return self.clear_image()
> (w, h, data) = ppm_utils.image_read_from_ppm_file(filename)
> + if w <= 0 or h <= 0 or not data:
> + return self.clear_image()
> self.set_image(w, h, data)
>
Instead of returning an empty image here, we should throw an exception.
Qemu shouldn't write invalid image.
I've just sent a patch to qemu-devel which may help with this.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2009-04-05 12:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-01 15:55 kvm-autotest: weird memory error during stepmaker test Ryan Harper
2009-04-03 20:37 ` Eduardo Habkost
2009-04-03 21:43 ` [PATCH] kvm-autotest: stepeditor: clear image if width, height, or data are invalid Eduardo Habkost
2009-04-05 12:31 ` Avi Kivity [this message]
2009-04-05 17:33 ` Eduardo Habkost
2009-04-05 17:33 ` Uri Lublin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49D8A487.9060803@redhat.com \
--to=avi@redhat.com \
--cc=ehabkost@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=ryanh@us.ibm.com \
--cc=uril@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox