core: improve guest type detection

/cc @fgrehm - I figured you might be interested in this. :)