Commit 5ba8849e authored by Daniel P. Berrange's avatar Daniel P. Berrange

Add storage vol upload/download flag constants

Signed-off-by: 's avatarDaniel P. Berrange <berrange@redhat.com>
parent af51fe0b
......@@ -101,6 +101,18 @@ const (
STORAGE_VOL_GET_PHYSICAL = StorageVolInfoFlags(C.VIR_STORAGE_VOL_GET_PHYSICAL)
)
type StorageVolUploadFlags int
const (
STORAGE_VOL_UPLOAD_SPARSE_STREAM = StorageVolUploadFlags(C.VIR_STORAGE_VOL_UPLOAD_SPARSE_STREAM)
)
type StorageVolDownloadFlags int
const (
STORAGE_VOL_DOWNLOAD_SPARSE_STREAM = StorageVolDownloadFlags(C.VIR_STORAGE_VOL_DOWNLOAD_SPARSE_STREAM)
)
type StorageVol struct {
ptr C.virStorageVolPtr
}
......@@ -224,7 +236,7 @@ func (v *StorageVol) WipePattern(algorithm StorageVolWipeAlgorithm, flags uint32
return nil
}
func (v *StorageVol) Upload(stream *Stream, offset, length uint64, flags uint32) error {
func (v *StorageVol) Upload(stream *Stream, offset, length uint64, flags StorageVolUploadFlags) error {
if C.virStorageVolUpload(v.ptr, stream.ptr, C.ulonglong(offset),
C.ulonglong(length), C.uint(flags)) == -1 {
return GetLastError()
......@@ -232,7 +244,7 @@ func (v *StorageVol) Upload(stream *Stream, offset, length uint64, flags uint32)
return nil
}
func (v *StorageVol) Download(stream *Stream, offset, length uint64, flags uint32) error {
func (v *StorageVol) Download(stream *Stream, offset, length uint64, flags StorageVolDownloadFlags) error {
if C.virStorageVolDownload(v.ptr, stream.ptr, C.ulonglong(offset),
C.ulonglong(length), C.uint(flags)) == -1 {
return GetLastError()
......
......@@ -69,4 +69,14 @@ int virStorageVolGetInfoFlagsCompat(virStorageVolPtr vol,
#define VIR_STORAGE_VOL_PLOOP 5
#endif
/* 3.4.0 */
#ifndef VIR_STORAGE_VOL_UPLOAD_SPARSE_STREAM
#define VIR_STORAGE_VOL_UPLOAD_SPARSE_STREAM (1 << 0)
#endif
#ifndef VIR_STORAGE_VOL_DOWNLOAD_SPARSE_STREAM
#define VIR_STORAGE_VOL_DOWNLOAD_SPARSE_STREAM (1 << 0)
#endif
#endif /* LIBVIRT_GO_STORAGE_VOLUME_COMPAT_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment