qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/4] Misc fixes for 2.0-rc1
@ 2014-03-17 12:23 Paolo Bonzini
  2014-03-17 12:23 ` [Qemu-devel] [PULL 1/4] rules.mak: Fix per object libs extraction Paolo Bonzini
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Paolo Bonzini @ 2014-03-17 12:23 UTC (permalink / raw)
  To: qemu-devel

Anthony, Peter,

The following changes since commit f4b11eee2f562c23b3efc33b96ba4542c9ca81aa:

  Makefile: Fix "make clean" (2014-03-17 11:50:19 +0000)

are available in the git repository at:

  git://github.com/bonzini/qemu.git fixes-for-2.0

for you to fetch changes up to 025172d56e11ba3d86d0937933a23aab3b8606b1:

  vl.c: Output error on invalid machine type (2014-03-17 13:21:12 +0100)

I gathered miscellaneous fixes from the mailing list, two of them mine,
that are suitable for hard freeze.  (I originarily had Fam's other patch
in here too).

----------------------------------------------------------------
Fam Zheng (1):
      rules.mak: Fix per object libs extraction

Miroslav Rezanina (1):
      vl.c: Output error on invalid machine type

Paolo Bonzini (2):
      qemu-nbd: Fix coverity issues
      target-alpha: fix subl and s8subl indentation

 qemu-nbd.c               | 17 +++++++++++++----
 rules.mak                |  4 ++--
 target-alpha/translate.c |  3 ++-
 vl.c                     | 21 +++++++++++++--------
 4 files changed, 30 insertions(+), 15 deletions(-)
-- 
1.8.5.3

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PULL 1/4] rules.mak: Fix per object libs extraction
  2014-03-17 12:23 [Qemu-devel] [PULL 0/4] Misc fixes for 2.0-rc1 Paolo Bonzini
@ 2014-03-17 12:23 ` Paolo Bonzini
  2014-03-17 12:23 ` [Qemu-devel] [PULL 2/4] qemu-nbd: Fix coverity issues Paolo Bonzini
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Paolo Bonzini @ 2014-03-17 12:23 UTC (permalink / raw)
  To: qemu-devel; +Cc: Fam Zheng

From: Fam Zheng <famz@redhat.com>

Don't sort the extracted options, sort the objects.

Reported-by: Christian Mahnke <cmahnke@googlemail.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 rules.mak | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rules.mak b/rules.mak
index 9dda9f7..5c454d8 100644
--- a/rules.mak
+++ b/rules.mak
@@ -23,8 +23,8 @@ QEMU_DGFLAGS += -MMD -MP -MT $@ -MF $(*D)/$(*F).d
 QEMU_INCLUDES += -I$(<D) -I$(@D)
 
 maybe-add = $(filter-out $1, $2) $1
-extract-libs = $(strip $(sort $(foreach o,$1,$($o-libs)) \
-                  $(foreach o,$(call expand-objs,$1),$($o-libs))))
+extract-libs = $(strip $(sort $(foreach o,$1,$($o-libs))) \
+                  $(foreach o,$(call expand-objs,$1),$($o-libs)))
 expand-objs = $(strip $(sort $(filter %.o,$1)) \
                   $(foreach o,$(filter %.mo,$1),$($o-objs)) \
                   $(filter-out %.o %.mo,$1))
-- 
1.8.5.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PULL 2/4] qemu-nbd: Fix coverity issues
  2014-03-17 12:23 [Qemu-devel] [PULL 0/4] Misc fixes for 2.0-rc1 Paolo Bonzini
  2014-03-17 12:23 ` [Qemu-devel] [PULL 1/4] rules.mak: Fix per object libs extraction Paolo Bonzini
@ 2014-03-17 12:23 ` Paolo Bonzini
  2014-03-17 12:23 ` [Qemu-devel] [PULL 3/4] target-alpha: fix subl and s8subl indentation Paolo Bonzini
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Paolo Bonzini @ 2014-03-17 12:23 UTC (permalink / raw)
  To: qemu-devel

There are two issues in qemu-nbd: a missing return value check after
calling accept(), and file descriptor leaks in nbd_client_thread.

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 qemu-nbd.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/qemu-nbd.c b/qemu-nbd.c
index bdac1f3..899e67c 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -288,19 +288,19 @@ static void *nbd_client_thread(void *arg)
     ret = nbd_receive_negotiate(sock, NULL, &nbdflags,
                                 &size, &blocksize);
     if (ret < 0) {
-        goto out;
+        goto out_socket;
     }
 
     fd = open(device, O_RDWR);
     if (fd < 0) {
         /* Linux-only, we can use %m in printf.  */
         fprintf(stderr, "Failed to open %s: %m", device);
-        goto out;
+        goto out_socket;
     }
 
     ret = nbd_init(fd, sock, nbdflags, size, blocksize);
     if (ret < 0) {
-        goto out;
+        goto out_fd;
     }
 
     /* update partition table */
@@ -316,12 +316,16 @@ static void *nbd_client_thread(void *arg)
 
     ret = nbd_client(fd);
     if (ret) {
-        goto out;
+        goto out_fd;
     }
     close(fd);
     kill(getpid(), SIGTERM);
     return (void *) EXIT_SUCCESS;
 
+out_fd:
+    close(fd);
+out_socket:
+    closesocket(sock);
 out:
     kill(getpid(), SIGTERM);
     return (void *) EXIT_FAILURE;
@@ -355,6 +359,11 @@ static void nbd_accept(void *opaque)
     socklen_t addr_len = sizeof(addr);
 
     int fd = accept(server_fd, (struct sockaddr *)&addr, &addr_len);
+    if (fd < 0) {
+        perror("accept");
+        return;
+    }
+
     if (state >= TERMINATE) {
         close(fd);
         return;
-- 
1.8.5.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PULL 3/4] target-alpha: fix subl and s8subl indentation
  2014-03-17 12:23 [Qemu-devel] [PULL 0/4] Misc fixes for 2.0-rc1 Paolo Bonzini
  2014-03-17 12:23 ` [Qemu-devel] [PULL 1/4] rules.mak: Fix per object libs extraction Paolo Bonzini
  2014-03-17 12:23 ` [Qemu-devel] [PULL 2/4] qemu-nbd: Fix coverity issues Paolo Bonzini
@ 2014-03-17 12:23 ` Paolo Bonzini
  2014-03-17 12:23 ` [Qemu-devel] [PULL 4/4] vl.c: Output error on invalid machine type Paolo Bonzini
  2014-03-17 14:06 ` [Qemu-devel] [PULL 0/4] Misc fixes for 2.0-rc1 Peter Maydell
  4 siblings, 0 replies; 6+ messages in thread
From: Paolo Bonzini @ 2014-03-17 12:23 UTC (permalink / raw)
  To: qemu-devel

Two missing braces, one close and one open, fabulously let the code
compile.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target-alpha/translate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target-alpha/translate.c b/target-alpha/translate.c
index a9ef1a7..e7e319b 100644
--- a/target-alpha/translate.c
+++ b/target-alpha/translate.c
@@ -1927,6 +1927,7 @@ static ExitStatus translate_one(DisasContext *ctx, uint32_t insn)
                     else {
                         tcg_gen_neg_i64(cpu_ir[rc], cpu_ir[rb]);
                         tcg_gen_ext32s_i64(cpu_ir[rc], cpu_ir[rc]);
+                    }
                 }
             }
             break;
@@ -1991,7 +1992,7 @@ static ExitStatus translate_one(DisasContext *ctx, uint32_t insn)
                 } else {
                     if (islit)
                         tcg_gen_movi_i64(cpu_ir[rc], -lit);
-                    else
+                    else {
                         tcg_gen_neg_i64(cpu_ir[rc], cpu_ir[rb]);
                         tcg_gen_ext32s_i64(cpu_ir[rc], cpu_ir[rc]);
                     }
-- 
1.8.5.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PULL 4/4] vl.c: Output error on invalid machine type
  2014-03-17 12:23 [Qemu-devel] [PULL 0/4] Misc fixes for 2.0-rc1 Paolo Bonzini
                   ` (2 preceding siblings ...)
  2014-03-17 12:23 ` [Qemu-devel] [PULL 3/4] target-alpha: fix subl and s8subl indentation Paolo Bonzini
@ 2014-03-17 12:23 ` Paolo Bonzini
  2014-03-17 14:06 ` [Qemu-devel] [PULL 0/4] Misc fixes for 2.0-rc1 Peter Maydell
  4 siblings, 0 replies; 6+ messages in thread
From: Paolo Bonzini @ 2014-03-17 12:23 UTC (permalink / raw)
  To: qemu-devel; +Cc: Miroslav Rezanina

From: Miroslav Rezanina <mrezanin@redhat.com>

Output error message using qemu's error_report() function when user
provides the invalid machine type on the command line. This also saves
time to find what issue is when you downgrade from one version of qemu
to another that doesn't support required machine type yet (the version
user downgraded to have to have this patch applied too, of course).

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
[Replace printf with error_printf, suggested by Markus Armbruster. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 vl.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/vl.c b/vl.c
index 842e897..b363a21 100644
--- a/vl.c
+++ b/vl.c
@@ -2651,15 +2651,20 @@ static MachineClass *machine_parse(const char *name)
     if (mc) {
         return mc;
     }
-    printf("Supported machines are:\n");
-    for (el = machines; el; el = el->next) {
-        MachineClass *mc = el->data;
-        QEMUMachine *m = mc->qemu_machine;
-        if (m->alias) {
-            printf("%-20s %s (alias of %s)\n", m->alias, m->desc, m->name);
+    if (name && !is_help_option(name)) {
+        error_report("Unsupported machine type");
+        error_printf("Use -machine help to list supported machines!\n");
+    } else {
+        printf("Supported machines are:\n");
+        for (el = machines; el; el = el->next) {
+            MachineClass *mc = el->data;
+            QEMUMachine *m = mc->qemu_machine;
+            if (m->alias) {
+                printf("%-20s %s (alias of %s)\n", m->alias, m->desc, m->name);
+            }
+            printf("%-20s %s%s\n", m->name, m->desc,
+                   m->is_default ? " (default)" : "");
         }
-        printf("%-20s %s%s\n", m->name, m->desc,
-               m->is_default ? " (default)" : "");
     }
 
     g_slist_free(machines);
-- 
1.8.5.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PULL 0/4] Misc fixes for 2.0-rc1
  2014-03-17 12:23 [Qemu-devel] [PULL 0/4] Misc fixes for 2.0-rc1 Paolo Bonzini
                   ` (3 preceding siblings ...)
  2014-03-17 12:23 ` [Qemu-devel] [PULL 4/4] vl.c: Output error on invalid machine type Paolo Bonzini
@ 2014-03-17 14:06 ` Peter Maydell
  4 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2014-03-17 14:06 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: QEMU Developers

On 17 March 2014 12:23, Paolo Bonzini <pbonzini@redhat.com> wrote:
> Anthony, Peter,
>
> The following changes since commit f4b11eee2f562c23b3efc33b96ba4542c9ca81aa:
>
>   Makefile: Fix "make clean" (2014-03-17 11:50:19 +0000)
>
> are available in the git repository at:
>
>   git://github.com/bonzini/qemu.git fixes-for-2.0
>
> for you to fetch changes up to 025172d56e11ba3d86d0937933a23aab3b8606b1:
>
>   vl.c: Output error on invalid machine type (2014-03-17 13:21:12 +0100)
>
> I gathered miscellaneous fixes from the mailing list, two of them mine,
> that are suitable for hard freeze.  (I originarily had Fam's other patch
> in here too).
>

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-03-17 14:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-17 12:23 [Qemu-devel] [PULL 0/4] Misc fixes for 2.0-rc1 Paolo Bonzini
2014-03-17 12:23 ` [Qemu-devel] [PULL 1/4] rules.mak: Fix per object libs extraction Paolo Bonzini
2014-03-17 12:23 ` [Qemu-devel] [PULL 2/4] qemu-nbd: Fix coverity issues Paolo Bonzini
2014-03-17 12:23 ` [Qemu-devel] [PULL 3/4] target-alpha: fix subl and s8subl indentation Paolo Bonzini
2014-03-17 12:23 ` [Qemu-devel] [PULL 4/4] vl.c: Output error on invalid machine type Paolo Bonzini
2014-03-17 14:06 ` [Qemu-devel] [PULL 0/4] Misc fixes for 2.0-rc1 Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).