# Shutdown domain:
virsh shutdown <domain>
# Increase max memory:
virsh setmaxmem <domain> 4G --config
# Increase memory:
virsh setmem <domain> 4G --config
# ---
# Set max vcpu:
virsh setvcpus --domain <domain> --maximum 2 --config
# Set vcpu:
virsh setvcpus --domain <domain> --count 2 --config
# Restart domain:
virsh start <domain>