Re: [PATCHv1.5 23/27] qemu: snapshot: Add functions similar to disk source pool translation

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

 



On 26.11.2013 17:49, Peter Krempa wrote:
> To avoid future pain, add placeholder functions to get the actual
> snapshot disk type.
> ---
>  src/qemu/qemu_conf.c | 23 +++++++++++++++++++++++
>  src/qemu/qemu_conf.h |  6 ++++++
>  2 files changed, 29 insertions(+)
> 
> diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
> index 639e2ff..210608e 100644
> --- a/src/qemu/qemu_conf.c
> +++ b/src/qemu/qemu_conf.c
> @@ -1453,3 +1453,26 @@ cleanup:
>      virStoragePoolDefFree(pooldef);
>      return ret;
>  }
> +
> +
> +int
> +qemuSnapshotDiskGetActualType(virDomainSnapshotDiskDefPtr def)
> +{
> +    if (def->type == -1)
> +        return VIR_DOMAIN_DISK_TYPE_FILE;
> +
> +    return def->type;
> +}
> +
> +
> +int
> +qemuTranslateSnapshotDiskSourcePool(virConnectPtr conn ATTRIBUTE_UNUSED,
> +                                    virDomainSnapshotDiskDefPtr def)
> +{
> +    if (def->type != VIR_DOMAIN_DISK_TYPE_VOLUME)
> +        return 0;
> +
> +    virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
> +                   _("Snapshots are not yet supported with 'pool' volumes"));
> +    return -1;
> +}
> diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
> index b9786b1..0cb7901 100644
> --- a/src/qemu/qemu_conf.h
> +++ b/src/qemu/qemu_conf.h
> @@ -29,6 +29,7 @@
>  # include "capabilities.h"
>  # include "network_conf.h"
>  # include "domain_conf.h"
> +# include "snapshot_conf.h"
>  # include "domain_event.h"
>  # include "virthread.h"
>  # include "security/security_manager.h"
> @@ -309,4 +310,9 @@ int qemuDiskGetActualType(virDomainDiskDefPtr def);
>  int qemuTranslateDiskSourcePool(virConnectPtr conn,
>                                  virDomainDiskDefPtr def);
> 
> +int qemuSnapshotDiskGetActualType(virDomainSnapshotDiskDefPtr def);
> +
> +int qemuTranslateSnapshotDiskSourcePool(virConnectPtr conn,
> +                                        virDomainSnapshotDiskDefPtr def);
> +
>  #endif /* __QEMUD_CONF_H */
> 

ACK

Michal

--
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]