On 20/10/15 15:31, Martin Lucina wrote:
Antti,

in commit 6435210 [1] you remove use of blkid for fs image type detection.
Is it a general policy that the rumprun launcher not depend on any
Linux/GNU/otherwise-not-available-everywhere tool?

Yes it's a policy to not needlessly break things. It's a different discussion if there is some non-trivial reason. For example, I wouldn't consider it too tragic if -enable-kvm doesn't work everywhere. Not that I'd worry too much about breaking platforms for which we don't have CI. If someone really cares about a platform, they'll set up CI for it, and then we can take it more seriously.

The reason I ask is because I was just about to commit the following change
to generate random MAC addresses for qemu/kvm:

--- a/app-tools/rumprun
+++ b/app-tools/rumprun
@@ -159,8 +159,10 @@ createif_qemu ()
         scratch="${1#*,}"
         ifbasename="${scratch%%,*}"
         qemuargs="${scratch#*,}"
+       # 52:54:00 is QEMU registered OUI
+       ifmac="52:54:00:$(dd if=/dev/urandom bs=512 count=1 2>/dev/null | md5sum | 
sed 's/^\(..\)\(..\)\(..\).*$/\1:\2:\3/')"

-       opt_netif="${opt_netif} -net nic,model=virtio ${qemuargs}"
+       opt_netif="${opt_netif} -net nic,model=virtio,mac=${ifmac} ${qemuargs}"
         eval ${iftag}2ifname=${ifbasename}${nindex}
         eval ${iftag}2cloner=false
         nindex=$(expr $nindex + 1)

The above does depend on md5sum, and I seem to recall discussing that
md5sum is not universally available?

Don't use non-standard md5sum then, use something standard like od -- /dev/urandom is already random so you don't need to hash it.

Besides, isn't it "macaddr", not "mac"?

Motivation for the change is that without it each qemu/kvm unikernel gets
the exact same MAC and is thus unusable in bridged configurations. Also,
it's consistent with the behaviour of "rumprun xen".

It's easy to argue that neither is the correct default, especially if you can't override it. That's just another argument against the rumprun launch tool.

Reply via email to