Re: [PATCH 4/8] save: add --direct flag to virsh save operations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 14, 2011 at 08:24:31AM -0600, Eric Blake wrote:
> Wire up the new flag to virsh.  Also, the 'dump' command had
> undocumented flags.
> 
> * tools/virsh.c (cmdSave, cmdManagedSave, cmdDump): Add new flag.
> * tools/virsh.pod (save, managedsave, dump): Document flags.
> ---
>  tools/virsh.c   |   12 ++++++++++--
>  tools/virsh.pod |   17 ++++++++++++++---
>  2 files changed, 24 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/virsh.c b/tools/virsh.c
> index bd6fea7..01c5b39 100644
> --- a/tools/virsh.c
> +++ b/tools/virsh.c
> @@ -1530,6 +1530,7 @@ static const vshCmdInfo info_save[] = {
>  };
> 
>  static const vshCmdOptDef opts_save[] = {
> +    {"direct", VSH_OT_BOOL, 0, N_("use O_DIRECT when saving")},


My question about flag naming also applies here

> -    if (virDomainSave(dom, to) == 0) {
> +    if ((direct ? virDomainSaveFlags(dom, to, NULL, VIR_DOMAIN_SAVE_DIRECT)
> +         : virDomainSave(dom, to)) == 0) {

Nit pick, for checking return values I prefr '< 0' or '>= 0' rather
than '== 0'

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]