qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 7c47c4: qom: provide root container for inter


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 7c47c4: qom: provide root container for internal objs
Date: Thu, 05 Oct 2017 05:09:49 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 7c47c4ead75d0b733ee8f2f51fd1de0644cc1308
      
https://github.com/qemu/qemu/commit/7c47c4ead75d0b733ee8f2f51fd1de0644cc1308
  Author: Peter Xu <address@hidden>
  Date:   2017-10-03 (Tue, 03 Oct 2017)

  Changed paths:
    M include/qom/object.h
    M qom/object.c

  Log Message:
  -----------
  qom: provide root container for internal objs

We have object_get_objects_root() to keep user created objects, however
no place for objects that will be used internally.  Create such a
container for internal objects.

CC: Andreas Färber <address@hidden>
CC: Markus Armbruster <address@hidden>
CC: Paolo Bonzini <address@hidden>
Suggested-by: Daniel P. Berrange <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 0173e21b617d3de1fcfa917e329bb9194ab332a4
      
https://github.com/qemu/qemu/commit/0173e21b617d3de1fcfa917e329bb9194ab332a4
  Author: Peter Xu <address@hidden>
  Date:   2017-10-03 (Tue, 03 Oct 2017)

  Changed paths:
    M include/sysemu/iothread.h
    M iothread.c

  Log Message:
  -----------
  iothread: provide helpers for internal use

IOThread is a general framework that contains IO loop environment and a
real thread behind.  It's also good to be used internally inside qemu.
Provide some helpers for it to create iothreads to be used internally.

Put all the internal used iothreads into the internal object container.

Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 82d90705fe203cc6e150c10bd61f0dbe6979e8f4
      
https://github.com/qemu/qemu/commit/82d90705fe203cc6e150c10bd61f0dbe6979e8f4
  Author: Peter Xu <address@hidden>
  Date:   2017-10-03 (Tue, 03 Oct 2017)

  Changed paths:
    M include/sysemu/iothread.h
    M iothread.c

  Log Message:
  -----------
  iothread: export iothread_stop()

So that internal iothread users can explicitly stop one iothread without
destroying it.

Since at it, fix iothread_stop() to allow it to be called multiple
times.  Before this patch we may call iothread_stop() more than once on
single iothread, while that may not be correct since qemu_thread_join()
is not allowed to run twice.  From manual of pthread_join():

  Joining with a thread that has previously been joined results in
  undefined behavior.

Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 5b3ac23fee97fc1a79ad2bb1cf3a1ce518d27905
      
https://github.com/qemu/qemu/commit/5b3ac23fee97fc1a79ad2bb1cf3a1ce518d27905
  Author: Peter Xu <address@hidden>
  Date:   2017-10-03 (Tue, 03 Oct 2017)

  Changed paths:
    M iothread.c

  Log Message:
  -----------
  iothread: delay the context release to finalize

When gcontext is used with iothread, the context will be destroyed
during iothread_stop().  That's not good since sometimes we would like
to keep the resources until iothread is destroyed, but we may want to
stop the thread before that point.

Delay the destruction of gcontext to iothread finalize.  Then we can do:

  iothread_stop(thread);
  some_cleanup_on_resources();
  iothread_destroy(thread);

We may need this patch if we want to run chardev IOs in iothreads and
hopefully clean them up correctly.  For more specific information,
please see 2b316774f6 ("qemu-char: do not operate on sources from
finalize callbacks").

Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: f708a5e71cba0d784e307334c07ade5f56f827ab
      
https://github.com/qemu/qemu/commit/f708a5e71cba0d784e307334c07ade5f56f827ab
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2017-10-03 (Tue, 03 Oct 2017)

  Changed paths:
    M util/aio-posix.c

  Log Message:
  -----------
  aio: fix assert when remove poll during destroy

After iothread is enabled internally inside QEMU with GMainContext, we
may encounter this warning when destroying the iothread:

(qemu-system-x86_64:19925): GLib-CRITICAL **: g_source_remove_poll:
 assertion '!SOURCE_DESTROYED (source)' failed

The problem is that g_source_remove_poll() does not allow to remove one
source from array if the source is detached from its owner
context. (peterx: which IMHO does not make much sense)

Fix it on QEMU side by avoid calling g_source_remove_poll() if we know
the object is during destruction, and we won't leak anything after all
since the array will be gone soon cleanly even with that fd.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-id: address@hidden
[peterx: write the commit message]
Signed-off-by: Peter Xu <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 5456c6a4ec9cd8fc314ddc303e88bf85c110975c
      
https://github.com/qemu/qemu/commit/5456c6a4ec9cd8fc314ddc303e88bf85c110975c
  Author: Peter Maydell <address@hidden>
  Date:   2017-10-05 (Thu, 05 Oct 2017)

  Changed paths:
    M include/qom/object.h
    M include/sysemu/iothread.h
    M iothread.c
    M qom/object.c
    M util/aio-posix.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into 
staging

# gpg: Signature made Tue 03 Oct 2017 19:53:34 BST
# gpg:                using RSA key 0x9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <address@hidden>"
# gpg:                 aka "Stefan Hajnoczi <address@hidden>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha/tags/block-pull-request:
  aio: fix assert when remove poll during destroy
  iothread: delay the context release to finalize
  iothread: export iothread_stop()
  iothread: provide helpers for internal use
  qom: provide root container for internal objs

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/d147f7e815f9...5456c6a4ec9c

reply via email to

[Prev in Thread] Current Thread [Next in Thread]