Commit e64927c7 authored by Paul John King's avatar Paul John King

Report disk cache mode when examining a domain

parent 3c512043
......@@ -185,7 +185,8 @@ tries to output
DOMAIN_RAM='«domain_ram»'
DOMAIN_RAM_UNIT='«domain_ram_unit»'
DOMAIN_RAM_KIB='«domain_ram_kib»'
DOMAIN_STATE='«doamin_state»'
DOMAIN_DISK_CACHE_MODE='«domain_disk_cache_mode»'
DOMAIN_STATE='«domain_state»'
DOMAIN_AUTOSTART:'«domain_autostart»'
VOLUME_NAME='«volume»'
VOLUME_PATH='«volume_path»'
......@@ -204,6 +205,9 @@ to standard output, for the domain with the name `«domain»`, where
* `«domain_ram_kib»` is the RAM the domain has (in KiB) if
`«domain_ram_unit»` is KiB, MiB, GiB or TiB, the empty string otherwise,
* `«domain_disk_cache_mode»` is the disk cache mode of the domain's storage
volume if defined, the empty string otherwise,
* `«domain_state»` is the state the domain is in,
* `«domain_autostart»` is true iff the domain is marked for autostart,
......
......@@ -757,6 +757,7 @@ examine_domain(){
local _RAM ;
local _RAM_UNIT ;
local _PATH ;
local _DISK_CACHE_MODE ;
local _VOLUME ;
local _ram_kib ;
......@@ -774,6 +775,7 @@ examine_domain(){
_THREAD_COUNT=$(_get_value_by_tag_and_attribute_from_xml "${_CPU_XML}" "topology" "threads") || return 2 ;
_RAM=$(_get_content_by_tag_from_xml "${_DOMAIN_XML}" "memory") || return 2 ;
_RAM_UNIT=$(_get_value_by_tag_and_attribute_from_xml "${_DOMAIN_XML}" "memory" "unit") || return 2 ;
_DISK_CACHE_MODE=$(_get_value_by_tag_and_attribute_from_xml "${_DISK_VDA_XML}" "driver" "cache") || return 2 ;
_PATH=$(_get_value_by_tag_and_attribute_from_xml "${_DISK_VDA_XML}" "source" "file") || return 2 ;
_VOLUME=$(virsh vol-name "${_PATH}") || return 2 ;
......@@ -821,6 +823,7 @@ examine_domain(){
echo "DOMAIN_RAM='${_RAM}'" ;
echo "DOMAIN_RAM_UNIT='${_RAM_UNIT}'" ;
echo "DOMAIN_RAM_KIB='${_ram_kib}'" ;
echo "DOMAIN_DISK_CACHE_MODE='${_DISK_CACHE_MODE}'" ;
echo "DOMAIN_STATE='${_state}'" ;
echo "DOMAIN_AUTOSTART='${_autostart}'" ;
examine_volume "${_VOLUME}" || return 2 ;
......@@ -893,7 +896,8 @@ tries to output
DOMAIN_RAM='«domain_ram»'
DOMAIN_RAM_UNIT='«domain_ram_unit»'
DOMAIN_RAM_KIB='«domain_ram_kib»'
DOMAIN_STATE='«doamin_state»'
DOMAIN_DISK_CACHE_MODE='«domain_disk_cache_mode»'
DOMAIN_STATE='«domain_state»'
DOMAIN_AUTOSTART:'«domain_autostart»'
VOLUME_NAME='«volume»'
VOLUME_PATH='«volume_path»'
......@@ -912,6 +916,9 @@ to standard output, for the domain with the name \`«domain»\`, where
* \`«domain_ram_kib»\` is the RAM the domain has (in KiB) if
\`«domain_ram_unit»\` is KiB, MiB, GiB or TiB, the empty string otherwise,
* \`«domain_disk_cache_mode»\` is the disk cache mode of the domain's storage
volume if defined, the empty string otherwise,
* \`«domain_state»\` is the state the domain is in,
* \`«domain_autostart»\` is true iff the domain is marked for autostart,
......
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