|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v16 2/7] remus: introduce remus device
Hi Ian, There're two comments left that I wanted to comment further on. Apart from this two comments, I think I have addressed all your comments on v16, but before I send a v18 out, Shriram and I will have more detailed review on it, in case I have missed some of your comments. My latest working tree that we will review on is hosted at github: https://github.com/macrosheep/xen/tree/remus-v17.6 Refer to the latest 10 commits. What I think is the big changes compared to v16: - Merge match() and setup() api. - Reuse libxl__multidev and libxl__ao_device NOTE: branches which has `draft` in the name may not compile, and you can simply ignore it. branches which has version number like remus-vXX is compilable and well tested, you can keep on track on those versions, especially the latest version makes sense. On 07/16/2014 07:46 PM, Ian Jackson wrote:
I intend to keep this *kind* because I will use them for filter out
what kind of device the remus abstract layer need to handle.
take the code v17.6(refer to above link) as an example:
typedef enum libxl__remus_device_kind {
LIBXL__REMUS_DEVICE_NIC = (1 << 0),
LIBXL__REMUS_DEVICE_DISK = (1 << 1),
} libxl__remus_device_kind;
there's a flag in remus devices state(which I will call rds below):
struct libxl__remus_devices_state {
...
int device_kind_flags;
...
}
and this flag will be set by upper layer(remus save/restore) depend
on the comand switch:
int libxl_domain_remus_start(libxl_ctx *ctx, libxl_domain_remus_info *info,
uint32_t domid, int send_fd, int recv_fd,
const libxl_asyncop_how *ao_how)
{
...
if (info->netbuf) {
if (!libxl__netbuffer_enabled(gc)) {
LOG(ERROR, "Remus: No support for network buffering");
goto out;
}
rds->device_kind_flags |= LIBXL__REMUS_DEVICE_NIC;
}
if (info->diskbuf)
rds->device_kind_flags |= LIBXL__REMUS_DEVICE_DISK;
...
}
so that I can determine what kind of device I need to handle in
remus abstract layer without had to know command switch related things.
I think the fact that the abstract layer need to know what the command
switch is causes layer violation...
void libxl__remus_devices_setup(libxl__egc *egc, libxl__remus_devices_state
*rds)
{
...
if (rds->device_kind_flags & LIBXL__REMUS_DEVICE_NIC)
rds->nics = libxl_device_nic_list(CTX, rds->domid, &rds->num_nics);
if (rds->device_kind_flags & LIBXL__REMUS_DEVICE_DISK)
rds->disks = libxl_device_disk_list(CTX, rds->domid, &rds->num_disks);
...
}
a subkind init()/cleanup() only need to be called once per Remus instance. there're cases that this subkind is used for multiple devices, it we don't seperate it out, it will be called many times. I agree that I can make it capable to be called multiple times, but I think that's not what the design is. it is not supposed to be idempotent I think. and I think separate it makes the logic more comprehensive. Thanks, Yang -- Thanks, Yang. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |