All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 00/20] Misc patches for 2017-05-19
@ 2017-05-19 11:20 Paolo Bonzini
  2017-05-19 11:20 ` [Qemu-devel] [PULL 01/20] mc146818rtc: update periodic timer only if it is needed Paolo Bonzini
                   ` (21 more replies)
  0 siblings, 22 replies; 28+ messages in thread
From: Paolo Bonzini @ 2017-05-19 11:20 UTC (permalink / raw)
  To: qemu-devel

The following changes since commit 56821559f0ba682fe6b367815572e6f974d329ab:

  Merge remote-tracking branch 'dgilbert/tags/pull-hmp-20170517' into staging (2017-05-18 13:36:15 +0100)

are available in the git repository at:


  git://github.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to e10dc0ca6854c4f47cc5e9d47e20c62aa875f518:

  target/i386: use multiple CPU AddressSpaces (2017-05-19 13:01:32 +0200)

----------------------------------------------------------------
* virtio-scsi use-after-free fix (Fam)
* vhost-user-scsi support (Felipe)
* SMM fixes and improvements for TCG (myself)
* irqchip and AddressSpaceDispatch cleanups and fixes (Peter)
* Coverity fix (Stefano)
* NBD cleanups (Vladimir)
* RTC accuracy improvements and code cleanups (Guangrong+Yunfang)

----------------------------------------------------------------
Fam Zheng (1):
      virtio-scsi: Unset hotplug handler when unrealize

Felipe Franciosi (2):
      vhost-user-scsi: Introduce vhost-user-scsi host device
      vhost-user-scsi: Introduce a vhost-user-scsi sample application

Paolo Bonzini (2):
      target/i386: enable A20 automatically in system management mode
      target/i386: use multiple CPU AddressSpaces

Peter Xu (4):
      kvm: irqchip: trace changes on msi add/remove
      msix: trace control bit write op
      kvm: irqchip: skip update msi when disabled
      exec: simplify phys_page_find() params

Stefano Stabellini (1):
      Check the return value of fcntl in qemu_set_cloexec

Tai Yunfang (1):
      mc146818rtc: precisely count the clock for periodic timer

Vladimir Sementsov-Ogievskiy (5):
      nbd: strict nbd_wr_syncv
      nbd: read_sync and friends: return 0 on success
      nbd: add errp parameter to nbd_wr_syncv()
      nbd: add errp to read_sync, write_sync and drop_sync
      nbd/client.c: use errp instead of LOG

Xiao Guangrong (4):
      mc146818rtc: update periodic timer only if it is needed
      mc146818rtc: ensure LOST_TICK_POLICY_SLEW is only enabled on TARGET_I386
      mc146818rtc: drop unnecessary '#ifdef TARGET_I386'
      mc146818rtc: embrace all x86 specific code

 .gitignore                                |   1 +
 Makefile                                  |   3 +
 Makefile.objs                             |   4 +
 block/nbd-client.c                        |  11 +-
 contrib/vhost-user-scsi/Makefile.objs     |   1 +
 contrib/vhost-user-scsi/vhost-user-scsi.c | 886 ++++++++++++++++++++++++++++++
 default-configs/pci.mak                   |   1 +
 default-configs/s390x-softmmu.mak         |   1 +
 exec.c                                    |  13 +-
 hw/pci/msix.c                             |  11 +-
 hw/pci/trace-events                       |   3 +
 hw/scsi/Makefile.objs                     |   1 +
 hw/scsi/vhost-user-scsi.c                 | 215 ++++++++
 hw/scsi/virtio-scsi.c                     |   3 +
 hw/timer/mc146818rtc.c                    | 206 ++++---
 hw/virtio/virtio-pci.c                    |  54 ++
 hw/virtio/virtio-pci.h                    |  11 +
 include/block/nbd.h                       |   8 +-
 include/hw/virtio/vhost-user-scsi.h       |  35 ++
 include/hw/virtio/virtio-scsi.h           |   3 +
 kvm-all.c                                 |   4 +-
 nbd/client.c                              | 125 ++---
 nbd/common.c                              |  23 +-
 nbd/nbd-internal.h                        |  40 +-
 nbd/server.c                              |  92 ++--
 qemu-nbd.c                                |   3 +-
 target/i386/arch_memory_mapping.c         |  18 +-
 target/i386/cpu.c                         |  15 +-
 target/i386/cpu.h                         |  20 +-
 target/i386/helper.c                      |  96 ++--
 target/i386/kvm.c                         |  12 +-
 target/i386/machine.c                     |   4 -
 target/i386/smm_helper.c                  |  18 -
 trace-events                              |   3 +-
 util/oslib-posix.c                        |   4 +-
 35 files changed, 1642 insertions(+), 306 deletions(-)
 create mode 100644 contrib/vhost-user-scsi/Makefile.objs
 create mode 100644 contrib/vhost-user-scsi/vhost-user-scsi.c
 create mode 100644 hw/scsi/vhost-user-scsi.c
 create mode 100644 include/hw/virtio/vhost-user-scsi.h
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 28+ messages in thread
* [Qemu-devel] [PATCH 5/5] nbd/client.c: use errp instead of LOG
@ 2017-05-16  9:45 Vladimir Sementsov-Ogievskiy
  2017-05-16 11:09 ` [Qemu-devel] [PATCH v2] " Vladimir Sementsov-Ogievskiy
  0 siblings, 1 reply; 28+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2017-05-16  9:45 UTC (permalink / raw)
  To: qemu-devel, qemu-block; +Cc: mreitz, kwolf, pbonzini, den, vsementsov

Move to modern errp scheme from just LOGging errors.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 block/nbd-client.c  |  7 ++++++-
 include/block/nbd.h |  5 +++--
 nbd/client.c        | 26 ++++++++++++++------------
 qemu-nbd.c          |  3 ++-
 4 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/block/nbd-client.c b/block/nbd-client.c
index 538d95e031..073032bac5 100644
--- a/block/nbd-client.c
+++ b/block/nbd-client.c
@@ -28,6 +28,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "nbd-client.h"
 
 #define HANDLE_TO_INDEX(bs, handle) ((handle) ^ ((uint64_t)(intptr_t)bs))
@@ -70,10 +71,14 @@ static coroutine_fn void nbd_read_reply_entry(void *opaque)
     NBDClientSession *s = opaque;
     uint64_t i;
     int ret;
+    Error *local_err;
 
     for (;;) {
         assert(s->reply.handle == 0);
-        ret = nbd_receive_reply(s->ioc, &s->reply);
+        ret = nbd_receive_reply(s->ioc, &s->reply, &local_err);
+        if (ret < 0) {
+            error_report_err(local_err);
+        }
         if (ret <= 0) {
             break;
         }
diff --git a/include/block/nbd.h b/include/block/nbd.h
index a96fb5fceb..e0c64e4981 100644
--- a/include/block/nbd.h
+++ b/include/block/nbd.h
@@ -133,9 +133,10 @@ int nbd_receive_negotiate(QIOChannel *ioc, const char *name, uint16_t *flags,
                           QCryptoTLSCreds *tlscreds, const char *hostname,
                           QIOChannel **outioc,
                           off_t *size, Error **errp);
-int nbd_init(int fd, QIOChannelSocket *sioc, uint16_t flags, off_t size);
+int nbd_init(int fd, QIOChannelSocket *sioc, uint16_t flags, off_t size,
+             Error **errp);
 ssize_t nbd_send_request(QIOChannel *ioc, NBDRequest *request);
-ssize_t nbd_receive_reply(QIOChannel *ioc, NBDReply *reply);
+ssize_t nbd_receive_reply(QIOChannel *ioc, NBDReply *reply, Error **errp);
 int nbd_client(int fd);
 int nbd_disconnect(int fd);
 
diff --git a/nbd/client.c b/nbd/client.c
index f102375504..e41b4fd935 100644
--- a/nbd/client.c
+++ b/nbd/client.c
@@ -627,11 +627,13 @@ fail:
 }
 
 #ifdef __linux__
-int nbd_init(int fd, QIOChannelSocket *sioc, uint16_t flags, off_t size)
+int nbd_init(int fd, QIOChannelSocket *sioc, uint16_t flags, off_t size,
+             Error **errp)
 {
     unsigned long sectors = size / BDRV_SECTOR_SIZE;
     if (size / BDRV_SECTOR_SIZE != sectors) {
-        LOG("Export size %lld too large for 32-bit kernel", (long long) size);
+        error_setg(errp, "Export size %lld too large for 32-bit kernel",
+                   (long long) size);
         return -E2BIG;
     }
 
@@ -639,7 +641,7 @@ int nbd_init(int fd, QIOChannelSocket *sioc, uint16_t flags, off_t size)
 
     if (ioctl(fd, NBD_SET_SOCK, (unsigned long) sioc->fd) < 0) {
         int serrno = errno;
-        LOG("Failed to set NBD socket");
+        error_setg(errp, "Failed to set NBD socket");
         return -serrno;
     }
 
@@ -647,7 +649,7 @@ int nbd_init(int fd, QIOChannelSocket *sioc, uint16_t flags, off_t size)
 
     if (ioctl(fd, NBD_SET_BLKSIZE, (unsigned long)BDRV_SECTOR_SIZE) < 0) {
         int serrno = errno;
-        LOG("Failed setting NBD block size");
+        error_setg(errp, "Failed setting NBD block size");
         return -serrno;
     }
 
@@ -659,7 +661,7 @@ int nbd_init(int fd, QIOChannelSocket *sioc, uint16_t flags, off_t size)
 
     if (ioctl(fd, NBD_SET_SIZE_BLOCKS, sectors) < 0) {
         int serrno = errno;
-        LOG("Failed setting size (in blocks)");
+        error_setg(errp, "Failed setting size (in blocks)");
         return -serrno;
     }
 
@@ -670,12 +672,12 @@ int nbd_init(int fd, QIOChannelSocket *sioc, uint16_t flags, off_t size)
 
             if (ioctl(fd, BLKROSET, (unsigned long) &read_only) < 0) {
                 int serrno = errno;
-                LOG("Failed setting read-only attribute");
+                error_setg(errp, "Failed setting read-only attribute");
                 return -serrno;
             }
         } else {
             int serrno = errno;
-            LOG("Failed setting flags");
+            error_setg(errp, "Failed setting flags");
             return -serrno;
         }
     }
@@ -758,19 +760,19 @@ ssize_t nbd_send_request(QIOChannel *ioc, NBDRequest *request)
     return write_sync(ioc, buf, sizeof(buf), NULL);
 }
 
-ssize_t nbd_receive_reply(QIOChannel *ioc, NBDReply *reply)
+ssize_t nbd_receive_reply(QIOChannel *ioc, NBDReply *reply, Error **errp)
 {
     uint8_t buf[NBD_REPLY_SIZE];
     uint32_t magic;
     ssize_t ret;
 
-    ret = read_sync_eof(ioc, buf, sizeof(buf), NULL);
+    ret = read_sync_eof(ioc, buf, sizeof(buf), errp);
     if (ret <= 0) {
         return ret;
     }
 
     if (ret != sizeof(buf)) {
-        LOG("read failed");
+        error_setg(errp, "read failed");
         return -EINVAL;
     }
 
@@ -788,7 +790,7 @@ ssize_t nbd_receive_reply(QIOChannel *ioc, NBDReply *reply)
 
     if (reply->error == ESHUTDOWN) {
         /* This works even on mingw which lacks a native ESHUTDOWN */
-        LOG("server shutting down");
+        error_setg(errp, "server shutting down");
         return -EINVAL;
     }
     TRACE("Got reply: { magic = 0x%" PRIx32 ", .error = % " PRId32
@@ -796,7 +798,7 @@ ssize_t nbd_receive_reply(QIOChannel *ioc, NBDReply *reply)
           magic, reply->error, reply->handle);
 
     if (magic != NBD_REPLY_MAGIC) {
-        LOG("invalid magic (got 0x%" PRIx32 ")", magic);
+        error_setg(errp, "invalid magic (got 0x%" PRIx32 ")", magic);
         return -EINVAL;
     }
     return sizeof(buf);
diff --git a/qemu-nbd.c b/qemu-nbd.c
index e080fb7c75..83b8b3e1d9 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -288,8 +288,9 @@ static void *nbd_client_thread(void *arg)
         goto out_socket;
     }
 
-    ret = nbd_init(fd, sioc, nbdflags, size);
+    ret = nbd_init(fd, sioc, nbdflags, size, &local_error);
     if (ret < 0) {
+        error_report_err(local_error);
         goto out_fd;
     }
 
-- 
2.11.1

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

end of thread, other threads:[~2017-05-26 13:43 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-19 11:20 [Qemu-devel] [PULL 00/20] Misc patches for 2017-05-19 Paolo Bonzini
2017-05-19 11:20 ` [Qemu-devel] [PULL 01/20] mc146818rtc: update periodic timer only if it is needed Paolo Bonzini
2017-05-19 11:20 ` [Qemu-devel] [PULL 02/20] mc146818rtc: precisely count the clock for periodic timer Paolo Bonzini
2017-05-19 11:20 ` [Qemu-devel] [PULL 03/20] mc146818rtc: ensure LOST_TICK_POLICY_SLEW is only enabled on TARGET_I386 Paolo Bonzini
2017-05-19 11:20 ` [Qemu-devel] [PULL 04/20] mc146818rtc: drop unnecessary '#ifdef TARGET_I386' Paolo Bonzini
2017-05-19 11:20 ` [Qemu-devel] [PULL 05/20] mc146818rtc: embrace all x86 specific code Paolo Bonzini
2017-05-19 11:20 ` [Qemu-devel] [PULL 06/20] kvm: irqchip: trace changes on msi add/remove Paolo Bonzini
2017-05-19 11:20 ` [Qemu-devel] [PULL 07/20] msix: trace control bit write op Paolo Bonzini
2017-05-19 11:21 ` [Qemu-devel] [PULL 08/20] kvm: irqchip: skip update msi when disabled Paolo Bonzini
2017-05-19 11:21 ` [Qemu-devel] [PULL 09/20] Check the return value of fcntl in qemu_set_cloexec Paolo Bonzini
2017-05-19 11:21 ` [Qemu-devel] [PULL 10/20] nbd: strict nbd_wr_syncv Paolo Bonzini
2017-05-19 11:21 ` [Qemu-devel] [PULL 11/20] nbd: read_sync and friends: return 0 on success Paolo Bonzini
2017-05-19 11:21 ` [Qemu-devel] [PULL 12/20] nbd: add errp parameter to nbd_wr_syncv() Paolo Bonzini
2017-05-19 11:21 ` [Qemu-devel] [PULL 13/20] nbd: add errp to read_sync, write_sync and drop_sync Paolo Bonzini
2017-05-19 11:21 ` [Qemu-devel] [PULL 14/20] nbd/client.c: use errp instead of LOG Paolo Bonzini
2017-05-26 11:09   ` [Qemu-devel] [PATCH v2] " Vladimir Sementsov-Ogievskiy
2017-05-26 13:43     ` Eric Blake
2017-05-19 11:21 ` [Qemu-devel] [PULL 15/20] exec: simplify phys_page_find() params Paolo Bonzini
2017-05-19 11:21 ` [Qemu-devel] [PULL 16/20] virtio-scsi: Unset hotplug handler when unrealize Paolo Bonzini
2017-05-19 11:21 ` [Qemu-devel] [PULL 17/20] vhost-user-scsi: Introduce vhost-user-scsi host device Paolo Bonzini
2017-05-19 11:21 ` [Qemu-devel] [PULL 18/20] vhost-user-scsi: Introduce a vhost-user-scsi sample application Paolo Bonzini
2017-05-19 11:21 ` [Qemu-devel] [PULL 19/20] target/i386: enable A20 automatically in system management mode Paolo Bonzini
2017-05-19 11:21 ` [Qemu-devel] [PULL 20/20] target/i386: use multiple CPU AddressSpaces Paolo Bonzini
2017-05-19 12:41 ` [Qemu-devel] [PULL 00/20] Misc patches for 2017-05-19 no-reply
2017-05-19 15:51   ` Stefan Hajnoczi
2017-05-19 16:09     ` Paolo Bonzini
2017-05-19 15:49 ` Stefan Hajnoczi
  -- strict thread matches above, loose matches on Subject: below --
2017-05-16  9:45 [Qemu-devel] [PATCH 5/5] nbd/client.c: use errp instead of LOG Vladimir Sementsov-Ogievskiy
2017-05-16 11:09 ` [Qemu-devel] [PATCH v2] " Vladimir Sementsov-Ogievskiy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.