All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: qemu-devel@nongnu.org, lvivier@redhat.com, pbonzini@redhat.com,
	dgilbert@redhat.com, peterx@redhat.com,
	"Christian Borntraeger" <borntraeger@de.ibm.com>,
	"Cédric Le Goater" <clg@kaod.org>
Subject: Re: [Qemu-devel] [PATCH 1/2] tests: Use real size for iov tests
Date: Wed, 30 Aug 2017 11:45:07 +0200	[thread overview]
Message-ID: <87a82h75jw.fsf@secure.mitica> (raw)
In-Reply-To: <6f537126-f1a6-2159-d8f7-35d34b803dfa@redhat.com> (Thomas Huth's message of "Mon, 28 Aug 2017 18:10:09 +0200")

Thomas Huth <thuth@redhat.com> wrote:
> On 23.08.2017 10:39, Juan Quintela wrote:
>> We were using -1 instead of the real size because the functions check
>> what is bigger, size in bytes or the size of the iov.  Recent gcc's
>> barf at this.
>> 
>> Signed-off-by: Juan Quintela <quintela@redhat.com>
>> ---
>>  tests/test-iov.c | 8 ++++----
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> While you're at it, could you maybe also adjust the comments in
> include/qemu/iov.h ? It currently says:
>
>  * It is okay to use very large value for `bytes' since we're
>  * limited by the size of the iovec anyway, provided that the
>  * buffer pointed to by buf has enough space.  One possible
>  * such "large" value is -1 (sinice size_t is unsigned),
>  * so specifying `-1' as `bytes' means 'up to the end of iovec'.

Haven't found this.  Fixing.

>
> ... and apparently -1 is not working anymore as expected. Maybe SIZE_MAX
> from stdint.h is a better choice?

Compiler get confused with it, because we have _new_ values, see the
warning on the cover, I *think* that in this one, the compiler is *kind*
of right. (*)

>  Thomas

Later, Juan.

(*) see the warning, I think that it gets a bit confused, but generaly,
    we are just abusing the interface, and anyways, we are using in real
    code the real size, and in the test, it was easy to change
    everything to the real size, so I think it is better just to remove
    *that* feature.

  reply	other threads:[~2017-08-30  9:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-23  8:38 [Qemu-devel] [PATCH 0/2] Fix tests on recent gcc Juan Quintela
2017-08-23  8:39 ` [Qemu-devel] [PATCH 1/2] tests: Use real size for iov tests Juan Quintela
2017-08-23 11:18   ` Peter Xu
2017-08-23 11:35     ` Juan Quintela
2017-08-28 16:10   ` Thomas Huth
2017-08-30  9:45     ` Juan Quintela [this message]
2017-08-30 11:34     ` Juan Quintela
2017-08-23  8:39 ` [Qemu-devel] [PATCH 2/2] tests: Make acpid test compile Juan Quintela
2017-08-23 11:53   ` Dr. David Alan Gilbert
2017-08-28 14:41     ` Cédric Le Goater
2017-08-29 20:17       ` Eric Blake
2017-08-30 10:45         ` Daniel P. Berrange
2017-08-30 11:37           ` Juan Quintela
2017-08-30 10:51       ` Juan Quintela
2017-08-30 11:07         ` Daniel P. Berrange

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=87a82h75jw.fsf@secure.mitica \
    --to=quintela@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=clg@kaod.org \
    --cc=dgilbert@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.