qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Honglei Huang <honghuan@amd.com>
To: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Cc: mst@redhat.com, cohuck@redhat.com, pbonzini@redhat.com,
	qemu-devel@nongnu.org, Ray.Huang@amd.com,
	odaki@rsg.ci.i.u-tokyo.ac.jp, alex.bennee@linaro.org,
	armbru@redhat.com
Subject: Re: [v5 2/2] virtio-gpu: use consistent error checking for virtio_gpu_create_mapping_iov
Date: Wed, 26 Nov 2025 10:01:36 +0800	[thread overview]
Message-ID: <7c464405-23c5-498d-be6e-a493f6981d0f@amd.com> (raw)
In-Reply-To: <5d48ae13-eb21-440a-a604-9f90a8e9c11f@collabora.com>



On 2025/11/25 05:31, Dmitry Osipenko wrote:
> On 11/24/25 06:24, Honglei Huang wrote:
>> diff --git a/hw/display/virtio-gpu-rutabaga.c b/hw/display/virtio-gpu-rutabaga.c
>> index ed5ae52acb..ea2928b706 100644
>> --- a/hw/display/virtio-gpu-rutabaga.c
>> +++ b/hw/display/virtio-gpu-rutabaga.c
>> @@ -466,7 +466,7 @@ rutabaga_cmd_attach_backing(VirtIOGPU *g, struct virtio_gpu_ctrl_command *cmd)
>>   
>>       ret = virtio_gpu_create_mapping_iov(g, att_rb.nr_entries, sizeof(att_rb),
>>                                           cmd, NULL, &res->iov, &res->iov_cnt);
>> -    CHECK(!ret, cmd);
>> +    CHECK(ret >= 0, cmd);
>>   
>>       vecs.iovecs = res->iov;
>>       vecs.num_iovecs = res->iov_cnt;
>> @@ -616,7 +616,7 @@ rutabaga_cmd_resource_create_blob(VirtIOGPU *g,
>>           result = virtio_gpu_create_mapping_iov(g, cblob.nr_entries,
>>                                                  sizeof(cblob), cmd, &res->addrs,
>>                                                  &res->iov, &res->iov_cnt);
>> -        CHECK(!result, cmd);
>> +        CHECK(result >= 0, cmd);
>>       }
> 
> The ret < 0 part looks okay, but ret >= 0 feels dubious to me given that
> this func doesn't return positive values.
> 

Will remove the ret >= 0 check according to your requirements in V6.



      parent reply	other threads:[~2025-11-26  2:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-24  3:24 [v5 0/2] virtio-gpu: fix error handling and improve consistency Honglei Huang
2025-11-24  3:24 ` [v5 1/2] virtio-gpu: fix error handling in virgl_cmd_resource_create_blob Honglei Huang
2025-11-24 21:28   ` Dmitry Osipenko
2025-11-24  3:24 ` [v5 2/2] virtio-gpu: use consistent error checking for virtio_gpu_create_mapping_iov Honglei Huang
2025-11-24 21:31   ` Dmitry Osipenko
2025-11-25  5:53     ` Honglei Huang
2025-11-26  2:01     ` Honglei Huang [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=7c464405-23c5-498d-be6e-a493f6981d0f@amd.com \
    --to=honghuan@amd.com \
    --cc=Ray.Huang@amd.com \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=dmitry.osipenko@collabora.com \
    --cc=mst@redhat.com \
    --cc=odaki@rsg.ci.i.u-tokyo.ac.jp \
    --cc=pbonzini@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).