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

Re: [libvirt] [PATCH 6/8] UndefineFlags: Implement libxl driver handling



On 07/13/2011 04:19 AM, Osier Yang wrote:
> ---
>  src/libxl/libxl_driver.c |   32 ++++++++++++++++++++++++++++----
>  1 files changed, 28 insertions(+), 4 deletions(-)
> 
> diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
> index 808480f..f04931b 100644
> --- a/src/libxl/libxl_driver.c
> +++ b/src/libxl/libxl_driver.c
> @@ -220,10 +220,8 @@ libxlDoNodeGetInfo(libxlDriverPrivatePtr driver, virNodeInfoPtr info)
>  static char *
>  libxlDomainManagedSavePath(libxlDriverPrivatePtr driver, virDomainObjPtr vm) {
>      char *ret;
> -    char uuidstr[VIR_UUID_STRING_BUFLEN];
> -    virUUIDFormat(vm->def->uuid, uuidstr);
>  
> -    if (virAsprintf(&ret, "%s/%s.save", driver->saveDir, uuidstr) < 0) {
> +    if (virAsprintf(&ret, "%s/%s.save", driver->saveDir, vm->def->name) < 0) {

Same rebase problem as in 5/8.

> + 
> +    if (flags & VIR_DOMAIN_UNDEFINE_MANAGED_STATE) {
> +        name = libxlDomainManagedSavePath(driver, vm);
> +
> +        if (name == NULL)
> +            goto cleanup;
> +
> +        if (virFileExists(name) && (unlink(name) < 0)) {
> +            libxlError(VIR_ERR_INTERNAL_ERROR,
> +                       _("failed on removing domain managed state "
> +                       "file '%s'"), name);
> +            goto cleanup;
> +        }
> +    }

Same logic problem as in 5/8.

-- 
Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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