def waitForVmwareVmx():
    """!
    Monitor vmware-vmx every 5 seconds to see if it is running
    """
    vmx_conf_file_path = "%s/esxi.vmx" % Vsp.get_esxi_dir()

    proc_id = Vsp.get_vmx_proc_id(vmx_conf_file_path)

    while Vsp.is_process_running(proc_id):
        Logging.log(Logging.LOG_DEBUG, "vmware-vmx is still running")
        time.sleep(5)

    #We are here means the process has exited
    Logging.log(Logging.LOG_DEBUG, "vmware-vmx is not running")
def monitor_vmware_vmx(proc_id):
    """!
    Monitor vmware-vmx every 0.5 seconds to see
    if it is running
    """
    
    while Vsp.is_process_running(proc_id):
        Logging.log(Logging.LOG_DEBUG, "vmware-vmx is running")   
        time.sleep(vmx_poll_time)
    
    #We are here means the process has exited   
    Logging.log(Logging.LOG_DEBUG, "vmware-vmx is not running") 

    # whenever vmware-vmx stops we want to unmount the ramfs
    # also before unmounting we want to save off the vix logs
    # in the vmware-admin directory
    shutdown_vsp_ramfs()

    # Clean up the "shutting down" file used for ESXi HPN dependency
    if os.path.exists(SHUTDOWN_MARKER):
        os.remove(SHUTDOWN_MARKER)

    if not g_shutdown_requested:
        sys.exit(1)