Description of problem: At some situations, virt-tar-in/virt-tar-out/virt-copy-in/virt-copy-out will output some misunderstanding error messages due to the simple wrapper around the guestfish. I have wrote another simple wrapper to guestfish, it can improve this situation and give a proper error message. I have tested this version of wrapper, it works well, it can also used to virt-tar-out/virt-copy-in/virt-copy-out. Here is the new wrapper: base_name="$(basename $0)" requiredarg() { [ -z "$2" ] && { echo "$base_name: option requires an argument -- '${1//-/}'" >&2 echo "Try \`$base_name --help' for more information." >&2 exit } add_disk="$1 $2" ((args++)) } while [[ -n $1 ]]; do args=1 case "$1" in -h | --help ) exec man "$base_name" ;; -a | -d) requiredarg "$@" ;; -+ ) echo "$base_name: invalid option -- '${1//-/}'" >&2 echo "Try \`$base_name --help' for more information." >&2 exit ;; *) other_opts="$other_opts $1" ;; esac shift "$args" done [ -z "$add_disk" ] && { echo "$base_name: error: you must give either -a or -d options." >&2 echo "Try \`$base_name --help' for more information." >&2 exit } exec guestfish --rw -i $add_disk tar-in $other_opts Version-Release number of selected component (if applicable): libguestfs-tools-c-1.29.33-1.fc22.x86_64 How reproducible: 100% Steps to Reproduce: # virt-tar-in libguestfs: error: no libvirt domain called 'tar-in': Domain not found: no domain with matching name 'tar-in' # virt-tar-in Fedora-20.raw libguestfs: error: no libvirt domain called 'tar-in': Domain not found: no domain with matching name 'tar-in' # virt-tar-in -c guestfish: option requires an argument -- 'c' Try `guestfish --help' for more information. Actual results: As above Expected results: # virt-tar-in virt-tar-in: error: you must give either -a or -d options. Try `virt-tar-in --help' for more information. # virt-tar-in Fedora-20.raw virt-tar-in: error: you must give either -a or -d options. Try `virt-tar-in --help' for more information. # virt-tar-in -c virt-tar-in: error: you must give either -a or -d options. Try `virt-tar-in --help' for more information. Additional info:
Although this is better than what we've got right now, this: > *) > other_opts="$other_opts $1" doesn't quote the parameter correctly. For example it would fail if passed: virt-tar-in -a foo.img "Some File With A Space.tar" /bar The way around that is to use bash arrays ... bleahhh. Probably best to post a patch to the mailing list.
(In reply to Richard W.M. Jones from comment #1) > Although this is better than what we've got right now, this: > > > *) > > other_opts="$other_opts $1" > > doesn't quote the parameter correctly. For example it would fail > if passed: > > virt-tar-in -a foo.img "Some File With A Space.tar" /bar > > The way around that is to use bash arrays ... bleahhh. > > Probably best to post a patch to the mailing list. Sorry, i missed this situation, possible i will post a patch if the code is ready to use. Thanks!
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.