Commit 84c220c6 authored by Paul John King's avatar Paul John King

Completed socket/core/thread changes --

parent 4139de87
......@@ -517,7 +517,7 @@ The command call
${0##*/} create volume [-x] «name» «pool» «path»
creates a qcow2 storage volume with the name \`«name»\` in the storage pool
\`«pool»\` with the qcow2 file-system image at the path \`«path»\` as its
\`«pool»\` and the qcow2 file-system image at the path \`«path»\` as its
backing storage volume. The \`-x\` option outputs to standard output the
\`libvirt\` XML that would be used to create the volume, but does not create
it.
......@@ -813,8 +813,7 @@ verify_domain(){
test "${DOMAIN_CORE_COUNT}" = "${_CORE_COUNT}" &&
test "${DOMAIN_THREAD_COUNT}" = "${_THREAD_COUNT}" &&
test "${DOMAIN_RAM}" = $((_RAM * 1024)) &&
test "${DOMAIN_PATH}" = "${_PATH}" &&
test "${DOMAIN_BRIDGE}" = "${_BRIDGE}"
test "${DOMAIN_PATH}" = "${_PATH}"
then
return 0 ;
else
......@@ -880,7 +879,7 @@ The command call
${0##*/} examine domain «name»
outputs the CPU socket, core and thread counts, the RAM, the RAM units and a
outputs the CPU socket, core and thread counts, the RAM, the RAM units, and a
path to the file-system image of the KVM domain with the name \`«name»\` as
Bourne-shell variable assignments (suitable for shell evaluation) and returns
......@@ -920,7 +919,6 @@ __END_OF_STDIN__
# TODO: Update and document these.
create_machine(){
local _xml_only=false ;
......@@ -967,15 +965,16 @@ create_machine(){
done ;
shift $(( OPTIND - 1 )) ;
if test $# -eq 6 ;
if test $# -eq 7 ;
then
local _NAME="${1}" ;
local _SOCKET_COUNT="${2}" ;
local _CORE_COUNT="${3}" ;
local _THREAD_COUNT="${4}" ;
local _RAM="${5}" ;
local _PATH="${6}" ;
shift 6 ;
local _POOL="${6}" ;
local _PATH="${7}" ;
shift 7 ;
else
echo "The number of command-line arguments is invalid." >&2 ;
echo "" >&2 ;
......@@ -983,13 +982,24 @@ create_machine(){
return 127 ;
fi ;
local _POOL_DATA ;
_POOL_DATA=$(examine_pool "${_POOL}") && eval "${_POOL_DATA}" ;
if test $? -ne 0 ;
then
echo "The pool '${_POOL}' does not exist." >&2 ;
echo "" >&2 ;
help_machine >&2 ;
return 127 ;
fi ;
if ${_xml_only} ;
then
create_volume -x "${_NAME}" "default" "${_PATH}" || return 1 ;
create_domain -x${_domain_options}"${_NAME}" "${_SOCKET_COUNT}" "${_CORE_COUNT}" "${_THREAD_COUNT}" "${_RAM}" "«a path to the ${_NAME} volume»" || return 1 ;
create_volume -x "${_NAME}" "${_POOL}" "${_PATH}" || return 1 ;
create_domain -x${_domain_options}"${_NAME}" "${_SOCKET_COUNT}" "${_CORE_COUNT}" "${_THREAD_COUNT}" "${_RAM}" "${POOL_PATH}/${_NAME}" || return 1 ;
else
create_volume "${_NAME}" "default" "${_PATH}" || return 1 ;
create_domain${_domain_options}"${_NAME}" "${_SOCKET_COUNT}" "${_CORE_COUNT}" "${_THREAD_COUNT}" "${_RAM}" $(get_image_path "${_NAME}" "default") || return 1 ;
create_volume "${_NAME}" "${_POOL}" "${_PATH}" || return 1 ;
create_domain${_domain_options}"${_NAME}" "${_SOCKET_COUNT}" "${_CORE_COUNT}" "${_THREAD_COUNT}" "${_RAM}" "${POOL_PATH}/${_NAME}" || return 1 ;
fi ;
return 0 ;
......@@ -1026,14 +1036,16 @@ examine_machine(){
verify_machine(){
if test $# -eq 4 ;
if test $# -eq 7 ;
then
local _NAME="${1}" ;
local _CPU_COUNT="${2}" ;
local _RAM="${3}" ;
local _PATH="${4}" ;
local _BRIDGE="${5}" ;
shift 4 ;
local _SOCKET_COUNT="${2}" ;
local _CORE_COUNT="${3}" ;
local _THREAD_COUNT="${4}" ;
local _RAM="${5}" ;
local _POOL="${6}"
local _BACKING_PATH="${7}" ;
shift 7 ;
else
echo "The number of command-line arguments is invalid." >&2 ;
echo "" >&2 ;
......@@ -1041,15 +1053,19 @@ verify_machine(){
return 127 ;
fi ;
local _PATH ;
local _PARAMETERS ;
_PATH=$(get_image_path "${_NAME}" "${_POOL}") || return 2 ;
_PARAMETERS=$(examine_machine "${_NAME}") || return 2 ;
eval "${_PARAMETERS}" || return 1 ;
if \
test "${DOMAIN_CPU_COUNT}" = "${_CPU_COUNT}" &&
test "${DOMAIN_SOCKET_COUNT}" = "${_SOCKET_COUNT}" &&
test "${DOMAIN_CORE_COUNT}" = "${_CORE_COUNT}" &&
test "${DOMAIN_THREAD_COUNT}" = "${_THREAD_COUNT}" &&
test "${DOMAIN_RAM}" = $((_RAM * 1024)) &&
test "${DOMAIN_BACKING_PATH}" = "${_PATH}" &&
test "${DOMAIN_BRIDGE}" = "${_BRIDGE}"
test "${DOMAIN_PATH}" = "${_PATH}"
test "${DOMAIN_BACKING_PATH}" = "${_BACKING_PATH}"
then
return 0 ;
else
......@@ -1099,18 +1115,13 @@ Machine Commands
The command call
${0##*/} create machine [-x] [-c «connection_1»] ... [-c «connection_n»] «name» «cpu» «ram» «path»
where «cpu» is
${0##*/} create machine [-x] [-c «connection_1»] ... [-c «connection_n»] «name» «socket_count» «core_count» «thread_count» «ram» «pool» «path»
«sockets»[,«cores»[,«threads»]]
creates a KVM domain with the name \`«name»\`, \`«socket_count»\` CPU sockets
with optionally \`«core_count»\` cores per socket (1 if not specified) and
\`«thread_count»\` threads per core (1 if not specified), \`«ram»\` MiB of RAM
and a qcow2 storage volume with the name \`«name»\` in the \`default\` storage
pool with the qcow2 file-system image at the path \`«path»\` as its backing
storage volume. The option
creates a KVM domain with the name \`«name»\`, \`«socket_count»\` CPU sockets,
\`«core_count»\` cores per CPU socket, \`«thread_count»\` threads per core,
\`«ram»\` MiB of RAM, and a qcow2 storage volume with the name \`«name»\` in
the storage pool \`«pool»\` and the qcow2 file-system image at the path
\`«path»\` as its backing storage volume. The option
-c «bridge»[,«ipv4_address»]
......@@ -1124,10 +1135,10 @@ The command call
${0##*/} examine machine «name»
outputs the CPU count, the RAM, the RAM units, a path to the file-system image,
and a path to the backing file-sytem image of the KVM domain with the name
\`«name»\` as Bourne-shell variable assignments (suitable for shell evaluation)
and returns
outputs the CPU socket, core and thread counts, the RAM, the RAM units, and
paths to the file-system image and the backing file-sytem image of the KVM
domain with the name \`«name»\` as Bourne-shell variable assignments (suitable
for shell evaluation) and returns
- 0 if the domain exists, and
......@@ -1135,14 +1146,15 @@ and returns
The command call
${0##*/} verify machine «name» «cpu_count» «ram» «path»
${0##*/} verify machine «name» «socket_count» «core_count» «thread_count» «ram» «pool» «path»
returns
- 0 if a KVM domain with the name \`«name»\`, \`«cpu_count»\` CPUs, \`«ram»\`
MiB of RAM and a qcow2 storage volume with the name \`«name»\` in the
\`default\` storage pool with the qcow2 file-system image at the path
\`«path»\` as its backing storage volume
- 0 if a KVM domain with the name \`«name»\`, \`«socket_count»\` CPU sockets,
\`«core_count»\` cores per CPU socket, \`«thread_count»\` threads per core,
\`«ram»\` MiB of RAM, and a qcow2 storage volume with the name \`«name»\` in
the storage pool \`«pool»\` with the qcow2 file-system image at the path
\`«path»\` as its backing storage volume exists,
- 1 if a KVM domain with the name \`«name»\` but other parameters exists, and
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment