[Libvir] PATCH: 7/16: virsh core commands
Daniel P. Berrange
berrange at redhat.com
Mon Feb 18 16:01:34 UTC 2008
On Mon, Feb 18, 2008 at 06:12:47AM -0500, Daniel Veillard wrote:
> > +static int
> > +cmdPoolDelete(vshControl * ctl, vshCmd * cmd)
> > +{
> > + virStoragePoolPtr pool;
> > + int ret = TRUE;
> > + char *name;
> > +
> > + if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
> > + return FALSE;
> > +
> > + if (!(pool = vshCommandOptPool(ctl, cmd, "pool", &name)))
> > + return FALSE;
> > +
> > + if (virStoragePoolDelete(pool, 0) == 0) {
> > + vshPrint(ctl, _("Pool %s deleteed\n"), name);
> > + } else {
> > + vshError(ctl, FALSE, _("Failed to delete pool %s"), name);
> > + ret = FALSE;
> > + virStoragePoolFree(pool);
> > + }
> > +
> > + return ret;
> > +}
>
> just wondering, assuming the Delete operation really destroys on-disk
> storage and potentially a large set, shouldn't we add some kind of
> interactive confirmation ? Contrary to destroying a domain where state
> is preserved on the disk and rather easy to recover and destroying a network
> which has very little state, maybe here we need to do something special,
> optionally adding a -f flag to bypass confirmation like in rm.
Well the 'rm' command doesn't do confirmation by default. It only
asks for confirmation if you add the '-i' flag. The '-f' flag lets you
them override the '-i' flag.
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules: http://search.cpan.org/~danberr/ -=|
|=- Projects: http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
More information about the libvir-list
mailing list