In a future patch, we shall support automatically converting a legacy
stream to a v2 stream, in which case libxc needs to read from a
different fd.
Simply overwriting restore_fd does not work; the two fd's have
different circumstances. The restore_fd needs to be returned to its
original state before libxl_domain_create_restore() returns, while in
the converted case, the fd needs allocating and deallocating
appropriately.
No functional change.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
---
New in v2
cdcs->dcs.guest_config = d_config;
libxl_domain_config_init(&cdcs->dcs.guest_config_saved);
libxl_domain_config_copy(ctx, &cdcs->dcs.guest_config_saved, d_config);
- cdcs->dcs.restore_fd = restore_fd;
+ cdcs->dcs.restore_fd = cdcs->dcs.libxc_fd = restore_fd;
if (restore_fd > -1)
cdcs->dcs.restore_params = *params;
cdcs->dcs.callback = domain_create_cb;
libxl__ao *ao;
libxl_domain_config *guest_config;
libxl_domain_config guest_config_saved; /* vanilla config */
- int restore_fd;
+ int restore_fd, libxc_fd;
libxl_domain_restore_params restore_params;
libxl__domain_create_cb *callback;
libxl_asyncprogress_how aop_console_how;
/* Convenience aliases */
const uint32_t domid = dcs->guest_domid;
- const int restore_fd = dcs->restore_fd;
+ const int restore_fd = dcs->libxc_fd;
libxl__domain_build_state *const state = &dcs->build_state;
unsigned cbflags = libxl__srm_callout_enumcallbacks_restore