* how to recognize in libxl that a domU has qemu-xen attached? @ 2018-05-17 12:33 Olaf Hering 2018-05-17 12:55 ` Juergen Gross 0 siblings, 1 reply; 5+ messages in thread From: Olaf Hering @ 2018-05-17 12:33 UTC (permalink / raw) To: xen-devel [-- Attachment #1.1: Type: text/plain, Size: 544 bytes --] In the other thread about the unsolved migration bugs in qemu-xen it became clear that "xen-save-devices-state" must not only be called for HVM, but for every domU that has qemu-xen attached to it. I wonder how to check for that fact from the migration code. While it can continue to rely on LIBXL_DOMAIN_TYPE_HVM make that call, for LIBXL_DOMAIN_TYPE_PV it is apparently not that easy. Is libxl__need_xenpv_qemu the API to use for the decision if libxl__qmp_stop/libxl__qmp_save/libxl__qmp_resume have to be called during migration? Olaf [-- Attachment #1.2: Digitale Signatur von OpenPGP --] [-- Type: application/pgp-signature, Size: 195 bytes --] [-- Attachment #2: Type: text/plain, Size: 157 bytes --] _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: how to recognize in libxl that a domU has qemu-xen attached? 2018-05-17 12:33 how to recognize in libxl that a domU has qemu-xen attached? Olaf Hering @ 2018-05-17 12:55 ` Juergen Gross 2018-05-17 14:54 ` Olaf Hering 0 siblings, 1 reply; 5+ messages in thread From: Juergen Gross @ 2018-05-17 12:55 UTC (permalink / raw) To: Olaf Hering, xen-devel On 17/05/18 14:33, Olaf Hering wrote: > In the other thread about the unsolved migration bugs in qemu-xen it became clear that "xen-save-devices-state" must not only be called for HVM, but for every domU that has qemu-xen attached to it. I wonder how to check for that fact from the migration code. While it can continue to rely on LIBXL_DOMAIN_TYPE_HVM make that call, for LIBXL_DOMAIN_TYPE_PV it is apparently not that easy. Is libxl__need_xenpv_qemu the API to use for the decision if libxl__qmp_stop/libxl__qmp_save/libxl__qmp_resume have to be called during migration? libxl__need_xenpv_qemu() is used to determine whether a pv domain needs a qemu process for at least one backend. To check for the correct qemu type you need to call libxl__device_model_version_running() and test the return value being LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN. So you need: if (libxl__need_xenpv_qemu(gc, d_config) && libxl__device_model_version_running(gc, domid) == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) libxl__qmp_stop(...); Juergen _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: how to recognize in libxl that a domU has qemu-xen attached? 2018-05-17 12:55 ` Juergen Gross @ 2018-05-17 14:54 ` Olaf Hering 2018-05-17 15:09 ` Olaf Hering 2018-05-17 15:29 ` Olaf Hering 0 siblings, 2 replies; 5+ messages in thread From: Olaf Hering @ 2018-05-17 14:54 UTC (permalink / raw) To: Juergen Gross; +Cc: xen-devel [-- Attachment #1.1: Type: text/plain, Size: 383 bytes --] Am Thu, 17 May 2018 14:55:10 +0200 schrieb Juergen Gross <jgross@suse.com>: > libxl__need_xenpv_qemu() is used to determine whether a pv domain needs > a qemu process for at least one backend. Thanks. Too bad, d_config is not available in that context. It is probably known somewhere by the callers. I guess such caller needs to pass a bool down to suspend/resume. Olaf [-- Attachment #1.2: Digitale Signatur von OpenPGP --] [-- Type: application/pgp-signature, Size: 195 bytes --] [-- Attachment #2: Type: text/plain, Size: 157 bytes --] _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: how to recognize in libxl that a domU has qemu-xen attached? 2018-05-17 14:54 ` Olaf Hering @ 2018-05-17 15:09 ` Olaf Hering 2018-05-17 15:29 ` Olaf Hering 1 sibling, 0 replies; 5+ messages in thread From: Olaf Hering @ 2018-05-17 15:09 UTC (permalink / raw) To: Juergen Gross; +Cc: xen-devel [-- Attachment #1.1: Type: text/plain, Size: 546 bytes --] Am Thu, 17 May 2018 16:54:00 +0200 schrieb Olaf Hering <olaf@aepfle.de>: > Thanks. Too bad, d_config is not available in that context. It is probably known somewhere by the callers. I guess such caller needs to pass a bool down to suspend/resume. It seems nothing inside libxl knows about libxl_domain_config, only callers of the public libxl_domain_suspend API do actually create it once. AFAICS only the LIBXL_SUSPEND_* 'flags' would allow to pass something down to the relevant code. But the resumer may not know about them... Olaf [-- Attachment #1.2: Digitale Signatur von OpenPGP --] [-- Type: application/pgp-signature, Size: 195 bytes --] [-- Attachment #2: Type: text/plain, Size: 157 bytes --] _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: how to recognize in libxl that a domU has qemu-xen attached? 2018-05-17 14:54 ` Olaf Hering 2018-05-17 15:09 ` Olaf Hering @ 2018-05-17 15:29 ` Olaf Hering 1 sibling, 0 replies; 5+ messages in thread From: Olaf Hering @ 2018-05-17 15:29 UTC (permalink / raw) To: Juergen Gross; +Cc: xen-devel [-- Attachment #1.1: Type: text/plain, Size: 1629 bytes --] Am Thu, 17 May 2018 16:54:00 +0200 schrieb Olaf Hering <olaf@aepfle.de>: > Am Thu, 17 May 2018 14:55:10 +0200 > schrieb Juergen Gross <jgross@suse.com>: > > libxl__need_xenpv_qemu() is used to determine whether a pv domain needs > > a qemu process for at least one backend. > Thanks. Too bad, d_config is not available in that context. It is probably known somewhere by the callers. I guess such caller needs to pass a bool down to suspend/resume. I think we may get around that missing d_config like that, I will test this approach: --- xen-4.10.0-testing.orig/tools/libxl/libxl_dom_suspend.c +++ xen-4.10.0-testing/tools/libxl/libxl_dom_suspend.c @@ -377,7 +377,9 @@ static void domain_suspend_common_guest_ libxl__ev_xswatch_deregister(gc, &dsps->guest_watch); libxl__ev_time_deregister(gc, &dsps->guest_timeout); - if (dsps->type == LIBXL_DOMAIN_TYPE_HVM) { + if (dsps->type == LIBXL_DOMAIN_TYPE_HVM || + libxl__device_model_version_running(gc, domid) == + LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) { rc = libxl__domain_suspend_device_model(gc, dsps); if (rc) { LOGD(ERROR, dsps->domid, @@ -460,7 +462,9 @@ int libxl__domain_resume(libxl__gc *gc, goto out; } - if (type == LIBXL_DOMAIN_TYPE_HVM) { + if (type == LIBXL_DOMAIN_TYPE_HVM || + libxl__device_model_version_running(gc, domid) == + LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) { rc = libxl__domain_resume_device_model(gc, domid); if (rc) { LOGD(ERROR, domid, "failed to resume device model:%d", rc); Olaf [-- Attachment #1.2: Digitale Signatur von OpenPGP --] [-- Type: application/pgp-signature, Size: 195 bytes --] [-- Attachment #2: Type: text/plain, Size: 157 bytes --] _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-05-17 15:29 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2018-05-17 12:33 how to recognize in libxl that a domU has qemu-xen attached? Olaf Hering 2018-05-17 12:55 ` Juergen Gross 2018-05-17 14:54 ` Olaf Hering 2018-05-17 15:09 ` Olaf Hering 2018-05-17 15:29 ` Olaf Hering
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).