// GetVMInfo get VM instance info by domain UUID
GetVMInfo get VM instance info by domain UUID
// GetVMInfo get VM instance info by domain UUID
func (vt *VMTool) GetVMInfo(domainID string) (*VMInfo, error) {
	domain, err := vt.conn.GetDomainByUUIDString(domainID)
	if err != nil {
		return nil, fmt.Errorf("failed to loop up domain(%q): %v", domainID, err)
	}
	uuid, err := domain.GetUUIDString()
	if err != nil {
		return nil, fmt.Errorf("failed to get domain's uuid: %v", err)
	}
	state, err := domain.GetState()
	if err != nil {
		return nil, fmt.Errorf("failed to get domain(%q) state: %v", uuid, err)
	}
	return &VMInfo{
		UUID:  uuid,
		State: state,
	}, nil
}
func ( vt * VMTool ) GetVMInfo ( domainID string ) ( * VMInfo , error ) { domain , err := vt . conn . GetDomainByUUIDString ( domainID ) if err != nil { return nil , fmt . Errorf ( " " , domainID , err ) } uuid , err := domain . GetUUIDString ( ) if err != nil { return nil , fmt . Errorf ( " " , err ) } state , err := domain . GetState ( ) if err != nil { return nil , fmt . Errorf ( " " , uuid , err ) } return & VMInfo { UUID : uuid , State : state , } , nil }
GetVMInfo get VM instance info by domain UUID
GetVMInfo get VM instance info by domain UUID