mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
qemu_driver.c: use virConnectValidateURIPath()
Reviewed-by: Cole Robinson <crobinso@redhat.com> Suggested-by: Cole Robinson <crobinso@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
f69af572b3
commit
f372c27592
@ -1295,22 +1295,10 @@ static virDrvOpenStatus qemuConnectOpen(virConnectPtr conn,
|
||||
return VIR_DRV_OPEN_ERROR;
|
||||
}
|
||||
|
||||
if (virQEMUDriverIsPrivileged(qemu_driver)) {
|
||||
if (STRNEQ(conn->uri->path, "/system") &&
|
||||
STRNEQ(conn->uri->path, "/session")) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unexpected QEMU URI path '%s', try qemu:///system"),
|
||||
conn->uri->path);
|
||||
if (!virConnectValidateURIPath(conn->uri->path,
|
||||
"qemu",
|
||||
virQEMUDriverIsPrivileged(qemu_driver)))
|
||||
return VIR_DRV_OPEN_ERROR;
|
||||
}
|
||||
} else {
|
||||
if (STRNEQ(conn->uri->path, "/session")) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unexpected QEMU URI path '%s', try qemu:///session"),
|
||||
conn->uri->path);
|
||||
return VIR_DRV_OPEN_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
if (virConnectOpenEnsureACL(conn) < 0)
|
||||
return VIR_DRV_OPEN_ERROR;
|
||||
|
Loading…
x
Reference in New Issue
Block a user