Skip to content
  • Ian Jackson's avatar
    libxl: react correctly to bootloader pty master POLLHUP · d7ab695c
    Ian Jackson authored
    
    
    Receive POLLHUP on the bootloader master pty is not an error.
    Hopefully it means that the bootloader has exited and therefore the
    pty slave side has no process group any more.  (At least NetBSD
    indicates POLLHUP on the master in this case.)
    
    So send the bootloader SIGTERM; if it has already exited then this has
    no effect (except that on some versions of NetBSD it erroneously
    returns ESRCH and we print a harmless warning) and we will then
    collect the bootloader's exit status and be satisfied.
    
    However, we remember that we have done this so that if we got POLLHUP
    for some other reason than that the bootloader exited we report
    something resembling a useful message.
    
    In order to implement this we need to provide a way for users of
    datacopier to handle POLLHUP rather than treating it as fatal.
    
    We rename bootloader_abort to bootloader_stop since it now no longer
    only applies to error situations.
    
    Signed-off-by: default avatarRoger Pau Monne <roger.pau@citrix.com>
    Signed-off-by: default avatarIan Jackson <ian.jackson@eu.citrix.com>
    Acked-by: default avatarIan Campbell <ian.campbell@citrix.com>
    Committed-by: default avatarIan Campbell <ian.campbell@citrix.com>
    d7ab695c