qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Linhaifeng <haifeng.lin@huawei.com>
To: Gonglei <arei.gonglei@huawei.com>, qemu-devel@nongnu.org
Cc: mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH 2/2] vhost-user: add reply for set_mem_table
Date: Tue, 10 Feb 2015 13:33:26 +0800	[thread overview]
Message-ID: <54D99826.9080908@huawei.com> (raw)
In-Reply-To: <54D98193.3050709@huawei.com>



On 2015/2/10 11:57, Gonglei wrote:
> On 2015/2/10 11:24, linhaifeng wrote:
>> From: Linhaifeng <haifeng.lin@huawei.com>
>>
>> If u64 is not 0 we should return -1 to tell qemu not going on.
>>
>> Signed-off-by: Linhaifeng <haifeng.lin@huawei.com>
>> ---
>>  hw/virtio/vhost-user.c | 13 ++++++++++++-
>>  1 file changed, 12 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
>> index aefe0bb..a68ce36 100644
>> --- a/hw/virtio/vhost-user.c
>> +++ b/hw/virtio/vhost-user.c
>> @@ -243,7 +243,7 @@ static int vhost_user_call(struct vhost_dev *dev, unsigned long int request,
>>          msg.size = sizeof(m.memory.nregions);
>>          msg.size += sizeof(m.memory.padding);
>>          msg.size += fd_num * sizeof(VhostUserMemoryRegion);
>> -
>> +        need_reply = 1;
>>          break;
>>  
>>      case VHOST_SET_LOG_FD:
>> @@ -315,6 +315,17 @@ static int vhost_user_call(struct vhost_dev *dev, unsigned long int request,
>>              }
>>              memcpy(arg, &msg.state, sizeof(struct vhost_vring_state));
>>              break;
>> +        case VHOST_SET_MEM_TABLE:
>> +            if (msg.size != sizeof(m.u64)) {
>> +                error_report("Received bad msg size.\n");
> A superfluous "\n" character.

Hi Gonglei

Thank you for your review.

Yes, error_report has printed '\n'.
I will remove it.

>> +                return -1;
>> +            } else {
>> +                if (m.u64) {
>> +                    error_report("Failed to set memory table.\n");
> A superfluous "\n" character.
> 
> Regards,
> -Gonglei
>> +                    return -1;
>> +                }
>> +            }
>> +            break;
>>          default:
>>              error_report("Received unexpected msg type.\n");
>>              return -1;
>>
> 
> 
> 
> .
> 

-- 
Regards,
Haifeng

      reply	other threads:[~2015-02-10  5:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-10  3:24 [Qemu-devel] [PATCH 1/2] vhost-user: support SET_MEM_TABLE waite the result of mmap linhaifeng
2015-02-10  3:24 ` [Qemu-devel] [PATCH 2/2] vhost-user: add reply for set_mem_table linhaifeng
2015-02-10  3:57   ` Gonglei
2015-02-10  5:33     ` Linhaifeng [this message]

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=54D99826.9080908@huawei.com \
    --to=haifeng.lin@huawei.com \
    --cc=arei.gonglei@huawei.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).