Xen queue

- fix guest creation when -xen-domid-restrict is used.
 - fix Xen PV guest creation.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEE+AwAYwjiLP2KkueYDPVXL9f7Va8FAmQdubMACgkQDPVXL9f7
 Va/bhQgA75nw4DB5LxIQLe+G/mLEvpf79Kg5lQNZ8gn84ms1zhGUWvS179xg/mT5
 F+JvVhOLMihJpWnaoiWaQQmE9VydzllHQHMZFdK0QNpVWm9l/xrw0hEkLsBMA/RS
 1t2w90gLa4iDH9E0O7xWCTDLdTN5pbCmTMBJ2m3a8OYuV2/y0nYtxazU8vHpkn6V
 6Td2cY8OKuUf14UW1hY5nqGb6SMpNTzmcnW3jAYveVBZx+BE5ALKaGo2+nCIJ6oH
 wlQ9a7UsUwLCrIxcSXytDH1kRa+zBhQPVsedeoA08eIZsBhSbH/AD3TNxipTHv0o
 jBlyXbZCjNiFe8sLi077Cvb1fiCAiQ==
 =Pc9Y
 -----END PGP SIGNATURE-----

Merge tag 'pull-xen-20230324' of https://xenbits.xen.org/git-http/people/aperard/qemu-dm into staging

Xen queue

- fix guest creation when -xen-domid-restrict is used.
- fix Xen PV guest creation.

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCgAdFiEE+AwAYwjiLP2KkueYDPVXL9f7Va8FAmQdubMACgkQDPVXL9f7
# Va/bhQgA75nw4DB5LxIQLe+G/mLEvpf79Kg5lQNZ8gn84ms1zhGUWvS179xg/mT5
# F+JvVhOLMihJpWnaoiWaQQmE9VydzllHQHMZFdK0QNpVWm9l/xrw0hEkLsBMA/RS
# 1t2w90gLa4iDH9E0O7xWCTDLdTN5pbCmTMBJ2m3a8OYuV2/y0nYtxazU8vHpkn6V
# 6Td2cY8OKuUf14UW1hY5nqGb6SMpNTzmcnW3jAYveVBZx+BE5ALKaGo2+nCIJ6oH
# wlQ9a7UsUwLCrIxcSXytDH1kRa+zBhQPVsedeoA08eIZsBhSbH/AD3TNxipTHv0o
# jBlyXbZCjNiFe8sLi077Cvb1fiCAiQ==
# =Pc9Y
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 24 Mar 2023 14:54:43 GMT
# gpg:                using RSA key F80C006308E22CFD8A92E7980CF5572FD7FB55AF
# gpg: Good signature from "Anthony PERARD <anthony.perard@gmail.com>" [marginal]
# gpg:                 aka "Anthony PERARD <anthony.perard@citrix.com>" [marginal]
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 5379 2F71 024C 600F 778A  7161 D8D5 7199 DF83 42C8
#      Subkey fingerprint: F80C 0063 08E2 2CFD 8A92  E798 0CF5 572F D7FB 55AF

* tag 'pull-xen-20230324' of https://xenbits.xen.org/git-http/people/aperard/qemu-dm:
  hw/xenpv: Initialize Xen backend operations
  accel/xen: Fix DM state change notification in dm_restrict mode

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2023-03-24 16:08:29 +00:00
commit d82e2e7635
2 changed files with 12 additions and 17 deletions

View File

@ -32,28 +32,13 @@ xendevicemodel_handle *xen_dmod;
static void xenstore_record_dm_state(const char *state)
{
struct xs_handle *xs;
char path[50];
/* We now have everything we need to set the xenstore entry. */
xs = xs_open(0);
if (xs == NULL) {
fprintf(stderr, "Could not contact XenStore\n");
exit(1);
}
snprintf(path, sizeof (path), "device-model/%u/state", xen_domid);
/*
* This call may fail when running restricted so don't make it fatal in
* that case. Toolstacks should instead use QMP to listen for state changes.
*/
if (!xs_write(xs, XBT_NULL, path, state, strlen(state)) &&
!xen_domid_restrict) {
if (!qemu_xen_xs_write(xenstore, XBT_NULL, path, state, strlen(state))) {
error_report("error recording dm state");
exit(1);
}
xs_close(xs);
}
@ -111,7 +96,15 @@ static int xen_init(MachineState *ms)
xc_interface_close(xen_xc);
return -1;
}
qemu_add_vm_change_state_handler(xen_change_state_handler, NULL);
/*
* The XenStore write would fail when running restricted so don't attempt
* it in that case. Toolstacks should instead use QMP to listen for state
* changes.
*/
if (!xen_domid_restrict) {
qemu_add_vm_change_state_handler(xen_change_state_handler, NULL);
}
/*
* opt out of system RAM being allocated by generic code
*/

View File

@ -35,6 +35,8 @@ static void xen_init_pv(MachineState *machine)
DriveInfo *dinfo;
int i;
setup_xen_backend_ops();
/* Initialize backend core & drivers */
xen_be_init();