qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/2] Last minute fixes for 2.7.0-rc5
@ 2016-08-30 15:56 Paolo Bonzini
  2016-08-30 15:56 ` [Qemu-devel] [PULL 1/2] Revert "Change net/socket.c to use socket_*() functions" Paolo Bonzini
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Paolo Bonzini @ 2016-08-30 15:56 UTC (permalink / raw)
  To: qemu-devel

The following changes since commit 135a972b45203ba992afc99ef4f061be8a5acae0:

  translate: early exit in tb_flush if there is no tcg (2016-08-30 13:30:55 +0100)

are available in the git repository at:

  git://github.com/bonzini/qemu.git 

for you to fetch changes up to 336d5881a927cd80e8c0ff61c7f76b1433f91bb0:

  optionrom: cope with multiple -O options (2016-08-30 16:28:46 +0200)

----------------------------------------------------------------
* pc-bios/optionrom/Makefile fix for -O0
* revert socket_connect change

----------------------------------------------------------------
Paolo Bonzini (2):
      Revert "Change net/socket.c to use socket_*() functions"
      optionrom: cope with multiple -O options

 net/socket.c               | 55 +++++++++++++++++++++++-----------------------
 pc-bios/optionrom/Makefile |  5 +----
 2 files changed, 29 insertions(+), 31 deletions(-)
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 1/2] Revert "Change net/socket.c to use socket_*() functions"
  2016-08-30 15:56 [Qemu-devel] [PULL 0/2] Last minute fixes for 2.7.0-rc5 Paolo Bonzini
@ 2016-08-30 15:56 ` Paolo Bonzini
  2016-08-30 15:56 ` [Qemu-devel] [PULL 2/2] optionrom: cope with multiple -O options Paolo Bonzini
  2016-08-30 16:03 ` [Qemu-devel] [PULL 0/2] Last minute fixes for 2.7.0-rc5 no-reply
  2 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2016-08-30 15:56 UTC (permalink / raw)
  To: qemu-devel

Since commit 7e8449594c929, the socket connect code is blocking, because
calling socket_connect() without callback is blocking.  This reverts the
commit.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 net/socket.c | 55 ++++++++++++++++++++++++++++---------------------------
 1 file changed, 28 insertions(+), 27 deletions(-)

diff --git a/net/socket.c b/net/socket.c
index 17e635d..3f98eef 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -489,30 +489,41 @@ static int net_socket_listen_init(NetClientState *peer,
 {
     NetClientState *nc;
     NetSocketState *s;
-    SocketAddress *saddr;
-    int ret;
-    Error *local_error = NULL;
+    struct sockaddr_in saddr;
+    int fd, ret;
 
-    saddr = socket_parse(host_str, &local_error);
-    if (saddr == NULL) {
-        error_report_err(local_error);
+    if (parse_host_port(&saddr, host_str) < 0)
+        return -1;
+
+    fd = qemu_socket(PF_INET, SOCK_STREAM, 0);
+    if (fd < 0) {
+        perror("socket");
         return -1;
     }
+    qemu_set_nonblock(fd);
 
-    ret = socket_listen(saddr, &local_error);
+    socket_set_fast_reuse(fd);
+
+    ret = bind(fd, (struct sockaddr *)&saddr, sizeof(saddr));
     if (ret < 0) {
-        error_report_err(local_error);
+        perror("bind");
+        closesocket(fd);
+        return -1;
+    }
+    ret = listen(fd, 0);
+    if (ret < 0) {
+        perror("listen");
+        closesocket(fd);
         return -1;
     }
 
     nc = qemu_new_net_client(&net_socket_info, peer, model, name);
     s = DO_UPCAST(NetSocketState, nc, nc);
     s->fd = -1;
-    s->listen_fd = ret;
+    s->listen_fd = fd;
     s->nc.link_down = true;
 
     qemu_set_fd_handler(s->listen_fd, net_socket_accept, NULL, s);
-    qapi_free_SocketAddress(saddr);
     return 0;
 }
 
@@ -523,15 +534,10 @@ static int net_socket_connect_init(NetClientState *peer,
 {
     NetSocketState *s;
     int fd, connected, ret;
-    char *addr_str;
-    SocketAddress *saddr;
-    Error *local_error = NULL;
+    struct sockaddr_in saddr;
 
-    saddr = socket_parse(host_str, &local_error);
-    if (saddr == NULL) {
-        error_report_err(local_error);
+    if (parse_host_port(&saddr, host_str) < 0)
         return -1;
-    }
 
     fd = qemu_socket(PF_INET, SOCK_STREAM, 0);
     if (fd < 0) {
@@ -539,9 +545,10 @@ static int net_socket_connect_init(NetClientState *peer,
         return -1;
     }
     qemu_set_nonblock(fd);
+
     connected = 0;
     for(;;) {
-        ret = socket_connect(saddr, &local_error, NULL, NULL);
+        ret = connect(fd, (struct sockaddr *)&saddr, sizeof(saddr));
         if (ret < 0) {
             if (errno == EINTR || errno == EWOULDBLOCK) {
                 /* continue */
@@ -550,7 +557,7 @@ static int net_socket_connect_init(NetClientState *peer,
                        errno == EINVAL) {
                 break;
             } else {
-                error_report_err(local_error);
+                perror("connect");
                 closesocket(fd);
                 return -1;
             }
@@ -562,15 +569,9 @@ static int net_socket_connect_init(NetClientState *peer,
     s = net_socket_fd_init(peer, model, name, fd, connected);
     if (!s)
         return -1;
-
-    addr_str = socket_address_to_string(saddr, &local_error);
-    if (addr_str == NULL)
-        return -1;
-
     snprintf(s->nc.info_str, sizeof(s->nc.info_str),
-             "socket: connect to %s", addr_str);
-    qapi_free_SocketAddress(saddr);
-    g_free(addr_str);
+             "socket: connect to %s:%d",
+             inet_ntoa(saddr.sin_addr), ntohs(saddr.sin_port));
     return 0;
 }
 
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 2/2] optionrom: cope with multiple -O options
  2016-08-30 15:56 [Qemu-devel] [PULL 0/2] Last minute fixes for 2.7.0-rc5 Paolo Bonzini
  2016-08-30 15:56 ` [Qemu-devel] [PULL 1/2] Revert "Change net/socket.c to use socket_*() functions" Paolo Bonzini
@ 2016-08-30 15:56 ` Paolo Bonzini
  2016-08-30 16:03 ` [Qemu-devel] [PULL 0/2] Last minute fixes for 2.7.0-rc5 no-reply
  2 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2016-08-30 15:56 UTC (permalink / raw)
  To: qemu-devel

Reproducer:

    CFLAGS="-g3 -O0" ./configure --target-list=aarch64-softmmu,arm-softmmu --enable-vhost-net --enable-virtfs

Here CFLAGS ends up with "-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ... -g3 -O0"
and pc-bios/optionrom/Makefile forgets to add the -O2 it needs.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 pc-bios/optionrom/Makefile | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
index 9bdc497..afa48f1 100644
--- a/pc-bios/optionrom/Makefile
+++ b/pc-bios/optionrom/Makefile
@@ -10,10 +10,7 @@ $(call set-vpath, $(SRC_PATH)/pc-bios/optionrom)
 .PHONY : all clean build-all
 
 # Compiling with no optimization creates ROMs that are too large
-ifeq ($(filter -O%, $(CFLAGS)),)
-override CFLAGS += -O2
-endif
-ifeq ($(filter -O%, $(CFLAGS)),-O0)
+ifeq ($(lastword $(filter -O%, -O0 $(CFLAGS))),-O0)
 override CFLAGS += -O2
 endif
 
-- 
1.8.3.1

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

* Re: [Qemu-devel] [PULL 0/2] Last minute fixes for 2.7.0-rc5
  2016-08-30 15:56 [Qemu-devel] [PULL 0/2] Last minute fixes for 2.7.0-rc5 Paolo Bonzini
  2016-08-30 15:56 ` [Qemu-devel] [PULL 1/2] Revert "Change net/socket.c to use socket_*() functions" Paolo Bonzini
  2016-08-30 15:56 ` [Qemu-devel] [PULL 2/2] optionrom: cope with multiple -O options Paolo Bonzini
@ 2016-08-30 16:03 ` no-reply
  2 siblings, 0 replies; 4+ messages in thread
From: no-reply @ 2016-08-30 16:03 UTC (permalink / raw)
  To: pbonzini; +Cc: famz, qemu-devel

Hi,

Your series seems to have some coding style problems. See output below for
more information:

Subject: [Qemu-devel] [PULL 0/2] Last minute fixes for 2.7.0-rc5
Type: series
Message-id: 1472572593-86410-1-git-send-email-pbonzini@redhat.com

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

# Useful git options
git config --local diff.renamelimit 0
git config --local diff.renames True

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git show --no-patch --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/1472572593-86410-1-git-send-email-pbonzini@redhat.com -> patchew/1472572593-86410-1-git-send-email-pbonzini@redhat.com
Switched to a new branch 'test'
b79a461 optionrom: cope with multiple -O options
ccab731 Revert "Change net/socket.c to use socket_*() functions"

=== OUTPUT BEGIN ===
Checking PATCH 1/2: Revert "Change net/socket.c to use socket_*() functions"...
ERROR: braces {} are necessary for all arms of this statement
#30: FILE: net/socket.c:495:
+    if (parse_host_port(&saddr, host_str) < 0)
[...]

ERROR: braces {} are necessary for all arms of this statement
#81: FILE: net/socket.c:539:
+    if (parse_host_port(&saddr, host_str) < 0)
[...]

total: 2 errors, 0 warnings, 104 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Checking PATCH 2/2: optionrom: cope with multiple -O options...
=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org

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

end of thread, other threads:[~2016-08-30 16:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-30 15:56 [Qemu-devel] [PULL 0/2] Last minute fixes for 2.7.0-rc5 Paolo Bonzini
2016-08-30 15:56 ` [Qemu-devel] [PULL 1/2] Revert "Change net/socket.c to use socket_*() functions" Paolo Bonzini
2016-08-30 15:56 ` [Qemu-devel] [PULL 2/2] optionrom: cope with multiple -O options Paolo Bonzini
2016-08-30 16:03 ` [Qemu-devel] [PULL 0/2] Last minute fixes for 2.7.0-rc5 no-reply

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).