From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
George Dunlap <george.dunlap@citrix.com>,
Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
Anthony PERARD <anthony.perard@citrix.com>,
Juergen Gross <jgross@suse.com>, Tim Deegan <tim@xen.org>
Subject: [PATCH v2 0/7] Rationalize usage of xc_domain_getinfo{,list}()
Date: Fri, 28 Apr 2023 11:41:17 +0100 [thread overview]
Message-ID: <20230428104124.1044-1-alejandro.vallejo@cloud.com> (raw)
v2:
* Various stylistic changes to match Xen style
* Removed hardcoded ARRAY_SIZE() macro in favour of common-macros.h
* Changed error handling convention of xc_domain_getinfo_single()
to return {0,-1}/errno
* Removed error handling overrides on xc_getininfo_single() callers
* Improved some debug on the error path of xc_getinfo_single() callers
* Used dominfo_shutdown_with() in lowlevel/xc/xc.c rather than extracting
the 'crashed' condition manually.
xc_domain_getinfo() returns the list of domains with domid >= first_domid.
It does so by repeatedly invoking XEN_DOMCTL_getdomaininfo, which leads to
unintuitive behaviour (asking for domid=1 might succeed returning domid=2).
Furthermore, N hypercalls are required whereas the equivalent functionality
can be achieved using with XEN_SYSCTL_getdomaininfo.
Ideally, we want a DOMCTL interface that operates over a single precisely
specified domain and a SYSCTL interface that can be used for bulk queries.
All callers of xc_domain_getinfo() that are better off using SYSCTL are
migrated to use that instead. That includes callers performing domain
discovery and those requesting info for more than 1 domain per hypercall.
A new xc_domain_getinfo_single() is introduced with stricter semantics than
xc_domain_getinfo() (failing if domid isn't found) to migrate the rest to.
With no callers left the xc_dominfo_t structure and the xc_domain_getinfo()
call itself can be cleanly removed, and the DOMCTL interface simplified to
only use its fastpath.
With the DOMCTL amended, the new xc_domain_getinfo_single() drops its
stricter check, becoming a simple wrapper to invoke the hypercall itself.
Alejandro Vallejo (7):
tools: Make some callers of xc_domain_getinfo() use
xc_domain_getinfolist()
tools: Create xc_domain_getinfo_single()
tools: Refactor console/io.c to avoid using xc_domain_getinfo()
tools: Make init-xenstore-domain use xc_domain_getinfolist()
tools: Modify single-domid callers of xc_domain_getinfolist()
tools: Use new xc function for some xc_domain_getinfo() calls
domctl: Modify XEN_DOMCTL_getdomaininfo to fail if domid is not found
tools/console/client/main.c | 7 +--
tools/console/daemon/io.c | 31 +++++-----
tools/debugger/kdd/kdd-xen.c | 6 +-
tools/helpers/init-xenstore-domain.c | 14 +++--
tools/include/xenctrl.h | 63 ++++++++-----------
tools/libs/ctrl/xc_domain.c | 82 +++++--------------------
tools/libs/ctrl/xc_pagetab.c | 7 +--
tools/libs/ctrl/xc_private.c | 7 +--
tools/libs/ctrl/xc_private.h | 7 ++-
tools/libs/guest/xg_core.c | 23 +++----
tools/libs/guest/xg_core.h | 6 +-
tools/libs/guest/xg_core_arm.c | 10 +--
tools/libs/guest/xg_core_x86.c | 18 +++---
tools/libs/guest/xg_cpuid_x86.c | 34 +++++-----
tools/libs/guest/xg_dom_boot.c | 16 ++---
tools/libs/guest/xg_domain.c | 8 +--
tools/libs/guest/xg_offline_page.c | 12 ++--
tools/libs/guest/xg_private.h | 1 +
tools/libs/guest/xg_resume.c | 19 +++---
tools/libs/guest/xg_sr_common.h | 2 +-
tools/libs/guest/xg_sr_restore.c | 17 ++---
tools/libs/guest/xg_sr_restore_x86_pv.c | 2 +-
tools/libs/guest/xg_sr_save.c | 26 +++-----
tools/libs/guest/xg_sr_save_x86_pv.c | 6 +-
tools/libs/light/libxl_dom.c | 17 ++---
tools/libs/light/libxl_dom_suspend.c | 7 +--
tools/libs/light/libxl_domain.c | 13 ++--
tools/libs/light/libxl_mem.c | 4 +-
tools/libs/light/libxl_sched.c | 26 ++++----
tools/libs/light/libxl_x86_acpi.c | 4 +-
tools/misc/xen-hvmcrash.c | 6 +-
tools/misc/xen-lowmemd.c | 6 +-
tools/misc/xen-mfndump.c | 22 +++----
tools/misc/xen-vmtrace.c | 6 +-
tools/python/xen/lowlevel/xc/xc.c | 28 ++++-----
tools/vchan/vchan-socket-proxy.c | 6 +-
tools/xenmon/xenbaked.c | 6 +-
tools/xenpaging/xenpaging.c | 10 +--
tools/xenstore/xenstored_domain.c | 15 +++--
tools/xentrace/xenctx.c | 8 +--
xen/common/domctl.c | 32 +---------
41 files changed, 254 insertions(+), 386 deletions(-)
--
2.34.1
next reply other threads:[~2023-04-28 10:42 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-28 10:41 Alejandro Vallejo [this message]
2023-04-28 10:41 ` [PATCH v2 1/7] tools: Make some callers of xc_domain_getinfo() use xc_domain_getinfolist() Alejandro Vallejo
2023-04-28 12:19 ` Marek Marczykowski-Górecki
2023-04-28 12:21 ` Andrew Cooper
2023-04-28 10:41 ` [PATCH v2 2/7] tools: Create xc_domain_getinfo_single() Alejandro Vallejo
2023-04-28 12:23 ` Andrew Cooper
2023-04-28 10:41 ` [PATCH v2 3/7] tools: Refactor console/io.c to avoid using xc_domain_getinfo() Alejandro Vallejo
2023-04-28 12:33 ` Andrew Cooper
2023-04-28 12:43 ` Andrew Cooper
2023-04-28 12:58 ` Alejandro Vallejo
2023-04-28 10:41 ` [PATCH v2 4/7] tools: Make init-xenstore-domain use xc_domain_getinfolist() Alejandro Vallejo
2023-04-28 12:40 ` Andrew Cooper
2023-04-28 12:45 ` Alejandro Vallejo
2023-04-28 13:10 ` Andrew Cooper
2023-04-28 10:41 ` [PATCH v2 5/7] tools: Modify single-domid callers of xc_domain_getinfolist() Alejandro Vallejo
2023-04-28 15:22 ` Andrew Cooper
2023-04-28 10:41 ` [PATCH v2 6/7] tools: Use new xc function for some xc_domain_getinfo() calls Alejandro Vallejo
2023-04-28 16:29 ` Andrew Cooper
2023-04-28 10:41 ` [PATCH v2 7/7] domctl: Modify XEN_DOMCTL_getdomaininfo to fail if domid is not found Alejandro Vallejo
2023-04-28 14:05 ` Andrew Cooper
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=20230428104124.1044-1-alejandro.vallejo@cloud.com \
--to=alejandro.vallejo@cloud.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@citrix.com \
--cc=george.dunlap@citrix.com \
--cc=jbeulich@suse.com \
--cc=jgross@suse.com \
--cc=julien@xen.org \
--cc=sstabellini@kernel.org \
--cc=tim@xen.org \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.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.