]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virrandom: Accept "nodedev" driver in virRandomGenerateWWN()
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 17 Jul 2023 13:05:11 +0000 (15:05 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 25 Jul 2023 12:54:37 +0000 (14:54 +0200)
commit3d9e35b8375c295b9dbebae0f18bea32b8e3ac77
tree827968068f1e8ccc5dc56881c99a7faa44127071
parentbaeefe03279dc4b39e19ae61153aad864f311254
virrandom: Accept "nodedev" driver in virRandomGenerateWWN()

The virRandomGenerateWWN() is used solely by nodedev driver to
autogenerate WWNN and WWNP when parsing a nodedev XML. Now, the
idea was (at least during monolithic daemon) that depending on
which hypervisor driver called the nodedev XML parsing (and
virRandomGenerateWWN() under the hood) the corresponding OUI is
used (e.g. "001a4a" for the QEMU driver).

But in era of split daemons things are not that easy. We do not
know which hypervisor driver called us. And there might be no
hypervisor driver at all - users are allowed to connect to
individual drivers directly (e.g. "nodedev:///system").

In this case, we can't use proper OUI. Well, do the next best
thing: pick one (QUMRANET_OUI).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/util/virrandom.c