qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL for-5.0 0/4] Block patches
@ 2020-05-01  8:26 Stefan Hajnoczi
  2020-05-01  8:26 ` [PULL for-5.0 1/4] fuzz: select fuzz target using executable name Stefan Hajnoczi
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Hajnoczi @ 2020-05-01  8:26 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Fam Zheng, Thomas Huth, Alex Williamson, qemu-block,
	Peter Maydell, Laurent Vivier, Stefan Weil, Juan Quintela,
	Peter Lieven, Yuval Shaia, Dr. David Alan Gilbert, Max Reitz,
	Alexander Bulekov, Bandan Das, Gerd Hoffmann, Stefan Hajnoczi,
	Paolo Bonzini, Ronnie Sahlberg, Markus Armbruster

The following changes since commit 27c94566379069fb8930bb1433dcffbf7df3203d:

  Merge remote-tracking branch 'remotes/edgar/tags/edgar/xilinx-next-2020-04-30.for-upstream' into staging (2020-04-30 16:47:23 +0100)

are available in the Git repository at:

  https://github.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to cc1adc4488059ac16d4d2772a7aa7cd1323deeca:

  lockable: Replace locks with lock guard macros (2020-05-01 09:19:25 +0100)

----------------------------------------------------------------
Pull request

Fix the QEMU_LOCK_GUARD() macros, use them more widely, and allow fuzzer
targets to be invoked depending on argv[0].

----------------------------------------------------------------

Alexander Bulekov (1):
  fuzz: select fuzz target using executable name

Daniel Brodsky (2):
  lockable: fix __COUNTER__ macro to be referenced properly
  lockable: replaced locks with lock guard macros where appropriate

Simran Singhal (1):
  lockable: Replace locks with lock guard macros

 include/qemu/lockable.h |  7 +++---
 include/qemu/rcu.h      |  2 +-
 block/iscsi.c           |  7 ++----
 block/nfs.c             | 51 +++++++++++++++++++----------------------
 cpus-common.c           | 14 ++++-------
 hw/display/qxl.c        | 43 ++++++++++++++++------------------
 hw/hyperv/hyperv.c      | 15 ++++++------
 hw/rdma/rdma_backend.c  | 50 ++++++++++++++++++++--------------------
 hw/rdma/rdma_rm.c       |  3 +--
 hw/vfio/platform.c      |  5 ++--
 migration/migration.c   |  3 +--
 migration/multifd.c     |  8 +++----
 migration/ram.c         |  3 +--
 monitor/misc.c          |  4 +---
 tests/qtest/fuzz/fuzz.c | 19 ++++++++-------
 ui/spice-display.c      | 14 +++++------
 util/log.c              |  4 ++--
 util/qemu-timer.c       | 17 +++++++-------
 util/rcu.c              |  8 +++----
 util/thread-pool.c      |  3 +--
 util/vfio-helpers.c     |  5 ++--
 slirp                   |  2 +-
 22 files changed, 133 insertions(+), 154 deletions(-)

-- 
2.25.3


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

* [PULL for-5.0 1/4] fuzz: select fuzz target using executable name
  2020-05-01  8:26 [PULL for-5.0 0/4] Block patches Stefan Hajnoczi
@ 2020-05-01  8:26 ` Stefan Hajnoczi
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2020-05-01  8:26 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Peter Maydell, Ronnie Sahlberg, Yuval Shaia,
	Gerd Hoffmann, qemu-block, Juan Quintela, Markus Armbruster,
	Laurent Vivier, Thomas Huth, Stefan Weil, Peter Lieven,
	Dr. David Alan Gilbert, Alexander Bulekov, Alex Williamson,
	Stefan Hajnoczi, Kevin Wolf, Darren Kenny, Bandan Das, Max Reitz,
	Paolo Bonzini

From: Alexander Bulekov <alxndr@bu.edu>

The fuzzers are built into a binary (e.g. qemu-fuzz-i386). To select the
device to fuzz/fuzz target, we usually use the --fuzz-target= argument.
This commit allows the fuzz-target to be specified using the name of the
executable. If the executable name ends with -target-FUZZ_TARGET, then
we select the fuzz target based on this name, rather than the
--fuzz-target argument. This is useful for systems such as oss-fuzz
where we don't have control of the arguments passed to the fuzzer.

[Fixed incorrect indentation.
--Stefan]

Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Message-id: 20200421182230.6313-1-alxndr@bu.edu
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 tests/qtest/fuzz/fuzz.c | 19 +++++++++++--------
 slirp                   |  2 +-
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c
index 0d78ac8d36..f5c923852e 100644
--- a/tests/qtest/fuzz/fuzz.c
+++ b/tests/qtest/fuzz/fuzz.c
@@ -91,6 +91,7 @@ static void usage(char *path)
         printf(" * %s  : %s\n", tmp->target->name,
                 tmp->target->description);
     }
+    printf("Alternatively, add -target-FUZZ_TARGET to the executable name\n");
     exit(0);
 }
 
@@ -143,18 +144,20 @@ int LLVMFuzzerInitialize(int *argc, char ***argv, char ***envp)
     module_call_init(MODULE_INIT_QOM);
     module_call_init(MODULE_INIT_LIBQOS);
 
-    if (*argc <= 1) {
+    target_name = strstr(**argv, "-target-");
+    if (target_name) {        /* The binary name specifies the target */
+        target_name += strlen("-target-");
+    } else if (*argc > 1) {  /* The target is specified as an argument */
+        target_name = (*argv)[1];
+        if (!strstr(target_name, "--fuzz-target=")) {
+            usage(**argv);
+        }
+        target_name += strlen("--fuzz-target=");
+    } else {
         usage(**argv);
     }
 
     /* Identify the fuzz target */
-    target_name = (*argv)[1];
-    if (!strstr(target_name, "--fuzz-target=")) {
-        usage(**argv);
-    }
-
-    target_name += strlen("--fuzz-target=");
-
     fuzz_target = fuzz_get_target(target_name);
     if (!fuzz_target) {
         usage(**argv);
diff --git a/slirp b/slirp
index 2faae0f778..55ab21c9a3 160000
--- a/slirp
+++ b/slirp
@@ -1 +1 @@
-Subproject commit 2faae0f778f818fadc873308f983289df697eb93
+Subproject commit 55ab21c9a36852915b81f1b41ebaf3b6509dd8ba
-- 
2.25.3


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

end of thread, other threads:[~2020-05-01  8:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-01  8:26 [PULL for-5.0 0/4] Block patches Stefan Hajnoczi
2020-05-01  8:26 ` [PULL for-5.0 1/4] fuzz: select fuzz target using executable name Stefan Hajnoczi

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