
On Mon, Feb 06, 2023 at 10:16:56 +0100, Michal Privoznik wrote:
When handling virConnectOpen(), we parse given URI, specifically all those parameters we know, like ?mode, ?socket, ?name, etc. ignoring those we don't recognize yet. Then, we reconstruct the URI back, but ignoring all parameters we've parsed. In other words:
qemu:///system?mode=legacy&foo=bar
becomes:
qemu:///system?foo=bar
The reconstructed URI is then passed to the corresponding driver (QEMU in our example) with intent of it parsing parameters further (or just ignoring them).
Did you mean to put all the explanation above into the patch that is going to modify it? Here it doesn't make much sense as ....
Now, this URI reconstruction is currently implemented in an else branch. Move it into a separate function so that it can be re-used.
... this patch simply moves the code doing the URI construction, where you can't se what's actually happening to the parameters into a new helper.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/remote/remote_driver.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-)
Reviewed-by: Peter Krempa <pkrempa@redhat.com>