From fe078c25982667c02e4cc6dc5b4792750910314a Mon Sep 17 00:00:00 2001 From: Jesse Gardner Date: Mon, 22 Mar 2021 19:10:05 -0700 Subject: [PATCH] Minor improvements documentation and use of lv_api_do --- man.md | 26 +++++++++++--------------- man.pandoc | 4 ++-- qq2clone | 2 +- qq2clone.1 | 23 ++++++++--------------- 4 files changed, 22 insertions(+), 33 deletions(-) diff --git a/man.md b/man.md index c7a9488..b315800 100644 --- a/man.md +++ b/man.md @@ -31,7 +31,7 @@ requires: Bash 4.0+ qemu-img - libvirt tools: + libvirt tools: virt-clone virt-xml virt-xml-validate @@ -280,10 +280,10 @@ OTHER COMMANDS As described in the limitations section, there are ways that qq2clone can lose track of a clone. If this happens, it will remain in qq2clone’s database, its ID number will remain reserved, and its image files may -not be deleted and take up space doing nothing. the **check** command -tries to find and fix this and other problems. The *TEMPLATE-NAME* -argument is optional, and restricts the check to that template and its -clones. Otherwise, all templates are checked +not be deleted and take up space doing nothing. The **check** command +finds and fixes occurences of this problem. The *TEMPLATE-NAME* argument +is optional, and restricts the check to that template and its clones. +Otherwise, all templates are checked **config** list, **config** info \[*OPTION*\], **config** edit \[*OPTION*\] List all configuration options and their current value, get info about a @@ -428,16 +428,12 @@ reason that the default directory storage-qq2clone does not start with ‘.’ If the UUID of a clone is changed, qq2clone will no longer be able to -track it and will not be able to perform commands on it anymore. If -virsh undefine is run on a clone, qq2clone will not be able to see it -once it is turned off. This limitation will be eliminated or reduced in -the future, when qq2clone moves away from relying on virsh and -implements direct usage of the libvirt API. It could be addressed now by -using transient domains, but that would require qq2clone to do more -things manually instead of just invoking virsh. Since the plan is to -transition to a different approach later, that would be wasted effort. -For now, if you find yourself in this position just use **qq2clone** -check. +track it and will not be able to perform commands on it anymore. This +will be addressed in the future using custom metadata in the libvirt +domain XML. If the user undefines a domain, this will obviously cause it +to disappear from qq2clone’s perspective when it is turned off, creating +a discrepancy in its database. This can be fixed with **qq2clone** +**check**. qq2clone can only produce clones by making qcow2 image files. The backing file need not be qcow2, but the images produced by qq2clone diff --git a/man.pandoc b/man.pandoc index d5dda61..df50337 100644 --- a/man.pandoc +++ b/man.pandoc @@ -271,8 +271,8 @@ domains, their state will be restored : As described in the limitations section, there are ways that qq2clone can lose track of a clone. If this happens, it will remain in qq2clone's database, its ID number will remain reserved, and its image files may not -be deleted and take up space doing nothing. the **check** command tries to -find and fix this and other problems. The *TEMPLATE-NAME* argument is +be deleted and take up space doing nothing. The **check** command +finds and fixes occurences of this problem. The *TEMPLATE-NAME* argument is optional, and restricts the check to that template and its clones. Otherwise, all templates are checked diff --git a/qq2clone b/qq2clone index fe0272f..94be292 100755 --- a/qq2clone +++ b/qq2clone @@ -175,7 +175,7 @@ read -r check <&3 local line while read -r line <&3; do [[ "$line" == "EOF" ]] && break - write_pipe 0 "${line:1}" + echo "$line" >&3 done return 0 diff --git a/qq2clone.1 b/qq2clone.1 index d178bd1..c3e0137 100644 --- a/qq2clone.1 +++ b/qq2clone.1 @@ -35,7 +35,7 @@ requires: \f[C] Bash 4.0+ qemu\-img -libvirt tools: +libvirt tools: virt\-clone virt\-xml virt\-xml\-validate @@ -302,8 +302,7 @@ can lose track of a clone. If this happens, it will remain in qq2clone\[cq]s database, its ID number will remain reserved, and its image files may not be deleted and take up space doing nothing. -the \f[B]check\f[R] command tries to find and fix this and other -problems. +The \f[B]check\f[R] command finds and fixes occurences of this problem. The \f[I]TEMPLATE\-NAME\f[R] argument is optional, and restricts the check to that template and its clones. Otherwise, all templates are checked @@ -483,18 +482,12 @@ the default directory storage\-qq2clone does not start with `.' .PP If the UUID of a clone is changed, qq2clone will no longer be able to track it and will not be able to perform commands on it anymore. -If virsh undefine is run on a clone, qq2clone will not be able to see it -once it is turned off. -This limitation will be eliminated or reduced in the future, when -qq2clone moves away from relying on virsh and implements direct usage of -the libvirt API. -It could be addressed now by using transient domains, but that would -require qq2clone to do more things manually instead of just invoking -virsh. -Since the plan is to transition to a different approach later, that -would be wasted effort. -For now, if you find yourself in this position just use -\f[B]qq2clone\f[R] check. +This will be addressed in the future using custom metadata in the +libvirt domain XML. +If the user undefines a domain, this will obviously cause it to +disappear from qq2clone\[cq]s perspective when it is turned off, +creating a discrepancy in its database. +This can be fixed with \f[B]qq2clone\f[R] \f[B]check\f[R]. .PP qq2clone can only produce clones by making qcow2 image files. The backing file need not be qcow2, but the images produced by qq2clone