-
Notifications
You must be signed in to change notification settings - Fork 15
Windows Xenstore Support #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
I probably should have mentioned that failure cases are not well tested yet:) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think importing ctypes.wintypes qualified might improve readability:
from ctypes import wintypes
foo(wintypes.BOOL)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A copy of the code from the serial example, as with the other piece below it could be changed if preferred.
|
Overall, the Windows-specific code seems really complicated. Maybe we can simplify it somehow? |
|
@superbobry - Thank you for the quick review:) I will take some time to incorporate your suggestions on to my branch as soon as possible along with anything else that reveals itself once I've run through tests for my application. I was unable to find an native implementation of these API calls in pywin32 so a lot of the code is about importing the API directly from the relevant DLL and creating structures suitable for use with that. Since this is the first time I've ever done this sort of thing it was a bit of a brute force cut & paste hack job based on the serial example and it might need someone with more experience to comment on the possibility of simplifying this. |
…e xenbus device occurs.
Conflicts: pyxs/connection.py
…y URL to the GPLPV mercurial tree.
…to over time this leaks memory if multiple instances of the connection class get created. To avoid this once the device path has been discovered cache the value and resuse that for every future invocation.
…hey can be a little unreliable
… windows version.
…he project drivers rather than guess by operating system version.
|
Hi, sorry for taking so long to get to this. Is there a spec. for accessing XenStore on Windows? I do hope there's a more consistent (with Linux) way of approaching the issue. |
|
The fork on my account now has support for both the GPLPV and the WinPV driver projects. The original support for GPLPV uses the Windows API to open a connection to the xenbus which is then used exactly the same as under Linux. It is quite complicated because of how the xenbus device is identified and opened but essentially the same code as done in the block driver. The WinPV project exposes xenstore through WMI so we have created a bridge to that in PyXS. There are currently some issues in how the WinPV driver handles empty strings in xenstore as it returns them as None rather than "". This has been raised on the WinPV mailing list. |
|
This sounds very exciting. However, I'm not sure I could maintain this code as part of Here's what I propose instead:
What do you think? P.S. As of 0.4.0 you need a router = Router(CustomConnectionClass())
with pyxs.Client(router=router) as c:
# ... |
|
I did a quick googling and failed to locate any developer documentation for GPLPV and WinPV drivers. How did you work out how to use these? |
The check operation essentially does an fsck of the xenstore tdb database which is expensive. A small xenstore patch can be used to introduce a noop control function and it is preferable to use that. No operation should be necessary here but the implementation of the wait() is wrong in this branch. The upstream release handles this correctly but the change would be quite intrusive.
|
I had a go at implementing this as suggested in a separate module (entirely based on the work here) and was able to get a version which works with the current version of pyxs. There are some rough edges still and it's possible that some features are not working correctly but reading keys/listing directories is definitely fully functional. There's no documentation or tests currently but I plan to sort that out, hopefully over the coming week! The repo is located here: https://github.com/joelnb/win-pyxs |
Hi,
This branch allows PyXS to work on Windows in combination with the GPLPV drivers. The tested environment is:
Windows 2008R2
GPLPV 0.11.0.3
Python 2.7.6
pywin32-218.win-amd64-py2.7
The modified code was successfully tested on Windows and Linux with: