qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hailiang Zhang <zhang.zhanghailiang@huawei.com>
To: "Eric Blake" <eblake@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: xuquan8@huawei.com, pbonzini@redhat.com, qemu-devel@nongnu.org,
	zhangchen fnst <zhangchen.fnst@cn.fujitsu.com>
Subject: Re: [Qemu-devel] [PATCH] char: Fix removing wrong GSource that be found by fd_in_tag
Date: Wed, 19 Apr 2017 08:40:31 +0800	[thread overview]
Message-ID: <58F6B1FF.6010302@huawei.com> (raw)
In-Reply-To: <be3b415e-9f51-e2e1-a06e-6d44cdc3baa3@redhat.com>

On 2017/4/18 21:36, Eric Blake wrote:
> On 04/14/2017 05:10 AM, Marc-André Lureau wrote:
>> Hi
>>
>> ----- Original Message -----
>>> We use fd_in_tag to find a GSource, fd_in_tag is return value of
>>> g_source_attach(GSource *source, GMainContext *context), the return
>>> value is unique only in the same context, so we may get the same
>>> values with different 'context' parameters.
>>>
>>> It is no problem to find the right fd_in_tag by using
>>>   g_main_context_find_source_by_id(GMainContext *context, guint source_id)
>>> while there is only one default main context.
>>>
>>> But colo-compare tries to create/use its own context, and if we pass wrong
>>> 'context' parameter with right fd_in_tag, we will find a wrong GSource
>>> to handle. We tied to fix the related codes in commit b43dec, but it didn't
>> tied->tried
>>
>> Please use a bit longer commit sha1, or full sha1, it will likely conflict otherwise in the future.
> 6 chars is indeed short, 7 is git's default as usually long enough,
> although I've encountered collisions that require 8 chars.  [And google
> has proved that you can have a collision across the entire hash,

Thanks for your explanation.  I didn't notice that before,
I have been always using the 6 chars hash to get the commit ...

> although that is harder to generate.] I generally use 8 or so when
> writing commit messages.  Fortunately, even if a collision is introduces
> later, someone that is motivated enough can still resolve the collision
> by filtering out any collisions that resolve to non-commits, and among
> the remaining colliding SHA1 focus on the one that has a commit date
> which predates the message with the reference.

Agreed, but I'd better to update the comment to make it clearer. thanks.

      reply	other threads:[~2017-04-19  0:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-14  3:41 [Qemu-devel] [PATCH] char: Fix removing wrong GSource that be found by fd_in_tag zhanghailiang
2017-04-14 10:10 ` Marc-André Lureau
2017-04-14 10:43   ` Hailiang Zhang
2017-04-18 13:36   ` Eric Blake
2017-04-19  0:40     ` Hailiang Zhang [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=58F6B1FF.6010302@huawei.com \
    --to=zhang.zhanghailiang@huawei.com \
    --cc=eblake@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=xuquan8@huawei.com \
    --cc=zhangchen.fnst@cn.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).