Bug 1046905 - RFE: add argument to virt-sysprep to disable individual default operations
Summary: RFE: add argument to virt-sysprep to disable individual default operations
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Pino Toscano
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-27 10:58 UTC by Dominic Cleal
Modified: 2014-01-13 14:27 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-13 14:27:10 UTC
Embargoed:


Attachments (Terms of Use)

Description Dominic Cleal 2013-12-27 10:58:15 UTC
Description of problem:
virt-sysprep either runs with all default operations or a selected list of operations with the --enable argument.  A few times I've found I'd like to use the default list, but minus one or two operations in particular, however there's no easy way to specify this.

A --disable argument that took the default operation list and skipped selected operations would be useful.

Version-Release number of selected component (if applicable):
libguestfs-tools-1.22.7-4.fc19.x86_64

Comment 1 Richard W.M. Jones 2014-01-02 12:58:43 UTC
Note this is possible already by running this non-obvious command:

ops=`virt-sysprep --list-operations | fgrep ' * ' | grep -v tmp-files | awk -vORS=, '{print $1}' | sed 's/,$/\n/'`
virt-sysprep --enable $ops -a disk.img

(runs all default operations except tmp-files)

Pino can have a look at this, as a low priority.

The reason this wasn't implemented initially is that
it's not clear what the semantics are when people start
to use multiple --disable and --enable options, or use
both options together, or they think that order matters.

Likely any attempt to use multiple --enable and/or --disable
options should be rejected.

Comment 2 Dominic Cleal 2014-01-02 14:16:39 UTC
Yes, I've been doing something similar, but it's not terribly elegant.  Having --enable/disable options be exclusive would be perfectly acceptable for me.

Comment 3 Pino Toscano 2014-01-13 14:27:10 UTC
This is fixed with
https://github.com/libguestfs/libguestfs/commit/efb5f1841524ec75d765368b447270b8a3aff8ac
which is in libguestfs >= 1.25.21.

Basically (back to Richard's example in #c2) now you can do:
  virt-sysprep --operations defaults,-tmp-files ...
to execute all the default operations (i.e. those that would be executed specifying no --enable/--operations) minus the tmp-files one.


Note You need to log in before you can comment on or make changes to this bug.