From: Jim Fehlig <jfehlig@suse.com>
To: Michal Privoznik <mprivozn@redhat.com>
Cc: libvir-list@redhat.com, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [libvirt] [PATCH 2/2] libxl: s/virDomainObjListFindByID/virDomainObjListFindByUUID/
Date: Fri, 24 Apr 2015 13:09:55 -0600 [thread overview]
Message-ID: <553A9503.2070701@suse.com> (raw)
In-Reply-To: <b1a2334cca8fbb1c147b9f8a7a362115f8dfa855.1429863712.git.mprivozn@redhat.com>
Michal Privoznik wrote:
> Like in previous commit, lets use FindByUUID() instead of
> ListFindByID(). The latter is suboptimal as it needs to iterate over
> each item in the domain object list, lock it and compare the IDs. If
> an object is already locked, we must wait until it's unlocked. During
> this wait, we keep the whole list locked, and potentially block other
> thread trying to access the list.
>
> There's no such problem with ListFindByUUID() since UUID is the key to
> the hash table, therefore it can be looked up without need for locking
> each single domain object.
>
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
> src/libxl/libxl_domain.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
> index 3039427..55d1313 100644
> --- a/src/libxl/libxl_domain.c
> +++ b/src/libxl/libxl_domain.c
> @@ -494,7 +494,7 @@ libxlDomainEventHandler(void *data, VIR_LIBXL_EVENT_CONST libxl_event *event)
> if (xl_reason == LIBXL_SHUTDOWN_REASON_SUSPEND)
> goto error;
>
> - vm = virDomainObjListFindByID(driver->domains, event->domid);
> + vm = virDomainObjListFindByUUID(driver->domains, event->domuuid.uuid);
>
Sadly, this won't work. event->domuuid is not populated when libxl
invokes the event handler
Breakpoint 1, libxlDomainEventHandler (data=0x7fffe0012310,
event=0x55555588abb0)
at libxl/libxl_domain.c:477
(gdb) p event->domuuid
$2 = {uuid = '\000' <repeats 15 times>}
Regards,
Jim
> if (!vm) {
> VIR_INFO("Received event for unknown domain ID %d", event->domid);
> goto error;
>
parent reply other threads:[~2015-04-24 19:09 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <b1a2334cca8fbb1c147b9f8a7a362115f8dfa855.1429863712.git.mprivozn@redhat.com>]
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=553A9503.2070701@suse.com \
--to=jfehlig@suse.com \
--cc=libvir-list@redhat.com \
--cc=mprivozn@redhat.com \
--cc=xen-devel@lists.xen.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 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.