qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Hu Tao <hutao@cn.fujitsu.com>
Cc: Yasunori Goto <y-goto@jp.fujitsu.com>,
	Igor Mammedov <imammedo@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH for 2.1 2/2] memory-backend-file: improve error handling
Date: Thu, 03 Jul 2014 22:05:56 -0600	[thread overview]
Message-ID: <53B62824.2010209@redhat.com> (raw)
In-Reply-To: <20140704025613.GC31329@G08FNSTD100614.fnst.cn.fujitsu.com>

[-- Attachment #1: Type: text/plain, Size: 1603 bytes --]

On 07/03/2014 08:56 PM, Hu Tao wrote:
> On Thu, Jul 03, 2014 at 06:33:28AM -0600, Eric Blake wrote:
>> On 07/03/2014 12:10 AM, Hu Tao wrote:
>>> This patch fixes two problems of memory-backend-file:
>>>
>>> 1. If user adds a memory-backend-file object using object_add command,
>>>    specifying a non-existing directory for property mem-path, qemu
>>>    will core dump with message:
>>>
>>>      /nonexistingdir: No such file or directory
>>>      Bad ram offset fffffffffffff000
>>>      Aborted (core dumped)
>>>
>>> 2. If user adds a memory-backend-file object using object_add command,
>>>    specifying a size that is less than huge page size, qemu
>>>    will core dump with message:
>>>
>>>      Bad ram offset fffffffffffff000
>>>      Aborted (core dumped)
>>>
>>
>> Might be nice if the commit message also shows the new message issued
>> for the same cases after the patch is applied.
> 
> OK.
> 

>>>  
>>>      if (memory < hpagesize) {
>>> -        return NULL;
>>> +        error_setg(errp, "memory size 0x" RAM_ADDR_FMT " should be larger "
>>> +                   "than huge page size 0x%" PRIx64, memory, hpagesize);
>>> +        goto error;
>>
>> Isn't exactly equal also allowed?  Maybe a better wording is "should be
>> a multiple of the huge page size"
> 
> Yes. I'll change the error message.
> 

Thinking about it more, should you also enforce that it is a multiple?

As in: if (!memory || memory % hpageszie) { error... }

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2014-07-04  4:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-03  6:10 [Qemu-devel] [PATCH for 2.1 0/2] bug fixs for memory backend Hu Tao
2014-07-03  6:10 ` [Qemu-devel] [PATCH for 2.1 1/2] memory: introduce memory_region_init_ram_nofail() and memory_region_init_ram_ptr_nofail() Hu Tao
2014-07-03  6:51   ` Michael S. Tsirkin
2014-07-04  2:50     ` Hu Tao
2014-07-03  6:10 ` [Qemu-devel] [PATCH for 2.1 2/2] memory-backend-file: improve error handling Hu Tao
2014-07-03 12:33   ` Eric Blake
2014-07-04  2:56     ` Hu Tao
2014-07-04  4:05       ` Eric Blake [this message]
2014-07-04  7:43         ` Hu Tao
2014-07-04  7:47           ` Paolo Bonzini
2014-07-06  6:42             ` Michael S. Tsirkin
2014-07-07  2:23               ` Hu Tao

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=53B62824.2010209@redhat.com \
    --to=eblake@redhat.com \
    --cc=hutao@cn.fujitsu.com \
    --cc=imammedo@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=y-goto@jp.fujitsu.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;
as well as URLs for NNTP newsgroup(s).