Private/mingl/merge#1
Open
minglumlu wants to merge 192 commits intofeature/stream-updatesfrom
Open
Conversation
Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>
Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>
Suggested by @gabori on xapi-project/xs-opam#46 Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>
Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>
Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>
Without this, any logging attempted by Xs_client_unix will be silently dropped. Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
lib/xenstore: preserve logging from Xs_client_unix
The libraries where not packed, so although I believe the wrapping into namespace is the correct thing to do I will add a commit to unwrap them for retrocompatibility Signed-off-by: Marcello Seri <marcello.seri@citrix.com>
Signed-off-by: Marcello Seri <marcello.seri@citrix.com>
The tests are not unit tests but need to be run on a machine with `xenstored`. They can be run with `jbuilder runtest` or `make test` Signed-off-by: Marcello Seri <marcello.seri@citrix.com>
Signed-off-by: Marcello Seri <marcello.seri@citrix.com>
Signed-off-by: Marcello Seri <marcello.seri@citrix.com>
Port to jbuilder
Signed-off-by: Marcello Seri <marcello.seri@citrix.com>
Prepare to release 0.1.2
Signed-off-by: Christian Lindig <christian.lindig@citrix.com>
Signed-off-by: Christian Lindig <christian.lindig@citrix.com>
* Remove unused argument ~xs from has_fired(), wait_for() * Make more string safe * Fix typo in error message Signed-off-by: Christian Lindig <christian.lindig@citrix.com>
RFC: move Xenstore_watch into ezxenstore
The implementation of xenstore_watch depend on a debug module which is not part of xs-opam and hence creates a dependency problem. Making it a functor avoids this problem. Signed-off-by: Christian Lindig <christian.lindig@citrix.com>
CA-277850 add xenstore_watch as a module
This adds the new dependency on xenctrl to the opam file. Signed-off-by: Christian Lindig <christian.lindig@citrix.com>
CA-277850 update ezxenstore.opam (add xenctrl)
Signed-off-by: Marcello Seri <marcello.seri@citrix.com>
ezxenstore: update for safe-string
Signed-off-by: Marcello Seri <marcello.seri@citrix.com>
Signed-off-by: Marcello Seri <marcello.seri@citrix.com>
Signed-off-by: Marcello Seri <marcello.seri@citrix.com>
CA-286115, ez_xenstore_watch: make add and remove domain thread safe
CA-376319: Ensure that nbd_client_manager cannot block forever.
… of a ref This incorrect comparison made the collection fail for vms running in the coordinator host as it forced to request for the coordinator's IP Signed-off-by: Pau Ruiz Safont <pau.ruizsafont@cloud.com>
When the rrd files are not in the filesystem, avoid raising an exception, which makes the server return 500 error codes and instead signal the file is missing from the server Signed-off-by: Pau Ruiz Safont <pau.ruizsafont@cloud.com>
This prevents opam from trying to compile the tests when testing other packages Signed-off-by: Pau Ruiz Safont <pau.ruizsafont@cloud.com>
The local hostname may be set to FQDN, which is likely to exceed the netbios limit (15 chars), Then the netbios is compressed and randomized to meet the limit. However, user may pre-create the machine account to join domain with the hostname part of FQDN, thus we need to extract the hostname from the FQDN as netbios to join domain. Signed-off-by: Lin Liu <lin.liu@citrix.com>
Co-authored-by: Pau Ruiz Safont <psafont@users.noreply.github.com> Signed-off-by: liulinC <lin.liu@citrix.com>
We check if a VTPM already exists in a pool during import. Make sure we are more robusy if a VTPM does not exist by catching all exceptions. Signed-off-by: Christian Lindig <christian.lindig@cloud.com>
…/vtpm CP-39935 catch and log unexpected exceptions during import
In particular, if the host parameter is left out from the call, a null ref is used and put into the new PVS_cache_storage object. The DB GC will then destroy the object when it runs next, due to the invalid ref, but it is better to fail the create call immediately. Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
CA-376448: explicitly validate refs in PVS_cache_storage.create
- Currently /etc/xensource/xapi-ssl.pem is user (default root) readonly, to share to other users of one group add the setting "server-cert-group-id". - gencert.service can not read xapi config file, so feed the goup id in service unit file directly. In future can consider to make "xapi_globs" as common library so that gencert.service can read "server-cert-group-id" directly. - The group id -1 means the default group won't be changed. Signed-off-by: Deli Zhang <deli.zhang@citrix.com>
If HA or clustering is enabled, we are at risk of fencing if the IP address, netmask or gateway changes. This may happen if we switch to DHCP mode, or if we change a static configuration. The current checks deny any IP configuration change. However, changing just DNS servers in static mode would be safe even if HA or clustering is enabled. This commit relaxes the check. Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
CP-42835: Allow changing DNS servers when HA or clustering enabled
…alled In getting which RPM packages are going to be updated and installed before applying updates on a host, following cases are considered: 1. package-A-v1-r1 is installed and package-A-v2-r1 is an update. A new package-B-v1-r1 is required (hence introduced) by package-A-v2-r1. 2. package-X-v1-r1 is required by package-Y-v1-r1, and both are installed. Now package-Y-v2-r1 is an update, and doesn't require package-X anymore. In case#1, package-B-v1-r1 can't be returned by "yum list updates", but it can be returned by "yum list available". This was fixed in commit c020034. The fix results in another issue that in case#2, the package-X-v1-r1 is returned as an update from "yum list available". Ideally the package-X-v1-r1 should be obsoleted so that the fix in commit c020034 can handle it correctly. But it would be better to make the XAPI get the packages to be updated and installed exactly as what will be done in applying updates by "yum upgrade". This approach was considered in the first place when this feature was implemented. But the difficulty is that the output of "yum upgrade" can't be formatted as other YUM commands. To avoid more potential issues in future, this commit adds function to parse the RPM packages to be updated and installed from output of dry-run of "yum upgrade". Signed-off-by: Ming Lu <ming.lu@cloud.com>
Signed-off-by: Ming Lu <ming.lu@cloud.com>
This commit adds a redundancy for getting latest updates/installations from both 'repoquery' and 'yum upgrade (dry run)'. This is because: 1. the outputs of 'repoquery' are formatted which is good, but they don't return the updates/installations exactly; 2. the output of 'yum upgrade (dry run)' can return the updates/installations exactly, but it is non-formatted which would result in fragile parsing logic. Since this is critical to update function, an error in the fragile parsing might prevent the system from being applied furhter bugfixes and consequently make the update function stranded completely. The redundancy is to ensure that when any error occurred in the fragile parsing, the function would fall back to use the outputs of 'repoquery'. Signed-off-by: Ming Lu <ming.lu@cloud.com>
…375358 CA-375358: Parse output of yum upgrade to get RPMs to be updated/inst…
Signed-off-by: Pau Ruiz Safont <pau.ruizsafont@cloud.com>
…-42642 CP-42642: Support share server certificate file to group users
b026466 to
4e0095d
Compare
4e0095d to
13cd185
Compare
minglumlu
pushed a commit
that referenced
this pull request
Dec 1, 2023
This enables PAM to be used in multithreaded mode (currently XAPI has a global lock around auth). Using an off-cpu flamegraph I identified that concurrent PAM calls are slow due to a call to `sleep(1)`. `pam_authenticate` calls `crypt_r` which calls `NSSLOW_Init` which on first use will try to initialize the just `dlopen`-ed library. If it encounters a race condition it does a `sleep(1)`. This race condition can be quite reliably reproduced when performing a lot of PAM authentications from multiple threads in parallel. GDB can also be used to confirm this by putting a breakpoint on `sleep`: ``` #0 __sleep (seconds=seconds@entry=1) at ../sysdeps/unix/sysv/linux/sleep.c:42 #1 0x00007ffff1548e22 in freebl_RunLoaderOnce () at lowhash_vector.c:122 xapi-project#2 0x00007ffff1548f31 in freebl_InitVector () at lowhash_vector.c:131 xapi-project#3 NSSLOW_Init () at lowhash_vector.c:148 xapi-project#4 0x00007ffff1b8f09a in __sha512_crypt_r (key=key@entry=0x7fffd8005a60 "pamtest-edvint", salt=0x7ffff31e17b8 "dIJbsXKc0", xapi-project#5 0x00007ffff1b8d070 in __crypt_r (key=key@entry=0x7fffd8005a60 "pamtest-edvint", salt=<optimized out>, xapi-project#6 0x00007ffff1dc9abc in verify_pwd_hash (p=p@entry=0x7fffd8005a60 "pamtest-edvint", hash=<optimized out>, nullok=nullok@entry=0) at passverify.c:111 xapi-project#7 0x00007ffff1dc9139 in _unix_verify_password (pamh=pamh@entry=0x7fffd8002910, name=0x7fffd8002ab0 "pamtest-edvint", p=0x7fffd8005a60 "pamtest-edvint", ctrl=ctrl@entry=8389156) at support.c:777 xapi-project#8 0x00007ffff1dc6556 in pam_sm_authenticate (pamh=0x7fffd8002910, flags=<optimized out>, argc=<optimized out>, argv=<optimized out>) at pam_unix_auth.c:178 xapi-project#9 0x00007ffff7bcef1a in _pam_dispatch_aux (use_cached_chain=<optimized out>, resumed=<optimized out>, h=<optimized out>, flags=1, pamh=0x7fffd8002910) at pam_dispatch.c:110 xapi-project#10 _pam_dispatch (pamh=pamh@entry=0x7fffd8002910, flags=1, choice=choice@entry=1) at pam_dispatch.c:426 xapi-project#11 0x00007ffff7bce7e0 in pam_authenticate (pamh=0x7fffd8002910, flags=flags@entry=1) at pam_auth.c:34 xapi-project#12 0x00000000005ae567 in XA_mh_authorize (username=username@entry=0x7fffd80028d0 "pamtest-edvint", password=password@entry=0x7fffd80028f0 "pamtest-edvint", error=error@entry=0x7ffff31e1be8) at xa_auth.c:83 xapi-project#13 0x00000000005adf20 in stub_XA_mh_authorize (username=<optimized out>, password=<optimized out>) at xa_auth_stubs.c:42 ``` `pam_start` and `pam_end` doesn't help here, because on `pam_end` the library is `dlclose`-ed, so on next `pam_authenticate` it will have to go through the initialization code again. (This initialization code would've belonged into `pam_start`, not `pam_authenticate`, but there are several layers here including a call to `crypt_r`). Upstream has fixed this problem >5 years ago by switching to libxcrypt instead. Signed-off-by: Edwin Török <edwin.torok@cloud.com>
minglumlu
pushed a commit
that referenced
this pull request
Jan 2, 2025
Backport of 3b52b72 This enables PAM to be used in multithreaded mode (currently XAPI has a global lock around auth). Using an off-cpu flamegraph I identified that concurrent PAM calls are slow due to a call to `sleep(1)`. `pam_authenticate` calls `crypt_r` which calls `NSSLOW_Init` which on first use will try to initialize the just `dlopen`-ed library. If it encounters a race condition it does a `sleep(1)`. This race condition can be quite reliably reproduced when performing a lot of PAM authentications from multiple threads in parallel. GDB can also be used to confirm this by putting a breakpoint on `sleep`: ``` #0 __sleep (seconds=seconds@entry=1) at ../sysdeps/unix/sysv/linux/sleep.c:42 #1 0x00007ffff1548e22 in freebl_RunLoaderOnce () at lowhash_vector.c:122 xapi-project#2 0x00007ffff1548f31 in freebl_InitVector () at lowhash_vector.c:131 xapi-project#3 NSSLOW_Init () at lowhash_vector.c:148 xapi-project#4 0x00007ffff1b8f09a in __sha512_crypt_r (key=key@entry=0x7fffd8005a60 "pamtest-edvint", salt=0x7ffff31e17b8 "dIJbsXKc0", xapi-project#5 0x00007ffff1b8d070 in __crypt_r (key=key@entry=0x7fffd8005a60 "pamtest-edvint", salt=<optimized out>, xapi-project#6 0x00007ffff1dc9abc in verify_pwd_hash (p=p@entry=0x7fffd8005a60 "pamtest-edvint", hash=<optimized out>, nullok=nullok@entry=0) at passverify.c:111 xapi-project#7 0x00007ffff1dc9139 in _unix_verify_password (pamh=pamh@entry=0x7fffd8002910, name=0x7fffd8002ab0 "pamtest-edvint", p=0x7fffd8005a60 "pamtest-edvint", ctrl=ctrl@entry=8389156) at support.c:777 xapi-project#8 0x00007ffff1dc6556 in pam_sm_authenticate (pamh=0x7fffd8002910, flags=<optimized out>, argc=<optimized out>, argv=<optimized out>) at pam_unix_auth.c:178 xapi-project#9 0x00007ffff7bcef1a in _pam_dispatch_aux (use_cached_chain=<optimized out>, resumed=<optimized out>, h=<optimized out>, flags=1, pamh=0x7fffd8002910) at pam_dispatch.c:110 xapi-project#10 _pam_dispatch (pamh=pamh@entry=0x7fffd8002910, flags=1, choice=choice@entry=1) at pam_dispatch.c:426 xapi-project#11 0x00007ffff7bce7e0 in pam_authenticate (pamh=0x7fffd8002910, flags=flags@entry=1) at pam_auth.c:34 xapi-project#12 0x00000000005ae567 in XA_mh_authorize (username=username@entry=0x7fffd80028d0 "pamtest-edvint", password=password@entry=0x7fffd80028f0 "pamtest-edvint", error=error@entry=0x7ffff31e1be8) at xa_auth.c:83 xapi-project#13 0x00000000005adf20 in stub_XA_mh_authorize (username=<optimized out>, password=<optimized out>) at xa_auth_stubs.c:42 ``` `pam_start` and `pam_end` doesn't help here, because on `pam_end` the library is `dlclose`-ed, so on next `pam_authenticate` it will have to go through the initialization code again. (This initialization code would've belonged into `pam_start`, not `pam_authenticate`, but there are several layers here including a call to `crypt_r`). Upstream has fixed this problem >5 years ago by switching to libxcrypt instead. Signed-off-by: Edwin Török <edwin.torok@cloud.com> Signed-off-by: Christian Lindig <christian.lindig@cloud.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.