Hi all, I was working on trying to add blockdev-add compatibility for the nfs block driver but before that runtime options need to be separated into various options rather than just a simple "filename" option.
I have added the following until now: a) host b) port (not sure about this one, do we just use a default port number?) c) export d) path (path to the file) I have matched these with the URI but still let me know if i have missed anyone :) Now, in order to parse the uri for different runtime options, I have made two new functions nfs_parse_filename() and nfs_parse_uri() which is pretty similar to the way how other network block drivers do it. Currently we parse the uri in a nfs_client_open() function which takes 'const char *filename' as one of its parameters but I dont think that's the right way anymore because we pass 'qemu_opt_get(opts, "filename")' which is invalid due to no runtime option named "filename" available anymore. Right? While parsing uri we check for the query parameters inside a 'for loop', so I have moved that too inside nfs_parse_uri(const char *filename, QDict *options, Error **errp) but the problem is there is no struct NFSClient parameter here, so I cannot fill up its important fields while parsing the query parameters. I cannot do the same inside nfs_client_open() because I no longer parse the uri over there.....OR CAN I? A completely different approach will work too :) I can attach a pastebin link containing a raw patch if you want to get a clear view but I am afraid it doesn't compile at the moment due to the problems mentioned above. Any help will be appreciated. Thanks for reading Ashijeet