[libvirt] [PATCH] virsh: Check for existence of storage before undefining the domain

Eric Blake eblake at redhat.com
Mon Jul 23 21:23:41 UTC 2012


On 06/22/2012 09:21 AM, Peter Krempa wrote:
> When undefining a domain and removing associated storage using "virsh
> undefine --storage" the domain was at first undefined and after that the
> storage removal proces was started. If the user specified an invalid
> disk to remove, the error could not be corrected.
> 
> This patch moves enumeration and filtering of volumes that should be
> removed before the domain is undefined, but the removal process is still
> kept after the domain has been undefined.
> ---
>  tools/virsh.c |  280 +++++++++++++++++++++++++++++----------------------------
>  1 files changed, 144 insertions(+), 136 deletions(-)

Sounds big, but the description is accurate on what is really changing.

> 
> diff --git a/tools/virsh.c b/tools/virsh.c
> index 0354822..e6b8e5f 100644
> --- a/tools/virsh.c
> +++ b/tools/virsh.c
> @@ -3007,6 +3007,12 @@ static const vshCmdOptDef opts_undefine[] = {
>      {NULL, 0, 0, NULL}
>  };
> 
> +typedef struct {
> +    virStorageVolPtr vol;
> +    char *source;
> +    char *target;
> +} vshUndefineVolume;

This struct might be useful elsewhere later on, but we can rename it at
that point.  Of course, you'll have some conflicts depending on when
this goes in, in relation to Osier's patches to split virsh.c.

ACK

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120723/a144137f/attachment-0001.sig>


More information about the libvir-list mailing list