|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH for-4.6 1/2] libxl: fix devd removal path
Roger Pau Monne writes ("[PATCH for-4.6 1/2] libxl: fix devd removal path"):
> The current flow of the devd helper (in charge of launching hotplug scripts
> inside of driver domains) is to wait for the device backend to switch to
> state 6 (XenbusStateClosed) and then remove it. This is not correct, since
> a domain can reconnect it's PV devices as many times as it wants.
Oops. Thanks for investigating.
> + p = strstr(path, "/state");
> + if (p != NULL) {
> + *p = '\0';
> + } else {
> + p = strstr(path, "/online");
> + if (p == NULL)
> + goto skip;
> + *p = '\0';
> + }
I don't think this is correct. You could use strrstr, I guess. But
it would probably be better to strrchr '/' and then strcmp the result
with /online and/or /state ?
> + rc = libxl__xs_write_checked(gc, t, online_path, "0");
> + if (rc) {
> + LOG(ERROR, "unable to write to xenstore path %s", online_path);
> + goto out;
libxl__xs_write_checked logs on error so this is redundant (I
appreciate that it was there before...)
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |