* [Qemu-devel] [PATCH 1/5] migration: Remove unused functions
2015-02-19 17:12 [Qemu-devel] [PATCH v2 0/5] Remove unused functions Thomas Huth
@ 2015-02-19 17:12 ` Thomas Huth
2015-02-24 9:28 ` Amit Shah
2015-02-19 17:12 ` [Qemu-devel] [PATCH 2/5] ui: Removed " Thomas Huth
` (4 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Thomas Huth @ 2015-02-19 17:12 UTC (permalink / raw)
To: qemu-trivial, qemu-devel; +Cc: Amit Shah, Thomas Huth, Juan Quintela
dup_mig_bytes_transferred(), skipped_mig_bytes_transferred(),
migrate_rdma_pin_all(), qsb_clone() and qsb_set_length()
are completely unused and thus can be deleted.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Cc: Juan Quintela <quintela@redhat.com>
Cc: Amit Shah <amit.shah@redhat.com>
---
arch_init.c | 10 -------
include/migration/migration.h | 3 --
include/migration/qemu-file.h | 2 -
migration/migration.c | 9 -------
migration/qemu-file-buf.c | 53 -----------------------------------------
5 files changed, 0 insertions(+), 77 deletions(-)
diff --git a/arch_init.c b/arch_init.c
index 89c8fa4..ad5ce28 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -249,21 +249,11 @@ static void acct_clear(void)
memset(&acct_info, 0, sizeof(acct_info));
}
-uint64_t dup_mig_bytes_transferred(void)
-{
- return acct_info.dup_pages * TARGET_PAGE_SIZE;
-}
-
uint64_t dup_mig_pages_transferred(void)
{
return acct_info.dup_pages;
}
-uint64_t skipped_mig_bytes_transferred(void)
-{
- return acct_info.skipped_pages * TARGET_PAGE_SIZE;
-}
-
uint64_t skipped_mig_pages_transferred(void)
{
return acct_info.skipped_pages;
diff --git a/include/migration/migration.h b/include/migration/migration.h
index f37348b..7f6cdaa 100644
--- a/include/migration/migration.h
+++ b/include/migration/migration.h
@@ -115,9 +115,7 @@ void free_xbzrle_decoded_buf(void);
void acct_update_position(QEMUFile *f, size_t size, bool zero);
-uint64_t dup_mig_bytes_transferred(void);
uint64_t dup_mig_pages_transferred(void);
-uint64_t skipped_mig_bytes_transferred(void);
uint64_t skipped_mig_pages_transferred(void);
uint64_t norm_mig_bytes_transferred(void);
uint64_t norm_mig_pages_transferred(void);
@@ -143,7 +141,6 @@ void migrate_add_blocker(Error *reason);
*/
void migrate_del_blocker(Error *reason);
-bool migrate_rdma_pin_all(void);
bool migrate_zero_blocks(void);
bool migrate_auto_converge(void);
diff --git a/include/migration/qemu-file.h b/include/migration/qemu-file.h
index a923cec..45d7f71 100644
--- a/include/migration/qemu-file.h
+++ b/include/migration/qemu-file.h
@@ -133,9 +133,7 @@ bool qemu_file_mode_is_not_valid(const char *mode);
bool qemu_file_is_writable(QEMUFile *f);
QEMUSizedBuffer *qsb_create(const uint8_t *buffer, size_t len);
-QEMUSizedBuffer *qsb_clone(const QEMUSizedBuffer *);
void qsb_free(QEMUSizedBuffer *);
-size_t qsb_set_length(QEMUSizedBuffer *qsb, size_t length);
size_t qsb_get_length(const QEMUSizedBuffer *qsb);
ssize_t qsb_get_buffer(const QEMUSizedBuffer *, off_t start, size_t count,
uint8_t *buf);
diff --git a/migration/migration.c b/migration/migration.c
index b3adbc6..6f1a490 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -540,15 +540,6 @@ void qmp_migrate_set_downtime(double value, Error **errp)
max_downtime = (uint64_t)value;
}
-bool migrate_rdma_pin_all(void)
-{
- MigrationState *s;
-
- s = migrate_get_current();
-
- return s->enabled_capabilities[MIGRATION_CAPABILITY_RDMA_PIN_ALL];
-}
-
bool migrate_auto_converge(void)
{
MigrationState *s;
diff --git a/migration/qemu-file-buf.c b/migration/qemu-file-buf.c
index e97e0bd..3b79c09 100644
--- a/migration/qemu-file-buf.c
+++ b/migration/qemu-file-buf.c
@@ -124,28 +124,6 @@ size_t qsb_get_length(const QEMUSizedBuffer *qsb)
}
/**
- * Set the length of the buffer; the primary usage of this
- * function is to truncate the number of used bytes in the buffer.
- * The size will not be extended beyond the current number of
- * allocated bytes in the QEMUSizedBuffer.
- *
- * @qsb: A QEMUSizedBuffer
- * @new_len: The new length of bytes in the buffer
- *
- * Returns the number of bytes the buffer was truncated or extended
- * to.
- */
-size_t qsb_set_length(QEMUSizedBuffer *qsb, size_t new_len)
-{
- if (new_len <= qsb->size) {
- qsb->used = new_len;
- } else {
- qsb->used = qsb->size;
- }
- return qsb->used;
-}
-
-/**
* Get the iovec that holds the data for a given position @pos.
*
* @qsb: A QEMUSizedBuffer
@@ -361,37 +339,6 @@ ssize_t qsb_write_at(QEMUSizedBuffer *qsb, const uint8_t *source,
return count;
}
-/**
- * Create a deep copy of the given QEMUSizedBuffer.
- *
- * @qsb: A QEMUSizedBuffer
- *
- * Returns a clone of @qsb or NULL on allocation failure
- */
-QEMUSizedBuffer *qsb_clone(const QEMUSizedBuffer *qsb)
-{
- QEMUSizedBuffer *out = qsb_create(NULL, qsb_get_length(qsb));
- size_t i;
- ssize_t res;
- off_t pos = 0;
-
- if (!out) {
- return NULL;
- }
-
- for (i = 0; i < qsb->n_iov; i++) {
- res = qsb_write_at(out, qsb->iov[i].iov_base,
- pos, qsb->iov[i].iov_len);
- if (res < 0) {
- qsb_free(out);
- return NULL;
- }
- pos += res;
- }
-
- return out;
-}
-
typedef struct QEMUBuffer {
QEMUSizedBuffer *qsb;
QEMUFile *file;
--
1.7.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] [PATCH 1/5] migration: Remove unused functions
2015-02-19 17:12 ` [Qemu-devel] [PATCH 1/5] migration: " Thomas Huth
@ 2015-02-24 9:28 ` Amit Shah
2015-02-24 16:28 ` Thomas Huth
0 siblings, 1 reply; 13+ messages in thread
From: Amit Shah @ 2015-02-24 9:28 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-trivial, qemu-devel, Juan Quintela
On (Thu) 19 Feb 2015 [18:12:19], Thomas Huth wrote:
> dup_mig_bytes_transferred(), skipped_mig_bytes_transferred(),
> migrate_rdma_pin_all(), qsb_clone() and qsb_set_length()
> are completely unused and thus can be deleted.
>
> Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
> Cc: Juan Quintela <quintela@redhat.com>
> Cc: Amit Shah <amit.shah@redhat.com>
> ---
> arch_init.c | 10 -------
> include/migration/migration.h | 3 --
> include/migration/qemu-file.h | 2 -
> migration/migration.c | 9 -------
> migration/qemu-file-buf.c | 53 -----------------------------------------
> 5 files changed, 0 insertions(+), 77 deletions(-)
>
> diff --git a/arch_init.c b/arch_init.c
> index 89c8fa4..ad5ce28 100644
> --- a/arch_init.c
> +++ b/arch_init.c
> @@ -249,21 +249,11 @@ static void acct_clear(void)
> memset(&acct_info, 0, sizeof(acct_info));
> }
>
> -uint64_t dup_mig_bytes_transferred(void)
> -{
> - return acct_info.dup_pages * TARGET_PAGE_SIZE;
> -}
> -
> uint64_t dup_mig_pages_transferred(void)
> {
> return acct_info.dup_pages;
> }
>
> -uint64_t skipped_mig_bytes_transferred(void)
> -{
> - return acct_info.skipped_pages * TARGET_PAGE_SIZE;
> -}
These could be used for reporting; Juan, any idea why these aren't
used?
Rest of the patch is fine.
Amit
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] [PATCH 1/5] migration: Remove unused functions
2015-02-24 9:28 ` Amit Shah
@ 2015-02-24 16:28 ` Thomas Huth
2015-03-02 6:44 ` Amit Shah
0 siblings, 1 reply; 13+ messages in thread
From: Thomas Huth @ 2015-02-24 16:28 UTC (permalink / raw)
To: Amit Shah; +Cc: qemu-trivial, qemu-devel, Juan Quintela
On Tue, 24 Feb 2015 14:58:29 +0530
Amit Shah <amit.shah@redhat.com> wrote:
> On (Thu) 19 Feb 2015 [18:12:19], Thomas Huth wrote:
> > dup_mig_bytes_transferred(), skipped_mig_bytes_transferred(),
> > migrate_rdma_pin_all(), qsb_clone() and qsb_set_length()
> > are completely unused and thus can be deleted.
> >
> > Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
> > Cc: Juan Quintela <quintela@redhat.com>
> > Cc: Amit Shah <amit.shah@redhat.com>
> > ---
> > arch_init.c | 10 -------
> > include/migration/migration.h | 3 --
> > include/migration/qemu-file.h | 2 -
> > migration/migration.c | 9 -------
> > migration/qemu-file-buf.c | 53 -----------------------------------------
> > 5 files changed, 0 insertions(+), 77 deletions(-)
> >
> > diff --git a/arch_init.c b/arch_init.c
> > index 89c8fa4..ad5ce28 100644
> > --- a/arch_init.c
> > +++ b/arch_init.c
> > @@ -249,21 +249,11 @@ static void acct_clear(void)
> > memset(&acct_info, 0, sizeof(acct_info));
> > }
> >
> > -uint64_t dup_mig_bytes_transferred(void)
> > -{
> > - return acct_info.dup_pages * TARGET_PAGE_SIZE;
> > -}
> > -
> > uint64_t dup_mig_pages_transferred(void)
> > {
> > return acct_info.dup_pages;
> > }
> >
> > -uint64_t skipped_mig_bytes_transferred(void)
> > -{
> > - return acct_info.skipped_pages * TARGET_PAGE_SIZE;
> > -}
>
> These could be used for reporting; Juan, any idea why these aren't
> used?
Since they are very trivial, I think they could easily be re-added
again in case they are needed again in the future.
Or if you prefer, I can also rework my patch so that these two
functions won't get deleted.
Thomas
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] [PATCH 1/5] migration: Remove unused functions
2015-02-24 16:28 ` Thomas Huth
@ 2015-03-02 6:44 ` Amit Shah
0 siblings, 0 replies; 13+ messages in thread
From: Amit Shah @ 2015-03-02 6:44 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-trivial, qemu-devel, Juan Quintela
On (Tue) 24 Feb 2015 [17:28:36], Thomas Huth wrote:
> On Tue, 24 Feb 2015 14:58:29 +0530
> Amit Shah <amit.shah@redhat.com> wrote:
>
> > On (Thu) 19 Feb 2015 [18:12:19], Thomas Huth wrote:
> > > dup_mig_bytes_transferred(), skipped_mig_bytes_transferred(),
> > > migrate_rdma_pin_all(), qsb_clone() and qsb_set_length()
> > > are completely unused and thus can be deleted.
> > >
> > > Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
> > > Cc: Juan Quintela <quintela@redhat.com>
> > > Cc: Amit Shah <amit.shah@redhat.com>
> > > ---
> > > arch_init.c | 10 -------
> > > include/migration/migration.h | 3 --
> > > include/migration/qemu-file.h | 2 -
> > > migration/migration.c | 9 -------
> > > migration/qemu-file-buf.c | 53 -----------------------------------------
> > > 5 files changed, 0 insertions(+), 77 deletions(-)
> > >
> > > diff --git a/arch_init.c b/arch_init.c
> > > index 89c8fa4..ad5ce28 100644
> > > --- a/arch_init.c
> > > +++ b/arch_init.c
> > > @@ -249,21 +249,11 @@ static void acct_clear(void)
> > > memset(&acct_info, 0, sizeof(acct_info));
> > > }
> > >
> > > -uint64_t dup_mig_bytes_transferred(void)
> > > -{
> > > - return acct_info.dup_pages * TARGET_PAGE_SIZE;
> > > -}
> > > -
> > > uint64_t dup_mig_pages_transferred(void)
> > > {
> > > return acct_info.dup_pages;
> > > }
> > >
> > > -uint64_t skipped_mig_bytes_transferred(void)
> > > -{
> > > - return acct_info.skipped_pages * TARGET_PAGE_SIZE;
> > > -}
> >
> > These could be used for reporting; Juan, any idea why these aren't
> > used?
>
> Since they are very trivial, I think they could easily be re-added
> again in case they are needed again in the future.
> Or if you prefer, I can also rework my patch so that these two
> functions won't get deleted.
I'm just asking Juan if he knows why these are around; I don't mind if
we get rid of them, but good to get confirmation from Juan (else we
needlessly end up churning code).
Amit
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 2/5] ui: Removed unused functions
2015-02-19 17:12 [Qemu-devel] [PATCH v2 0/5] Remove unused functions Thomas Huth
2015-02-19 17:12 ` [Qemu-devel] [PATCH 1/5] migration: " Thomas Huth
@ 2015-02-19 17:12 ` Thomas Huth
2015-02-23 7:19 ` Gerd Hoffmann
2015-02-19 17:12 ` [Qemu-devel] [PATCH 3/5] ui/vnc: Remove vnc_stop_worker_thread() Thomas Huth
` (3 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Thomas Huth @ 2015-02-19 17:12 UTC (permalink / raw)
To: qemu-trivial, qemu-devel; +Cc: Thomas Huth, Anthony Liguori, Gerd Hoffmann
Remove qemu_console_displaystate(), qemu_remove_kbd_event_handler(),
qemu_different_endianness_pixelformat() and cpkey(), since they are
completely unused.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Cc: Anthony Liguori <aliguori@amazon.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
---
include/ui/console.h | 3 ---
ui/console.c | 12 ------------
ui/d3des.c | 9 ---------
ui/d3des.h | 6 ------
ui/input-legacy.c | 6 ------
5 files changed, 0 insertions(+), 36 deletions(-)
diff --git a/include/ui/console.h b/include/ui/console.h
index 8a4d671..7c3b5d4 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -36,7 +36,6 @@ typedef struct QEMUPutLEDEntry QEMUPutLEDEntry;
QEMUPutKbdEntry *qemu_add_kbd_event_handler(QEMUPutKBDEvent *func,
void *opaque);
-void qemu_remove_kbd_event_handler(QEMUPutKbdEntry *entry);
QEMUPutMouseEntry *qemu_add_mouse_event_handler(QEMUPutMouseEvent *func,
void *opaque, int absolute,
const char *name);
@@ -194,7 +193,6 @@ DisplaySurface *qemu_create_displaysurface_guestmem(int width, int height,
pixman_format_code_t format,
int linesize,
uint64_t addr);
-PixelFormat qemu_different_endianness_pixelformat(int bpp);
PixelFormat qemu_default_pixelformat(int bpp);
DisplaySurface *qemu_create_displaysurface(int width, int height);
@@ -322,7 +320,6 @@ void qemu_console_resize(QemuConsole *con, int width, int height);
void qemu_console_copy(QemuConsole *con, int src_x, int src_y,
int dst_x, int dst_y, int w, int h);
DisplaySurface *qemu_console_surface(QemuConsole *con);
-DisplayState *qemu_console_displaystate(QemuConsole *console);
/* sdl.c */
void sdl_display_init(DisplayState *ds, int full_screen, int no_frame);
diff --git a/ui/console.c b/ui/console.c
index 87574a7..87af6b5 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -2005,18 +2005,6 @@ DisplaySurface *qemu_console_surface(QemuConsole *console)
return console->surface;
}
-DisplayState *qemu_console_displaystate(QemuConsole *console)
-{
- return console->ds;
-}
-
-PixelFormat qemu_different_endianness_pixelformat(int bpp)
-{
- pixman_format_code_t fmt = qemu_default_pixman_format(bpp, false);
- PixelFormat pf = qemu_pixelformat_from_pixman(fmt);
- return pf;
-}
-
PixelFormat qemu_default_pixelformat(int bpp)
{
pixman_format_code_t fmt = qemu_default_pixman_format(bpp, true);
diff --git a/ui/d3des.c b/ui/d3des.c
index 60c840e..5bc99b8 100644
--- a/ui/d3des.c
+++ b/ui/d3des.c
@@ -121,15 +121,6 @@ static void cookey(register unsigned long *raw1)
return;
}
-void cpkey(register unsigned long *into)
-{
- register unsigned long *from, *endp;
-
- from = KnL, endp = &KnL[32];
- while( from < endp ) *into++ = *from++;
- return;
- }
-
void usekey(register unsigned long *from)
{
register unsigned long *to, *endp;
diff --git a/ui/d3des.h b/ui/d3des.h
index 70cb6b5..773667e 100644
--- a/ui/d3des.h
+++ b/ui/d3des.h
@@ -36,12 +36,6 @@ void usekey(unsigned long *);
* Loads the internal key register with the data in cookedkey.
*/
-void cpkey(unsigned long *);
-/* cookedkey[32]
- * Copies the contents of the internal key register into the storage
- * located at &cookedkey[0].
- */
-
void des(unsigned char *, unsigned char *);
/* from[8] to[8]
* Encrypts/Decrypts (according to the key currently loaded in the
diff --git a/ui/input-legacy.c b/ui/input-legacy.c
index a698a34..2d4ca19 100644
--- a/ui/input-legacy.c
+++ b/ui/input-legacy.c
@@ -143,12 +143,6 @@ QEMUPutKbdEntry *qemu_add_kbd_event_handler(QEMUPutKBDEvent *func, void *opaque)
return entry;
}
-void qemu_remove_kbd_event_handler(QEMUPutKbdEntry *entry)
-{
- qemu_input_handler_unregister(entry->s);
- g_free(entry);
-}
-
static void legacy_mouse_event(DeviceState *dev, QemuConsole *src,
InputEvent *evt)
{
--
1.7.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 3/5] ui/vnc: Remove vnc_stop_worker_thread()
2015-02-19 17:12 [Qemu-devel] [PATCH v2 0/5] Remove unused functions Thomas Huth
2015-02-19 17:12 ` [Qemu-devel] [PATCH 1/5] migration: " Thomas Huth
2015-02-19 17:12 ` [Qemu-devel] [PATCH 2/5] ui: Removed " Thomas Huth
@ 2015-02-19 17:12 ` Thomas Huth
2015-02-23 7:19 ` Gerd Hoffmann
2015-02-19 17:12 ` [Qemu-devel] [PATCH 4/5] util: Remove unused functions Thomas Huth
` (2 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Thomas Huth @ 2015-02-19 17:12 UTC (permalink / raw)
To: qemu-trivial, qemu-devel; +Cc: Thomas Huth, Anthony Liguori, Gerd Hoffmann
This function is not used anymore, let's remove it.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Cc: Anthony Liguori <aliguori@amazon.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
---
ui/vnc-jobs.c | 13 -------------
ui/vnc-jobs.h | 1 -
2 files changed, 0 insertions(+), 14 deletions(-)
diff --git a/ui/vnc-jobs.c b/ui/vnc-jobs.c
index 68f3d77..c8ee203 100644
--- a/ui/vnc-jobs.c
+++ b/ui/vnc-jobs.c
@@ -342,16 +342,3 @@ void vnc_start_worker_thread(void)
QEMU_THREAD_DETACHED);
queue = q; /* Set global queue */
}
-
-void vnc_stop_worker_thread(void)
-{
- if (!vnc_worker_thread_running())
- return ;
-
- /* Remove all jobs and wake up the thread */
- vnc_lock_queue(queue);
- queue->exit = true;
- vnc_unlock_queue(queue);
- vnc_jobs_clear(NULL);
- qemu_cond_broadcast(&queue->cond);
-}
diff --git a/ui/vnc-jobs.h b/ui/vnc-jobs.h
index 31da103..044bf9f 100644
--- a/ui/vnc-jobs.h
+++ b/ui/vnc-jobs.h
@@ -40,7 +40,6 @@ void vnc_jobs_join(VncState *vs);
void vnc_jobs_consume_buffer(VncState *vs);
void vnc_start_worker_thread(void);
-void vnc_stop_worker_thread(void);
/* Locks */
static inline int vnc_trylock_display(VncDisplay *vd)
--
1.7.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 4/5] util: Remove unused functions
2015-02-19 17:12 [Qemu-devel] [PATCH v2 0/5] Remove unused functions Thomas Huth
` (2 preceding siblings ...)
2015-02-19 17:12 ` [Qemu-devel] [PATCH 3/5] ui/vnc: Remove vnc_stop_worker_thread() Thomas Huth
@ 2015-02-19 17:12 ` Thomas Huth
2015-02-19 17:12 ` [Qemu-devel] [PATCH 5/5] xen: Remove xen_cmos_set_s3_resume() Thomas Huth
2015-02-28 9:16 ` [Qemu-devel] [PATCH v2 0/5] Remove unused functions Michael Tokarev
5 siblings, 0 replies; 13+ messages in thread
From: Thomas Huth @ 2015-02-19 17:12 UTC (permalink / raw)
To: qemu-trivial, qemu-devel; +Cc: Thomas Huth, Markus Armbruster
Delete the unused functions qemu_signalfd_available(),
qemu_send_full() and qemu_recv_full().
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Cc: Markus Armbruster <armbru@redhat.com>
---
include/qemu-common.h | 4 ---
include/qemu/compatfd.h | 1 -
util/compatfd.c | 19 -------------
util/osdep.c | 66 -----------------------------------------------
4 files changed, 0 insertions(+), 90 deletions(-)
diff --git a/include/qemu-common.h b/include/qemu-common.h
index 644b46d..0aac082 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -217,10 +217,6 @@ void *qemu_oom_check(void *ptr);
ssize_t qemu_write_full(int fd, const void *buf, size_t count)
QEMU_WARN_UNUSED_RESULT;
-ssize_t qemu_send_full(int fd, const void *buf, size_t count, int flags)
- QEMU_WARN_UNUSED_RESULT;
-ssize_t qemu_recv_full(int fd, void *buf, size_t count, int flags)
- QEMU_WARN_UNUSED_RESULT;
#ifndef _WIN32
int qemu_pipe(int pipefd[2]);
diff --git a/include/qemu/compatfd.h b/include/qemu/compatfd.h
index 6b04877..fc37915 100644
--- a/include/qemu/compatfd.h
+++ b/include/qemu/compatfd.h
@@ -39,6 +39,5 @@ struct qemu_signalfd_siginfo {
};
int qemu_signalfd(const sigset_t *mask);
-bool qemu_signalfd_available(void);
#endif
diff --git a/util/compatfd.c b/util/compatfd.c
index 341ada6..e857150 100644
--- a/util/compatfd.c
+++ b/util/compatfd.c
@@ -108,22 +108,3 @@ int qemu_signalfd(const sigset_t *mask)
return qemu_signalfd_compat(mask);
}
-
-bool qemu_signalfd_available(void)
-{
-#ifdef CONFIG_SIGNALFD
- sigset_t mask;
- int fd;
- bool ok;
- sigemptyset(&mask);
- errno = 0;
- fd = syscall(SYS_signalfd, -1, &mask, _NSIG / 8);
- ok = (errno != ENOSYS);
- if (fd >= 0) {
- close(fd);
- }
- return ok;
-#else
- return false;
-#endif
-}
diff --git a/util/osdep.c b/util/osdep.c
index b2bd154..f938b69 100644
--- a/util/osdep.c
+++ b/util/osdep.c
@@ -310,72 +310,6 @@ int qemu_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
return ret;
}
-/*
- * A variant of send(2) which handles partial write.
- *
- * Return the number of bytes transferred, which is only
- * smaller than `count' if there is an error.
- *
- * This function won't work with non-blocking fd's.
- * Any of the possibilities with non-bloking fd's is bad:
- * - return a short write (then name is wrong)
- * - busy wait adding (errno == EAGAIN) to the loop
- */
-ssize_t qemu_send_full(int fd, const void *buf, size_t count, int flags)
-{
- ssize_t ret = 0;
- ssize_t total = 0;
-
- while (count) {
- ret = send(fd, buf, count, flags);
- if (ret < 0) {
- if (errno == EINTR) {
- continue;
- }
- break;
- }
-
- count -= ret;
- buf += ret;
- total += ret;
- }
-
- return total;
-}
-
-/*
- * A variant of recv(2) which handles partial write.
- *
- * Return the number of bytes transferred, which is only
- * smaller than `count' if there is an error.
- *
- * This function won't work with non-blocking fd's.
- * Any of the possibilities with non-bloking fd's is bad:
- * - return a short write (then name is wrong)
- * - busy wait adding (errno == EAGAIN) to the loop
- */
-ssize_t qemu_recv_full(int fd, void *buf, size_t count, int flags)
-{
- ssize_t ret = 0;
- ssize_t total = 0;
-
- while (count) {
- ret = qemu_recv(fd, buf, count, flags);
- if (ret <= 0) {
- if (ret < 0 && errno == EINTR) {
- continue;
- }
- break;
- }
-
- count -= ret;
- buf += ret;
- total += ret;
- }
-
- return total;
-}
-
void qemu_set_version(const char *version)
{
qemu_version = version;
--
1.7.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH 5/5] xen: Remove xen_cmos_set_s3_resume()
2015-02-19 17:12 [Qemu-devel] [PATCH v2 0/5] Remove unused functions Thomas Huth
` (3 preceding siblings ...)
2015-02-19 17:12 ` [Qemu-devel] [PATCH 4/5] util: Remove unused functions Thomas Huth
@ 2015-02-19 17:12 ` Thomas Huth
2015-02-25 16:47 ` Stefano Stabellini
2015-02-28 9:16 ` [Qemu-devel] [PATCH v2 0/5] Remove unused functions Michael Tokarev
5 siblings, 1 reply; 13+ messages in thread
From: Thomas Huth @ 2015-02-19 17:12 UTC (permalink / raw)
To: qemu-trivial, qemu-devel; +Cc: Thomas Huth, Stefano Stabellini
The function is not used anymore, and thus can be deleted.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
include/hw/xen/xen.h | 1 -
xen-hvm-stub.c | 4 ----
2 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/include/hw/xen/xen.h b/include/hw/xen/xen.h
index b0ed04c..4356af4 100644
--- a/include/hw/xen/xen.h
+++ b/include/hw/xen/xen.h
@@ -32,7 +32,6 @@ int xen_pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num);
void xen_piix3_set_irq(void *opaque, int irq_num, int level);
void xen_piix_pci_write_config_client(uint32_t address, uint32_t val, int len);
void xen_hvm_inject_msi(uint64_t addr, uint32_t data);
-void xen_cmos_set_s3_resume(void *opaque, int irq, int level);
qemu_irq *xen_interrupt_controller_init(void);
diff --git a/xen-hvm-stub.c b/xen-hvm-stub.c
index 2d98696..46867d8 100644
--- a/xen-hvm-stub.c
+++ b/xen-hvm-stub.c
@@ -30,10 +30,6 @@ void xen_hvm_inject_msi(uint64_t addr, uint32_t data)
{
}
-void xen_cmos_set_s3_resume(void *opaque, int irq, int level)
-{
-}
-
void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr)
{
}
--
1.7.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] [PATCH 5/5] xen: Remove xen_cmos_set_s3_resume()
2015-02-19 17:12 ` [Qemu-devel] [PATCH 5/5] xen: Remove xen_cmos_set_s3_resume() Thomas Huth
@ 2015-02-25 16:47 ` Stefano Stabellini
0 siblings, 0 replies; 13+ messages in thread
From: Stefano Stabellini @ 2015-02-25 16:47 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-trivial, qemu-devel, Stefano Stabellini
On Thu, 19 Feb 2015, Thomas Huth wrote:
> The function is not used anymore, and thus can be deleted.
>
> Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> include/hw/xen/xen.h | 1 -
> xen-hvm-stub.c | 4 ----
> 2 files changed, 0 insertions(+), 5 deletions(-)
>
> diff --git a/include/hw/xen/xen.h b/include/hw/xen/xen.h
> index b0ed04c..4356af4 100644
> --- a/include/hw/xen/xen.h
> +++ b/include/hw/xen/xen.h
> @@ -32,7 +32,6 @@ int xen_pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num);
> void xen_piix3_set_irq(void *opaque, int irq_num, int level);
> void xen_piix_pci_write_config_client(uint32_t address, uint32_t val, int len);
> void xen_hvm_inject_msi(uint64_t addr, uint32_t data);
> -void xen_cmos_set_s3_resume(void *opaque, int irq, int level);
>
> qemu_irq *xen_interrupt_controller_init(void);
>
> diff --git a/xen-hvm-stub.c b/xen-hvm-stub.c
> index 2d98696..46867d8 100644
> --- a/xen-hvm-stub.c
> +++ b/xen-hvm-stub.c
> @@ -30,10 +30,6 @@ void xen_hvm_inject_msi(uint64_t addr, uint32_t data)
> {
> }
>
> -void xen_cmos_set_s3_resume(void *opaque, int irq, int level)
> -{
> -}
> -
> void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr)
> {
> }
> --
> 1.7.1
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Qemu-devel] [PATCH v2 0/5] Remove unused functions
2015-02-19 17:12 [Qemu-devel] [PATCH v2 0/5] Remove unused functions Thomas Huth
` (4 preceding siblings ...)
2015-02-19 17:12 ` [Qemu-devel] [PATCH 5/5] xen: Remove xen_cmos_set_s3_resume() Thomas Huth
@ 2015-02-28 9:16 ` Michael Tokarev
5 siblings, 0 replies; 13+ messages in thread
From: Michael Tokarev @ 2015-02-28 9:16 UTC (permalink / raw)
To: Thomas Huth, qemu-trivial, qemu-devel
19.02.2015 20:12, Thomas Huth wrote:
> There are quite a lot of completely unused functions scattered
> around in the QEMU sources - here are some patches to remove at
> least some of them.
Applied series to -trivial, thank you!
/mjt
^ permalink raw reply [flat|nested] 13+ messages in thread