
On 11/15/12 00:20, Eric Blake wrote:
On 11/14/2012 11:43 AM, Eric Blake wrote:
Bleah. Raw XML parsing. Wouldn't it be easier in and cleaner convert this piece code to use the XML parser and xpath?
Not the first time we've done this. I agree that using the XML parser and xpath is probably nicer, but it actually takes more code than a simple strstr.
The code looks OK in what it should be doing, but I don't like the raw XML parse-hacking stuff. The only reason to put this in as-is would be if it would be really complicated/overheading to use xpath here.
I'll post an interdiff that shows what it would take to use xpath, and we can decide based on how nice or ugly it looks.
Here's the diff; any decisions on whether to go with xpath?
tools/virsh-snapshot.c | 61 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 21 deletions(-)
I definitely like the xpath version better. Peter