Patchwork [29/41] savevm: Remove qemu_fseek()

login
register
mail settings
Submitter Juan Quintela
Date Sept. 21, 2012, 8:47 a.m.
Message ID <1348217255-22441-30-git-send-email-quintela@redhat.com>
Download mbox | patch
Permalink /patch/185669/
State New
Headers show

Comments

Juan Quintela - Sept. 21, 2012, 8:47 a.m.
It has no users, and is only half implemented.

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 qemu-file.h |  1 -
 savevm.c    | 21 ---------------------
 2 files changed, 22 deletions(-)
Paolo Bonzini - Sept. 21, 2012, 12:46 p.m.
Il 21/09/2012 10:47, Juan Quintela ha scritto:
> It has no users, and is only half implemented.
> 
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
>  qemu-file.h |  1 -
>  savevm.c    | 21 ---------------------
>  2 files changed, 22 deletions(-)
> 
> diff --git a/qemu-file.h b/qemu-file.h
> index d8487cd..7fe7274 100644
> --- a/qemu-file.h
> +++ b/qemu-file.h
> @@ -232,6 +232,5 @@ static inline void qemu_get_sbe64s(QEMUFile *f, int64_t *pv)
>  }
> 
>  int64_t qemu_ftell(QEMUFile *f);
> -int64_t qemu_fseek(QEMUFile *f, int64_t pos, int whence);
> 
>  #endif
> diff --git a/savevm.c b/savevm.c
> index 1ec6ff1..6865862 100644
> --- a/savevm.c
> +++ b/savevm.c
> @@ -676,27 +676,6 @@ int64_t qemu_ftell(QEMUFile *f)
>      return f->buf_offset - f->buf_size + f->buf_index;
>  }
> 
> -int64_t qemu_fseek(QEMUFile *f, int64_t pos, int whence)
> -{
> -    if (whence == SEEK_SET) {
> -        /* nothing to do */
> -    } else if (whence == SEEK_CUR) {
> -        pos += qemu_ftell(f);
> -    } else {
> -        /* SEEK_END not supported */
> -        return -1;
> -    }
> -    if (f->put_buffer) {
> -        qemu_fflush(f);
> -        f->buf_offset = pos;
> -    } else {
> -        f->buf_offset = pos;
> -        f->buf_index = 0;
> -        f->buf_size = 0;
> -    }
> -    return pos;
> -}
> -
>  int qemu_file_rate_limit(QEMUFile *f)
>  {
>      if (f->rate_limit)
> 

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

Patch

diff --git a/qemu-file.h b/qemu-file.h
index d8487cd..7fe7274 100644
--- a/qemu-file.h
+++ b/qemu-file.h
@@ -232,6 +232,5 @@  static inline void qemu_get_sbe64s(QEMUFile *f, int64_t *pv)
 }

 int64_t qemu_ftell(QEMUFile *f);
-int64_t qemu_fseek(QEMUFile *f, int64_t pos, int whence);

 #endif
diff --git a/savevm.c b/savevm.c
index 1ec6ff1..6865862 100644
--- a/savevm.c
+++ b/savevm.c
@@ -676,27 +676,6 @@  int64_t qemu_ftell(QEMUFile *f)
     return f->buf_offset - f->buf_size + f->buf_index;
 }

-int64_t qemu_fseek(QEMUFile *f, int64_t pos, int whence)
-{
-    if (whence == SEEK_SET) {
-        /* nothing to do */
-    } else if (whence == SEEK_CUR) {
-        pos += qemu_ftell(f);
-    } else {
-        /* SEEK_END not supported */
-        return -1;
-    }
-    if (f->put_buffer) {
-        qemu_fflush(f);
-        f->buf_offset = pos;
-    } else {
-        f->buf_offset = pos;
-        f->buf_index = 0;
-        f->buf_size = 0;
-    }
-    return pos;
-}
-
 int qemu_file_rate_limit(QEMUFile *f)
 {
     if (f->rate_limit)