def state
state_id = nil
state_id = :not_created unless @machine.id
state_id = :not_created if
!state_id && (!@machine.id || !driver.created?(@machine.id))
state_id = driver.state(@machine) if @machine.id && !state_id
state_id = :unknown unless state_id
state_id = :preparing if @machine.id == 'preparing'
short = state_id.to_s.tr('_', ' ')
long = I18n.t("vagrant_libvirt.states.#{state_id}")
if state_id == :not_created
state_id = Vagrant::MachineState::NOT_CREATED_ID
end
Vagrant::MachineState.new(state_id, short, long)
end