• Andre Przywara's avatar
    list: Clean up ghost socket files · 67f9f7b7
    Andre Przywara authored
    When kvmtool (or the host kernel) crashes or gets killed, we cannot
    automatically remove the socket file we created for that VM.
    A later call of "lkvm list" iterates over all those files and complains
    about those "ghost socket files", as there is no one listening on
    the other side. Also sometimes the automatic guest name generation
    happens to generate the same name again, so an unrelated "lkvm run"
    later complains and stops, which is bad for automation.
    As the only code doing a listen() on this socket is kvmtool upon VM
    *creation*, such an orphaned socket file will never come back to life,
    so we can as well unlink() those sockets in the code. This spares the
    user from doing it herself.
    We keep the message in the code to notify the user of this.
    Signed-off-by: Andre Przywara's avatarAndre Przywara <andre.przywara@arm.com>
    Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>