From patchwork Mon Aug 20 12:01:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emanuele Giuseppe Esposito X-Patchwork-Id: 959636 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Db5MFDOB"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vCBB227Kz9s3C for ; Mon, 20 Aug 2018 22:03:14 +1000 (AEST) Received: from localhost ([::1]:46654 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fritr-0005jb-ST for incoming@patchwork.ozlabs.org; Mon, 20 Aug 2018 08:03:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frit7-0005jQ-5u for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1frit5-0002R2-6X for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:25 -0400 Received: from mail-ed1-x543.google.com ([2a00:1450:4864:20::543]:46342) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1frit4-0002Qs-W9; Mon, 20 Aug 2018 08:02:23 -0400 Received: by mail-ed1-x543.google.com with SMTP id o8-v6so8316725edt.13; Mon, 20 Aug 2018 05:02:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uSXtyAIca98e0rGST+N0DtLo5Ug3mCqpiAl8gcsZQOU=; b=Db5MFDOBgYnbuizkEqqs7QwKNNVEzVIYYWvg7Bv4P7FZMnASyA6bqBYch5RujIPBB5 uZZtkDkwchypE/oJa3gxCuhW4TmMyPpIn9C0kxXSBgBCWB9QdHx4xcwzLFgy7QdqmIqI +29xn4y5T7tXNizwlhasApzhLrt6w2ak37MM5z/vDDKZM4QcRFQ9HdobqVIbtCCtghJh RQHS8es8u4XkSAvXtvcrLS5qaYHI5JLBNljUYTJ29hrn25lE1/2JmLI6qiEVIK/XiD3c 5PgTn8mCTRXK6QW0oXvTxRbLrKKs6rQmqiH1PC/f4gEEI0U47blVJuiSjlo8PV4z9Pul YRiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uSXtyAIca98e0rGST+N0DtLo5Ug3mCqpiAl8gcsZQOU=; b=JVHyPBbUkmZWn5mQviqRISSAUiJN7gAomedShnn5lsJzi+Vy9ocYVoNxt1K96INvgu y/MdLaJWwdWXkgEa67yzz1ok6OBVkYisS1KwpUi6GIf3vZxHe65sKHF+vY5N/fLggmOF 488MJchuPEqz2DfK38QDIWZjsbqtqZNRDDKYY7QHNsikniDyk2lW7lqrHrj47kfX7PeB zpEDP9tVGMRcyCa7lRann+AwYbzVpFLEbyk6YdGu51lXw5LDdZfUprgE6YWTniHmr8hR jbG7TxXqzo9IMuJI8QEN1HW0vV0bb5awtWTfX0ZcEYrjfrAqT0Dq7xXEpZIsldEmijNH YIFA== X-Gm-Message-State: AOUpUlGnPf9rOY7yM4R9WE6+yV5ULbg9NsFrB3XTtuxz1wie4GQlrQu8 qeZ5fiqgicydlBnYmHevI2BkwR4CJv0= X-Google-Smtp-Source: AA+uWPx2wkOs6kUWpAaeWtmPluLj2CbrKto6ZxgJNitv0BaYqaqBIe5g7VP+SEPX+T3JozLLkpA0eg== X-Received: by 2002:a50:8832:: with SMTP id b47-v6mr2949534edb.182.1534766541649; Mon, 20 Aug 2018 05:02:21 -0700 (PDT) Received: from emanuele-MacBookPro.mobile.usilu.net ([194.230.159.211]) by smtp.gmail.com with ESMTPSA id b20-v6sm1348486edc.30.2018.08.20.05.02.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 05:02:21 -0700 (PDT) From: Emanuele Giuseppe Esposito To: qemu-devel@nongnu.org Date: Mon, 20 Aug 2018 14:01:58 +0200 Message-Id: <20180820120213.11095-2-e.emanuelegiuseppe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> References: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::543 Subject: [Qemu-devel] [PATCH 01/16] test/qgraph: arm/smdkc210 machine node X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Dmitry Fleytman , Fam Zheng , =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Amit Shah , Jason Wang , "Michael S. Tsirkin" , Emanuele Giuseppe Esposito , Alexander Graf , Greg Kurz , Keith Busch , qemu-ppc@nongnu.org, Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , John Snow , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Add arm/smdkc210 machine machine to the graph. This machine contains generic-sdhci, so its constructor must take care of setting it properly when called. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 9 ++-- tests/libqos/smdkc210-machine.c | 82 +++++++++++++++++++++++++++++++++ tests/sdhci-test.c | 7 +-- 3 files changed, 92 insertions(+), 6 deletions(-) create mode 100644 tests/libqos/smdkc210-machine.c diff --git a/tests/Makefile.include b/tests/Makefile.include index 30355058fc..b4a9b28706 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -756,10 +756,13 @@ libqos-imx-obj-y = $(libqos-obj-y) tests/libqos/i2c-imx.o libqos-usb-obj-y = $(libqos-spapr-obj-y) $(libqos-pc-obj-y) tests/libqos/usb.o libqos-virtio-obj-y = $(libqos-spapr-obj-y) $(libqos-pc-obj-y) tests/libqos/virtio.o tests/libqos/virtio-pci.o tests/libqos/virtio-mmio.o tests/libqos/malloc-generic.o -libqgraph-machines-obj-y = tests/libqos/x86_64_pc-machine.o -libqgraph-machines-obj-y += tests/libqos/raspi2-machine.o +libqgraph-arm-machines-obj-y = tests/libqos/raspi2-machine.o +libqgraph-arm-machines-obj-y += tests/libqos/virt-machine.o +libqgraph-arm-machines-obj-y += tests/libqos/smdkc210-machine.o + +libqgraph-machines-obj-y = $(libqgraph-arm-machines-obj-y) +libqgraph-machines-obj-y += tests/libqos/x86_64_pc-machine.o libqgraph-machines-obj-y += tests/libqos/ppc64_pseries-machine.o -libqgraph-machines-obj-y += tests/libqos/virt-machine.o libqgraph-virtio-obj-y = tests/libqos/virtio-serial.o libqgraph-virtio-obj-y += tests/libqos/virtio-9p.o diff --git a/tests/libqos/smdkc210-machine.c b/tests/libqos/smdkc210-machine.c new file mode 100644 index 0000000000..542d426209 --- /dev/null +++ b/tests/libqos/smdkc210-machine.c @@ -0,0 +1,82 @@ +/* + * libqos driver framework + * + * Copyright (c) 2018 Emanuele Giuseppe Esposito + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see + */ + +#include "qemu/osdep.h" +#include "libqtest.h" +#include "libqos/malloc.h" +#include "libqos/qgraph.h" +#include "sdhci.h" + +typedef struct QSmdkc210Machine QSmdkc210Machine; + +struct QSmdkc210Machine { + QOSGraphObject obj; + QGuestAllocator *alloc; + QSDHCI_MemoryMapped sdhci; +}; + +static void smdkc210_destructor(QOSGraphObject *obj) +{ + g_free(obj); +} + +static void *smdkc210_get_driver(void *object, const char *interface) +{ + QSmdkc210Machine *machine = object; + if (!g_strcmp0(interface, "memory")) { + return &machine->alloc; + } + + fprintf(stderr, "%s not present in arm/smdkc210\n", interface); + g_assert_not_reached(); +} + +static QOSGraphObject *smdkc210_get_device(void *obj, const char *device) +{ + QSmdkc210Machine *machine = obj; + if (!g_strcmp0(device, "generic-sdhci")) { + return &machine->sdhci.obj; + } + + fprintf(stderr, "%s not present in arm/smdkc210\n", device); + g_assert_not_reached(); +} + +static void *qos_create_machine_arm_smdkc210(void) +{ + QSmdkc210Machine *machine = g_new0(QSmdkc210Machine, 1); + + machine->obj.get_device = smdkc210_get_device; + machine->obj.get_driver = smdkc210_get_driver; + machine->obj.destructor = smdkc210_destructor; + qos_init_sdhci_smm(&machine->sdhci, 0x12510000, &(QSDHCIProperties) { + .version = 2, + .baseclock = 0, + .capab.sdma = true, + .capab.reg = 0x5e80080, + }); + return &machine->obj; +} + +static void smdkc210_register_nodes(void) +{ + qos_node_create_machine("arm/smdkc210", qos_create_machine_arm_smdkc210); + qos_node_contains("arm/smdkc210", "generic-sdhci", NULL); +} + +libqos_init(smdkc210_register_nodes); diff --git a/tests/sdhci-test.c b/tests/sdhci-test.c index ed29839f3d..9f4cd9209a 100644 --- a/tests/sdhci-test.c +++ b/tests/sdhci-test.c @@ -51,12 +51,13 @@ FIELD(SDHC_CAPAB, DRIVER, 36, 3); /* since v3 */ BCM2835 { "arm", "raspi2", {0x3f300000, 3, 52, {0, 0x052134b4} } }, - * - * FIXME: the following drivers are missing: - * + Exynos4210 { "arm", "smdkc210", {0x12510000, 2, 0, {1, 0x5e80080} } }, + * + * FIXME: the following drivers are missing: + * i.MX 6 { "arm", "sabrelite", From patchwork Mon Aug 20 12:01:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emanuele Giuseppe Esposito X-Patchwork-Id: 959644 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="e3Vsekx9"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vCK457C7z9s3C for ; Mon, 20 Aug 2018 22:09:12 +1000 (AEST) Received: from localhost ([::1]:46687 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frize-0002oH-6Y for incoming@patchwork.ozlabs.org; Mon, 20 Aug 2018 08:09:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fritC-0005mY-PN for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1frit6-0002RT-Sa for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:30 -0400 Received: from mail-ed1-x541.google.com ([2a00:1450:4864:20::541]:41453) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1frit6-0002RC-Lc; Mon, 20 Aug 2018 08:02:24 -0400 Received: by mail-ed1-x541.google.com with SMTP id f38-v6so817617edd.8; Mon, 20 Aug 2018 05:02:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7ezFTu2dOshlwEmcF4CgUzi67nKAw10BGadd5cWftT4=; b=e3Vsekx92ys0j4ZaMZS/Cj0nb+B0j/aM4gdBrjcEVMG6dv3PC9FCsFF2eawgJZDC6f Ga6au9u9ctKC1r2L/EVb3MW2FecZe0siAMai+KlO167pIiJcDgnEXWOZvYrd2KoKYTy0 P9PblLhObjj6EpDSRxL4ySfZfsdRbhWpCcKXAzaidoaLDu64Y6QrLSAPqDXjuq9tKRuX /wHVRY8vajiiVSzXR8zQqP2QHipRB+R42JwXAZgTWg/LMUXdWzZJWYtrpceRgiBgzXEy IQgw6WjhCrm2g3A35g0S7wiel0pvjO6sf6wEA12EmYmhKpRQ+s+LV5i8atuBXgMG0V/3 zSAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7ezFTu2dOshlwEmcF4CgUzi67nKAw10BGadd5cWftT4=; b=aNRIcmqjGXKPY5bpoEa9nrn1R29jaABJ3ZhRvJGfwH8lAmHoXqCjBqqzZTlzBCrMzJ tfzGx8NziW3QSbNW63OXCokrHydjZyHqgk1ImzRRhpS9bYNj8QKnnpPwbqCVu2fZjlDs l4gqvv5E/DbQPfN4/IQEBN1/erh7JaanPUmAuxdrjbmeS6BQ/X6Dn+XpW63t0ywPgctK P/eh2PGnw6w++JAWv1PamC4L/uxD9XnlBJXnqiMRa8Yrf9e1/lYspnF4x8RSt32g7Nc/ F87N0ZFoaO/h3fj5gtgdgNkzJWYFcwDF/MlncAdTZPRWVz1Y9/IuQNGHV5F6MBJJkOIt FUbw== X-Gm-Message-State: AOUpUlEYd05s/3C0Jmhlgjkgv6uANyjKfitjmGOWpFmNurO4p9Wl31Hp FRapqzeA/sNoNBxIWAxu4m2sEhwEFsM= X-Google-Smtp-Source: AA+uWPyl3zCPa/20HNDVlxyBvoWcxH2rE2NqE3dszUZwMp0ipENAumNsx8J4KxS5XHDua0jqcIiCLg== X-Received: by 2002:a50:dccc:: with SMTP id v12-v6mr54207424edk.82.1534766543302; Mon, 20 Aug 2018 05:02:23 -0700 (PDT) Received: from emanuele-MacBookPro.mobile.usilu.net ([194.230.159.211]) by smtp.gmail.com with ESMTPSA id b20-v6sm1348486edc.30.2018.08.20.05.02.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 05:02:22 -0700 (PDT) From: Emanuele Giuseppe Esposito To: qemu-devel@nongnu.org Date: Mon, 20 Aug 2018 14:01:59 +0200 Message-Id: <20180820120213.11095-3-e.emanuelegiuseppe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> References: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::541 Subject: [Qemu-devel] [PATCH 02/16] test/qgraph: arm/sabrelite machine node X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Dmitry Fleytman , Fam Zheng , =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Amit Shah , Jason Wang , "Michael S. Tsirkin" , Emanuele Giuseppe Esposito , Alexander Graf , Greg Kurz , Keith Busch , qemu-ppc@nongnu.org, Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , John Snow , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Add arm/sabrelite machine to the graph. This machine contains generic-sdhci, so its constructor must take care of setting it properly when called. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 1 + tests/libqos/sabrelite-machine.c | 82 ++++++++++++++++++++++++++++++++ tests/sdhci-test.c | 7 +-- 3 files changed, 87 insertions(+), 3 deletions(-) create mode 100644 tests/libqos/sabrelite-machine.c diff --git a/tests/Makefile.include b/tests/Makefile.include index b4a9b28706..4690d5f5e9 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -759,6 +759,7 @@ libqos-virtio-obj-y = $(libqos-spapr-obj-y) $(libqos-pc-obj-y) tests/libqos/virt libqgraph-arm-machines-obj-y = tests/libqos/raspi2-machine.o libqgraph-arm-machines-obj-y += tests/libqos/virt-machine.o libqgraph-arm-machines-obj-y += tests/libqos/smdkc210-machine.o +libqgraph-arm-machines-obj-y += tests/libqos/sabrelite-machine.o libqgraph-machines-obj-y = $(libqgraph-arm-machines-obj-y) libqgraph-machines-obj-y += tests/libqos/x86_64_pc-machine.o diff --git a/tests/libqos/sabrelite-machine.c b/tests/libqos/sabrelite-machine.c new file mode 100644 index 0000000000..1d8c39e209 --- /dev/null +++ b/tests/libqos/sabrelite-machine.c @@ -0,0 +1,82 @@ +/* + * libqos driver framework + * + * Copyright (c) 2018 Emanuele Giuseppe Esposito + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see + */ + +#include "qemu/osdep.h" +#include "libqtest.h" +#include "libqos/malloc.h" +#include "libqos/qgraph.h" +#include "sdhci.h" + +typedef struct QSabreliteMachine QSabreliteMachine; + +struct QSabreliteMachine { + QOSGraphObject obj; + QGuestAllocator *alloc; + QSDHCI_MemoryMapped sdhci; +}; + +static void sabrelite_destructor(QOSGraphObject *obj) +{ + g_free(obj); +} + +static void *sabrelite_get_driver(void *object, const char *interface) +{ + QSabreliteMachine *machine = object; + if (!g_strcmp0(interface, "memory")) { + return &machine->alloc; + } + + fprintf(stderr, "%s not present in arm/sabrelite\n", interface); + g_assert_not_reached(); +} + +static QOSGraphObject *sabrelite_get_device(void *obj, const char *device) +{ + QSabreliteMachine *machine = obj; + if (!g_strcmp0(device, "generic-sdhci")) { + return &machine->sdhci.obj; + } + + fprintf(stderr, "%s not present in arm/sabrelite\n", device); + g_assert_not_reached(); +} + +static void *qos_create_machine_arm_sabrelite(void) +{ + QSabreliteMachine *machine = g_new0(QSabreliteMachine, 1); + + machine->obj.get_device = sabrelite_get_device; + machine->obj.get_driver = sabrelite_get_driver; + machine->obj.destructor = sabrelite_destructor; + qos_init_sdhci_smm(&machine->sdhci, 0x02190000, &(QSDHCIProperties) { + .version = 3, + .baseclock = 0, + .capab.sdma = true, + .capab.reg = 0x057834b4, + }); + return &machine->obj; +} + +static void sabrelite_register_nodes(void) +{ + qos_node_create_machine("arm/sabrelite", qos_create_machine_arm_sabrelite); + qos_node_contains("arm/sabrelite", "generic-sdhci", NULL); +} + +libqos_init(sabrelite_register_nodes); diff --git a/tests/sdhci-test.c b/tests/sdhci-test.c index 9f4cd9209a..31ecc06159 100644 --- a/tests/sdhci-test.c +++ b/tests/sdhci-test.c @@ -55,14 +55,15 @@ FIELD(SDHC_CAPAB, DRIVER, 36, 3); /* since v3 */ Exynos4210 { "arm", "smdkc210", {0x12510000, 2, 0, {1, 0x5e80080} } }, - * - * FIXME: the following drivers are missing: - * i.MX 6 { "arm", "sabrelite", {0x02190000, 3, 0, {1, 0x057834b4} } }, + * + * FIXME: the following drivers are missing: + * + Zynq-7000 { "arm", "xilinx-zynq-a9", Datasheet: UG585 (v1.12.1) {0xe0100000, 2, 0, {1, 0x69ec0080} } }, From patchwork Mon Aug 20 12:02:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emanuele Giuseppe Esposito X-Patchwork-Id: 959640 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KG2HUhgI"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vCFl4dZFz9s3C for ; Mon, 20 Aug 2018 22:06:18 +1000 (AEST) Received: from localhost ([::1]:46670 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1friwo-0000OC-Qf for incoming@patchwork.ozlabs.org; Mon, 20 Aug 2018 08:06:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60818) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frit9-0005kB-Ql for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1frit8-0002SR-Qo for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:27 -0400 Received: from mail-ed1-x543.google.com ([2a00:1450:4864:20::543]:41455) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1frit8-0002S3-L8; Mon, 20 Aug 2018 08:02:26 -0400 Received: by mail-ed1-x543.google.com with SMTP id f38-v6so817670edd.8; Mon, 20 Aug 2018 05:02:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8NDLC6k8bY3YHOL6De2KLx2XSgDYNATkqOfW7DJBFoc=; b=KG2HUhgIhazhAPmGkh5y5XzFkBMR8wYZjew9bHnKQ6cpD0m5vuCWe6my04zXQLa0OE jrANCBkzZsWawxnv2RKU6L8mcFCJg/l9fSvYTivvfmY12B5VouTBBgc/vgUP0vjmmcWr NAyHOfaxcuFbE80NV2GPqRvGKV6XIfjGH2wKTIqAk5ZmvyXlHUPOnH5wwXn77sl1rK2J 5jWPp6qUyqdJN83uq/52Fe6JTNS2M93QV9lmWSI+wEbvxveV+dBjgh8Lcqq2Pys49VLu MnqrUrCVZoigiCXZ7+BmkisRQ08tsrVsKP18WRsvoaQtJLD/uoxjJI6NFmbsbEeshLhD /kqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8NDLC6k8bY3YHOL6De2KLx2XSgDYNATkqOfW7DJBFoc=; b=YKfP9pzPudgZouFJUQHQt5e8jsa/5f5AQGm7UqXlg2bcqu1dVedepryaAbRSBFbBRs qG3+p50QjqSU1DbECWc2GGKmMllIVtYv7095xbcfpnmJjGpV/uewjg7uwKldL15/wNbn vnjEDRvAMplrb99ogS4/VW2D1LwbBEQSo2P5Fv0Hg1UGNpExSoNNq0AAjy6CfCNMSM3h 0n9TDTsfHNuQFu2YaNyKOH7N3+5HhOwbIw1E3VhxyZtWi2RWYUwzHUdc6mgC531jW77U 6IFIYh+UxFwTJPKbq+fTICAmI6iAsUnRkZEfaoHxxWfsW5/eAUVmUBxb+glAowxyuegE UNvA== X-Gm-Message-State: AOUpUlETA56OpjyFDDCbFRbTeD52ZCtHjWa7/EMxYwys0Q8Eo+WXyflr pjD5OeySz7QKoOL1JxQPEBoPebj6Ti4= X-Google-Smtp-Source: AA+uWPy3cMuNWXRNXLmu/85T4YgGaRd2aiJIi4SEvLUGxsHbVTRtiKSHtU3Hi8HSmDT1LrPSDpdc9A== X-Received: by 2002:a50:de8e:: with SMTP id c14-v6mr54664889edl.196.1534766545370; Mon, 20 Aug 2018 05:02:25 -0700 (PDT) Received: from emanuele-MacBookPro.mobile.usilu.net ([194.230.159.211]) by smtp.gmail.com with ESMTPSA id b20-v6sm1348486edc.30.2018.08.20.05.02.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 05:02:24 -0700 (PDT) From: Emanuele Giuseppe Esposito To: qemu-devel@nongnu.org Date: Mon, 20 Aug 2018 14:02:00 +0200 Message-Id: <20180820120213.11095-4-e.emanuelegiuseppe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> References: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::543 Subject: [Qemu-devel] [PATCH 03/16] test/qgraph: arm/xlinx-zynq-a9 machine node X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Dmitry Fleytman , Fam Zheng , =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Amit Shah , Jason Wang , "Michael S. Tsirkin" , Emanuele Giuseppe Esposito , Alexander Graf , Greg Kurz , Keith Busch , qemu-ppc@nongnu.org, Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , John Snow , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Add xlinx-zynq-a9 machine to the graph. This machine contains generic-sdhci, so its constructor must take care of setting it properly when called. Signed-off-by: Emanuele Giuseppe Esposito Acked-by: Alistair Francis --- tests/Makefile.include | 1 + tests/libqos/xilinx-zynq-a9-machine.c | 84 +++++++++++++++++++++++++++ tests/sdhci-test.c | 8 +-- 3 files changed, 89 insertions(+), 4 deletions(-) create mode 100644 tests/libqos/xilinx-zynq-a9-machine.c diff --git a/tests/Makefile.include b/tests/Makefile.include index 4690d5f5e9..d559218b1c 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -760,6 +760,7 @@ libqgraph-arm-machines-obj-y = tests/libqos/raspi2-machine.o libqgraph-arm-machines-obj-y += tests/libqos/virt-machine.o libqgraph-arm-machines-obj-y += tests/libqos/smdkc210-machine.o libqgraph-arm-machines-obj-y += tests/libqos/sabrelite-machine.o +libqgraph-arm-machines-obj-y += tests/libqos/xilinx-zynq-a9-machine.o libqgraph-machines-obj-y = $(libqgraph-arm-machines-obj-y) libqgraph-machines-obj-y += tests/libqos/x86_64_pc-machine.o diff --git a/tests/libqos/xilinx-zynq-a9-machine.c b/tests/libqos/xilinx-zynq-a9-machine.c new file mode 100644 index 0000000000..025cd80eb2 --- /dev/null +++ b/tests/libqos/xilinx-zynq-a9-machine.c @@ -0,0 +1,84 @@ +/* + * libqos driver framework + * + * Copyright (c) 2018 Emanuele Giuseppe Esposito + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see + */ + +#include "qemu/osdep.h" +#include "libqtest.h" +#include "libqos/malloc.h" +#include "libqos/qgraph.h" +#include "sdhci.h" + +typedef struct QXilinx_zynq_a9Machine QXilinx_zynq_a9Machine; + +struct QXilinx_zynq_a9Machine { + QOSGraphObject obj; + QGuestAllocator *alloc; + QSDHCI_MemoryMapped sdhci; +}; + +static void xilinx_zynq_a9_destructor(QOSGraphObject *obj) +{ + g_free(obj); +} + +static void *xilinx_zynq_a9_get_driver(void *object, const char *interface) +{ + QXilinx_zynq_a9Machine *machine = object; + if (!g_strcmp0(interface, "memory")) { + return &machine->alloc; + } + + fprintf(stderr, "%s not present in arm/xilinx-zynq-a9\n", interface); + g_assert_not_reached(); +} + +static QOSGraphObject *xilinx_zynq_a9_get_device(void *obj, const char *device) +{ + QXilinx_zynq_a9Machine *machine = obj; + if (!g_strcmp0(device, "generic-sdhci")) { + return &machine->sdhci.obj; + } + + fprintf(stderr, "%s not present in arm/xilinx-zynq-a9\n", device); + g_assert_not_reached(); +} + +static void *qos_create_machine_arm_xilinx_zynq_a9(void) +{ + QXilinx_zynq_a9Machine *machine = g_new0(QXilinx_zynq_a9Machine, 1); + + machine->obj.get_device = xilinx_zynq_a9_get_device; + machine->obj.get_driver = xilinx_zynq_a9_get_driver; + machine->obj.destructor = xilinx_zynq_a9_destructor; + /* Datasheet: UG585 (v1.12.1) */ + qos_init_sdhci_smm(&machine->sdhci, 0xe0100000, &(QSDHCIProperties) { + .version = 2, + .baseclock = 0, + .capab.sdma = true, + .capab.reg = 0x69ec0080, + }); + return &machine->obj; +} + +static void xilinx_zynq_a9_register_nodes(void) +{ + qos_node_create_machine("arm/xilinx-zynq-a9", + qos_create_machine_arm_xilinx_zynq_a9); + qos_node_contains("arm/xilinx-zynq-a9", "generic-sdhci", NULL); +} + +libqos_init(xilinx_zynq_a9_register_nodes); diff --git a/tests/sdhci-test.c b/tests/sdhci-test.c index 31ecc06159..0a8efd8554 100644 --- a/tests/sdhci-test.c +++ b/tests/sdhci-test.c @@ -60,14 +60,14 @@ FIELD(SDHC_CAPAB, DRIVER, 36, 3); /* since v3 */ { "arm", "sabrelite", {0x02190000, 3, 0, {1, 0x057834b4} } }, - * - * FIXME: the following drivers are missing: - * - Zynq-7000 { "arm", "xilinx-zynq-a9", Datasheet: UG585 (v1.12.1) {0xe0100000, 2, 0, {1, 0x69ec0080} } }, + * + * FIXME: the following drivers are missing: + * + ZynqMP { "aarch64", "xlnx-zcu102", Datasheet: UG1085 (v1.7) {0xff160000, 3, 0, {1, 0x280737ec6481} } }, From patchwork Mon Aug 20 12:02:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emanuele Giuseppe Esposito X-Patchwork-Id: 959641 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nbOYWcAa"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vCFz5MjVz9s3C for ; Mon, 20 Aug 2018 22:06:31 +1000 (AEST) Received: from localhost ([::1]:46673 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frix3-0000a0-8y for incoming@patchwork.ozlabs.org; Mon, 20 Aug 2018 08:06:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fritG-0005pE-Ao for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fritA-0002T4-KE for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:34 -0400 Received: from mail-ed1-x544.google.com ([2a00:1450:4864:20::544]:41990) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fritA-0002Si-B8; Mon, 20 Aug 2018 08:02:28 -0400 Received: by mail-ed1-x544.google.com with SMTP id r4-v6so8313473edp.9; Mon, 20 Aug 2018 05:02:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XNp2wTJ+MZ6PI9a4cxD/4okTS/yRez2brd1gcPmNK/E=; b=nbOYWcAaByBRP3dcYyCet6iqMjQ1/kf3y5WjMfTMp0rgdHAyRuJ3WA6BKPxPuJFr+i YC9VunmK5wKq9lixlMQck6lEoXNbwfUd271/1wa8Gs18bSaMTelqiNAry1/x87f8ycW2 wu9MsjRYolYDkorJy2WonDv0mKvvKSxK3ovlenReovMNxyvLZfpJqsxSllm+YWLtUMAa jrtaA9shDiFY00iNOikYQEyfsIVCfhiaNTtmuJMandGlnU42GZy4MLiTsIK/tFuCexrF ENOtlE/dDna2Any05OCUOkpBaTsYnQQbN7Xrbg6K+KI7yMRis/9tk9yf0GE6BKjiQyz1 qyUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=XNp2wTJ+MZ6PI9a4cxD/4okTS/yRez2brd1gcPmNK/E=; b=OiRGAPsxQDzQGhGD3pyB3IvPt/7lrAITgsrXWSW6fCD+lZ/YMW2Bw3eVfwzJxQgRr6 68eMkeWfsrk4pWbOBxoLAoh/MpKvygnjJUoIJ/eBjjhvasQc0QJ0EhdwuNZeirv6BB0K mzRARq9Br6+cnueiZh9ENNUTLsBZEonyYXhmaXVI0WcMpSZtGjqJ20/0klKIZ6sV/FtU KoTZTSLxYJXD1SdPe6SDIQ08K2VQOfFmwLBJLZ+/i15hCMKmsIO/9H8k25BzbsXgSk1i E8sMiVbzdktkelDLX9Mb0cEC1ZIU0dA6R6zCZBcPcsstBZ8BnkV1Jko9qCE9tyUGwS/m NAaA== X-Gm-Message-State: AOUpUlEVVSwHH6EUR484i/vUs1/IsX2cFyo69kDbYihz3+gFmGd07zRk 0sop6S5cU2tL0DrRBh5v84XaXV1Mqb0= X-Google-Smtp-Source: AA+uWPxNPWQrVgIExIu3CtRofJk6NYnjasivPmdMVLRUx0M75olcbpKC2he5v8kYCXydUp8KVj2WJg== X-Received: by 2002:a50:f69b:: with SMTP id d27-v6mr10445198edn.103.1534766547024; Mon, 20 Aug 2018 05:02:27 -0700 (PDT) Received: from emanuele-MacBookPro.mobile.usilu.net ([194.230.159.211]) by smtp.gmail.com with ESMTPSA id b20-v6sm1348486edc.30.2018.08.20.05.02.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 05:02:26 -0700 (PDT) From: Emanuele Giuseppe Esposito To: qemu-devel@nongnu.org Date: Mon, 20 Aug 2018 14:02:01 +0200 Message-Id: <20180820120213.11095-5-e.emanuelegiuseppe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> References: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::544 Subject: [Qemu-devel] [PATCH 04/16] test/qgraph: aarch64/xlnx-zcu102 machine node X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Dmitry Fleytman , Fam Zheng , =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Amit Shah , Jason Wang , "Michael S. Tsirkin" , Emanuele Giuseppe Esposito , Alexander Graf , Greg Kurz , Keith Busch , qemu-ppc@nongnu.org, Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , John Snow , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Add xlnx-zcu102 machine to the graph. This machine contains generic-sdhci, so its constructor must take care of setting it properly when called. Signed-off-by: Emanuele Giuseppe Esposito Acked-by: Alistair Francis --- tests/Makefile.include | 1 + tests/libqos/xlnx-zcu102-machine.c | 83 ++++++++++++++++++++++++++++++ tests/sdhci-test.c | 51 ------------------ 3 files changed, 84 insertions(+), 51 deletions(-) create mode 100644 tests/libqos/xlnx-zcu102-machine.c diff --git a/tests/Makefile.include b/tests/Makefile.include index d559218b1c..bad4de3d61 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -765,6 +765,7 @@ libqgraph-arm-machines-obj-y += tests/libqos/xilinx-zynq-a9-machine.o libqgraph-machines-obj-y = $(libqgraph-arm-machines-obj-y) libqgraph-machines-obj-y += tests/libqos/x86_64_pc-machine.o libqgraph-machines-obj-y += tests/libqos/ppc64_pseries-machine.o +libqgraph-machines-obj-y += tests/libqos/xlnx-zcu102-machine.o libqgraph-virtio-obj-y = tests/libqos/virtio-serial.o libqgraph-virtio-obj-y += tests/libqos/virtio-9p.o diff --git a/tests/libqos/xlnx-zcu102-machine.c b/tests/libqos/xlnx-zcu102-machine.c new file mode 100644 index 0000000000..9932cf39a8 --- /dev/null +++ b/tests/libqos/xlnx-zcu102-machine.c @@ -0,0 +1,83 @@ +/* + * libqos driver framework + * + * Copyright (c) 2018 Emanuele Giuseppe Esposito + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see + */ + +#include "qemu/osdep.h" +#include "libqtest.h" +#include "libqos/malloc.h" +#include "libqos/qgraph.h" +#include "sdhci.h" + +typedef struct QXlnx_zcu102Machine QXlnx_zcu102Machine; + +struct QXlnx_zcu102Machine { + QOSGraphObject obj; + QGuestAllocator *alloc; + QSDHCI_MemoryMapped sdhci; +}; + +static void xlnx_zcu102_destructor(QOSGraphObject *obj) +{ + g_free(obj); +} + +static void *xlnx_zcu102_get_driver(void *object, const char *interface) +{ + QXlnx_zcu102Machine *machine = object; + if (!g_strcmp0(interface, "memory")) { + return &machine->alloc; + } + + fprintf(stderr, "%s not present in aarch64/xlnx-zcu102\n", interface); + g_assert_not_reached(); +} + +static QOSGraphObject *xlnx_zcu102_get_device(void *obj, const char *device) +{ + QXlnx_zcu102Machine *machine = obj; + if (!g_strcmp0(device, "generic-sdhci")) { + return &machine->sdhci.obj; + } + + fprintf(stderr, "%s not present in aarch64/xlnx-zcu102\n", device); + g_assert_not_reached(); +} + +static void *qos_create_machine_aarch64_xlnx_zcu102(void) +{ + QXlnx_zcu102Machine *machine = g_new0(QXlnx_zcu102Machine, 1); + + machine->obj.get_device = xlnx_zcu102_get_device; + machine->obj.get_driver = xlnx_zcu102_get_driver; + machine->obj.destructor = xlnx_zcu102_destructor; + /* Datasheet: UG1085 (v1.7) */ + qos_init_sdhci_smm(&machine->sdhci, 0xff160000, &(QSDHCIProperties) { + .version = 3, + .baseclock = 0, + .capab.sdma = true, + .capab.reg = 0x280737ec6481 + }); + return &machine->obj; +} + +static void xlnx_zcu102_register_nodes(void) +{ + qos_node_create_machine("aarch64/xlnx-zcu102", qos_create_machine_aarch64_xlnx_zcu102); + qos_node_contains("aarch64/xlnx-zcu102", "generic-sdhci", NULL); +} + +libqos_init(xlnx_zcu102_register_nodes); diff --git a/tests/sdhci-test.c b/tests/sdhci-test.c index 0a8efd8554..deb42be493 100644 --- a/tests/sdhci-test.c +++ b/tests/sdhci-test.c @@ -22,57 +22,6 @@ FIELD(SDHC_CAPAB, SDR, 32, 3); /* since v3 */ FIELD(SDHC_CAPAB, DRIVER, 36, 3); /* since v3 */ #define SDHC_HCVER 0xFE -/** - * Old sdhci_t structure: - * - struct sdhci_t { - const char *arch, *machine; - struct { - uintptr_t addr; - uint8_t version; - uint8_t baseclock; - struct { - bool sdma; - uint64_t reg; - } capab; - } sdhci; - struct { - uint16_t vendor_id, device_id; - } pci; - } - * - * implemented drivers: - * - PC via PCI - { "x86_64", "pc", - {-1, 2, 0, {1, 0x057834b4} }, - .pci = { PCI_VENDOR_ID_REDHAT, PCI_DEVICE_ID_REDHAT_SDHCI } }, - - BCM2835 - { "arm", "raspi2", - {0x3f300000, 3, 52, {0, 0x052134b4} } }, - - Exynos4210 - { "arm", "smdkc210", - {0x12510000, 2, 0, {1, 0x5e80080} } }, - - i.MX 6 - { "arm", "sabrelite", - {0x02190000, 3, 0, {1, 0x057834b4} } }, - - Zynq-7000 - { "arm", "xilinx-zynq-a9", Datasheet: UG585 (v1.12.1) - {0xe0100000, 2, 0, {1, 0x69ec0080} } }, - - * - * FIXME: the following drivers are missing: - * - - ZynqMP - { "aarch64", "xlnx-zcu102", Datasheet: UG1085 (v1.7) - {0xff160000, 3, 0, {1, 0x280737ec6481} } }, - */ - static void check_specs_version(QSDHCI *s, uint8_t version) { uint32_t v; From patchwork Mon Aug 20 12:02:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emanuele Giuseppe Esposito X-Patchwork-Id: 959649 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="C0fa8FM9"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vCP33Fpsz9s4v for ; Mon, 20 Aug 2018 22:12:39 +1000 (AEST) Received: from localhost ([::1]:46724 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frj2z-0006XW-1V for incoming@patchwork.ozlabs.org; Mon, 20 Aug 2018 08:12:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60849) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fritE-0005ng-9F for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fritC-0002TV-6o for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:32 -0400 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]:40970) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fritC-0002TA-0b; Mon, 20 Aug 2018 08:02:30 -0400 Received: by mail-ed1-x52a.google.com with SMTP id f38-v6so817779edd.8; Mon, 20 Aug 2018 05:02:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=P6gL0rsE1N/359Z5EQ1KJEqxJ/cpzBpOKR8U4nC2sio=; b=C0fa8FM9Ah2Wzk0Hg4zfSW1COGanlYDXFarBnxMvVcbOy7m6t5ygaIoOa2nR3Lphoh Bq6Iw1xMojpY0FuM6ZY4sbKQoVs//ZuY2y9vMQ4gMfhn8aOQw9K4M5lIq3bPU/t8J//m R5o483J7/mVAI3iQyNOe+brLJpyKvR4ahOPFY8PfliOcPxMnJ5Nr2MLMV5yRZDnKKL9W 8QMOykMoSvIWfrODQ+Tq/OK2hTZR76tDd0Fjs1kslCABGIhkEdyGUDqqXpx6NXeeeK9g WBf6AmBif/1I2gpOFkKeocEBR61y6YayZxeqdlRolgc3qChh00dSwayiF8JHUtP1/Ysg Eyrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=P6gL0rsE1N/359Z5EQ1KJEqxJ/cpzBpOKR8U4nC2sio=; b=jmbwRZRiIfyxI1jbcxVyUm/Ml3tSpAHzaB1i2DpL6SYKG6zzLcaDLIoSQYde8c3vFe mBXcjsMR11x7gu1MPRAnoX2OGAy0l5MvYbIlK4fACV3vobgm6SwgQ5bKIyoStvX2Z4hr GhmGeYcXy82Cl4z1TXRXstnotnEOswWzwnu5teuvDBEty8W3n+UxR7MYOKAo4T2qWLER Ii+eriEIr90BowCNkYlhs+zdopN/JWiWjXP3X2qsFmm6ulpMIq5gfXzq7dfD2gaH/hws Mx4RmBk+UnSFFmzBP4ngjfe7Tfu/lA/9RntDWnIL87d62yLntrW2cXiWNZhc9cn+Z3eG 1VVA== X-Gm-Message-State: AOUpUlGNXtuaJq+IIbhG0Pvq8/033gQ5kNvppuDMP/q4pUFKbIeHESmd 7nMmGAd+2MH21fzoPiTPjaaqUr5B4bs= X-Google-Smtp-Source: AA+uWPwOQIkKMGHuVopT6SteoevU8Xpu4k3+ADj70UukPSy4+pX2+4/xOnYSpATLoxitkgG6v5TZPw== X-Received: by 2002:a50:f383:: with SMTP id g3-v6mr2089871edm.110.1534766548685; Mon, 20 Aug 2018 05:02:28 -0700 (PDT) Received: from emanuele-MacBookPro.mobile.usilu.net ([194.230.159.211]) by smtp.gmail.com with ESMTPSA id b20-v6sm1348486edc.30.2018.08.20.05.02.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 05:02:28 -0700 (PDT) From: Emanuele Giuseppe Esposito To: qemu-devel@nongnu.org Date: Mon, 20 Aug 2018 14:02:02 +0200 Message-Id: <20180820120213.11095-6-e.emanuelegiuseppe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> References: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::52a Subject: [Qemu-devel] [PATCH 05/16] test/qgraph: ac97 test node X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Dmitry Fleytman , Fam Zheng , =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Amit Shah , Jason Wang , "Michael S. Tsirkin" , Emanuele Giuseppe Esposito , Alexander Graf , Greg Kurz , Keith Busch , qemu-ppc@nongnu.org, Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , John Snow , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Convert tests/ac97-test in qgraph test node, ac97-test. Since it's a nop test, node creation and initialization is made in the same file. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 3 +-- tests/ac97-test.c | 39 ++++++++++++++++++++++++++++++--------- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index bad4de3d61..3e5964263e 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -217,7 +217,6 @@ check-qtest-pci-y += tests/ne2000-test$(EXESUF) gcov-files-pci-y += hw/net/ne2000.c check-qtest-pci-y += tests/nvme-test$(EXESUF) gcov-files-pci-y += hw/block/nvme.c -check-qtest-pci-y += tests/ac97-test$(EXESUF) gcov-files-pci-y += hw/audio/ac97.c check-qtest-pci-y += tests/es1370-test$(EXESUF) gcov-files-pci-y += hw/audio/es1370.c @@ -792,6 +791,7 @@ libqgraph-tests-obj-y += tests/virtio-rng-test.o libqgraph-tests-obj-y += tests/virtio-blk-test.o libqgraph-tests-obj-y += tests/virtio-net-test.o libqgraph-tests-obj-y += tests/virtio-scsi-test.o +libqgraph-tests-obj-y += tests/ac97-test.o check-unit-y += tests/test-qgraph$(EXESUF) tests/test-qgraph$(EXESUF): tests/test-qgraph.o $(libqgraph-obj-y) @@ -846,7 +846,6 @@ tests/qdev-monitor-test$(EXESUF): tests/qdev-monitor-test.o $(libqos-pc-obj-y) tests/nvme-test$(EXESUF): tests/nvme-test.o tests/pvpanic-test$(EXESUF): tests/pvpanic-test.o tests/i82801b11-test$(EXESUF): tests/i82801b11-test.o -tests/ac97-test$(EXESUF): tests/ac97-test.o tests/es1370-test$(EXESUF): tests/es1370-test.o tests/intel-hda-test$(EXESUF): tests/intel-hda-test.o tests/ioh3420-test$(EXESUF): tests/ioh3420-test.o diff --git a/tests/ac97-test.c b/tests/ac97-test.c index e0d177bd9c..1928424250 100644 --- a/tests/ac97-test.c +++ b/tests/ac97-test.c @@ -9,23 +9,44 @@ #include "qemu/osdep.h" #include "libqtest.h" +#include "libqos/qgraph.h" + +typedef struct QAC97 QAC97; + +struct QAC97 { + QOSGraphObject obj; +}; /* Tests only initialization so far. TODO: Replace with functional tests */ -static void nop(void) +static void nop(void *obj, void *data, QGuestAllocator *alloc) +{ +} + +static void ac97_destructor(QOSGraphObject *obj) { + QAC97 *ac97 = (QAC97 *)obj; + g_free(ac97); } -int main(int argc, char **argv) +static void *ac97_create(void *pci_bus, QGuestAllocator *alloc, void *addr) { - int ret; + QAC97 *ac97 = g_new0(QAC97, 1); + ac97->obj.destructor = ac97_destructor; - g_test_init(&argc, &argv, NULL); - qtest_add_func("/ac97/nop", nop); + return &ac97->obj; +} - qtest_start("-device AC97"); - ret = g_test_run(); +static void ac97_register_nodes(void) +{ + qos_node_create_driver("AC97", ac97_create); + qos_node_consumes("AC97", "pci-bus", NULL); +} - qtest_end(); +libqos_init(ac97_register_nodes); - return ret; +static void register_ac97_test(void) +{ + qos_add_test("ac97-test", "AC97", nop, NULL); } + +libqos_init(register_ac97_test); From patchwork Mon Aug 20 12:02:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emanuele Giuseppe Esposito X-Patchwork-Id: 959638 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="p686wdYG"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vCBZ5z2lz9s3C for ; Mon, 20 Aug 2018 22:03:34 +1000 (AEST) Received: from localhost ([::1]:46657 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1friuC-0005r8-FH for incoming@patchwork.ozlabs.org; Mon, 20 Aug 2018 08:03:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60885) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fritG-0005pd-MD for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fritD-0002U3-Va for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:34 -0400 Received: from mail-ed1-x544.google.com ([2a00:1450:4864:20::544]:43758) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fritD-0002Tp-Pk; Mon, 20 Aug 2018 08:02:31 -0400 Received: by mail-ed1-x544.google.com with SMTP id j21-v6so8310470edp.10; Mon, 20 Aug 2018 05:02:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uxiUnMB0E1UqGLwYXjb/luqnm3GJy8B9Ye6+J2qv7mw=; b=p686wdYGasXfChoBpUZEhWQwf4C7TsqpALG24SzgCnzcUmQ8F8/8PiHk7Dk3tteeLs VI9nRoE7tiX1MDiR7vLgQeCRwNVzymqyZK7a8Zga8OKzXOJAi0ELb2Ek1t6jrqvUW6F0 /uAMSOzXFPW/f6uTCarQ1ThTp8to9r32iE2WdKzOACvabP+zyuCr+KMw6eTf/HiNELkC Kdz4zB74PMI1Ek7U4TdhOtDCaFwFrgIf8qYYW40Jvc0IJGi+k/aA/dYvbE1L0vjhGURA lAFQztwho04JwvXvnMvDEf/2QXTqGr5f7x+Lwm0vvkhAXvpVYvcyOA4FQYpVLCeNnjwn u9ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uxiUnMB0E1UqGLwYXjb/luqnm3GJy8B9Ye6+J2qv7mw=; b=EtCSAxjUrLI0iAxLT8FZpWsvuV9TuPl2MQJCRGJa+OVO0ISYPue4Dyh0lsPyOSDstG KuUC0CXDQyBkGMIcUDUZnWP+e7LAlHKqd3NStrdJnbadY45cKDc8NPVT9rn6oXmFt8ZP CueZNC9bPSb/r+e11YXXguzRUkcff5FFC2Digwzlw0Uqhq4aSKFCFLhpuru5mPYhltUF oO+3x48JVxl0OI2GerQqcjpN2NYHdBSTATu49J1X087cplTqvYw7mlZTMTmjCjYhDsQN cGYTEJqhffINiBH0+F/Yfk2FZup1sot9zDtajURXhA+UAVatCPpbg4uQvLEoABU107dj 6WEw== X-Gm-Message-State: AOUpUlGuzLteaoSbsxNq1w793XzGh6YoBobf4sHf2OjZP0yJBtIUKJU1 p7XVITUxmOGXIIhz8ya8C0YDENwtW14= X-Google-Smtp-Source: ANB0Vda+E86by4sbNxEZTXPTOzn912lCQ9R4EyXO49FZkYqFkeAttR4J962FgJ8AygXQzc3F7guroQ== X-Received: by 2002:a50:ae83:: with SMTP id e3-v6mr6788121edd.16.1534766550521; Mon, 20 Aug 2018 05:02:30 -0700 (PDT) Received: from emanuele-MacBookPro.mobile.usilu.net ([194.230.159.211]) by smtp.gmail.com with ESMTPSA id b20-v6sm1348486edc.30.2018.08.20.05.02.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 05:02:29 -0700 (PDT) From: Emanuele Giuseppe Esposito To: qemu-devel@nongnu.org Date: Mon, 20 Aug 2018 14:02:03 +0200 Message-Id: <20180820120213.11095-7-e.emanuelegiuseppe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> References: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::544 Subject: [Qemu-devel] [PATCH 06/16] test/qgraph: tpci200 test node X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Dmitry Fleytman , Fam Zheng , =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Amit Shah , Jason Wang , "Michael S. Tsirkin" , Emanuele Giuseppe Esposito , Alexander Graf , Greg Kurz , Keith Busch , qemu-ppc@nongnu.org, Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , John Snow , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Convert tests/tpci200-test in qgraph test node, tpci200-test. Since it's a nop test, node creation and initialization is made in the same file. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 2 +- tests/tpci200-test.c | 60 +++++++++++++++++++++++++++++++++++------- 2 files changed, 52 insertions(+), 10 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 3e5964263e..1daee93de5 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -792,6 +792,7 @@ libqgraph-tests-obj-y += tests/virtio-blk-test.o libqgraph-tests-obj-y += tests/virtio-net-test.o libqgraph-tests-obj-y += tests/virtio-scsi-test.o libqgraph-tests-obj-y += tests/ac97-test.o +libqgraph-tests-obj-y += tests/tpci200-test.o check-unit-y += tests/test-qgraph$(EXESUF) tests/test-qgraph$(EXESUF): tests/test-qgraph.o $(libqgraph-obj-y) @@ -835,7 +836,6 @@ tests/ne2000-test$(EXESUF): tests/ne2000-test.o tests/wdt_ib700-test$(EXESUF): tests/wdt_ib700-test.o tests/tco-test$(EXESUF): tests/tco-test.o $(libqos-pc-obj-y) tests/virtio-ccw-test$(EXESUF): tests/virtio-ccw-test.o -tests/tpci200-test$(EXESUF): tests/tpci200-test.o tests/display-vga-test$(EXESUF): tests/display-vga-test.o tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o tests/qom-test$(EXESUF): tests/qom-test.o diff --git a/tests/tpci200-test.c b/tests/tpci200-test.c index 0321ec27ec..a0e1785e50 100644 --- a/tests/tpci200-test.c +++ b/tests/tpci200-test.c @@ -9,23 +9,65 @@ #include "qemu/osdep.h" #include "libqtest.h" +#include "libqos/qgraph.h" + +typedef struct QTpci200 QTpci200; +typedef struct QIpack QIpack; + +struct QIpack { + +}; +struct QTpci200 { + QOSGraphObject obj; + QIpack ipack; +}; /* Tests only initialization so far. TODO: Replace with functional tests */ -static void nop(void) +static void nop(void *obj, void *data, QGuestAllocator *alloc) { } -int main(int argc, char **argv) +/* tpci200 */ +static void *tpci200_get_driver(void *obj, const char *interface) { - int ret; + QTpci200 *tpci200 = obj; + if (!g_strcmp0(interface, "ipack")) { + return &tpci200->ipack; + } - g_test_init(&argc, &argv, NULL); - qtest_add_func("/tpci200/nop", nop); + fprintf(stderr, "%s not present in tpci200\n", interface); + g_assert_not_reached(); +} - qtest_start("-device tpci200"); - ret = g_test_run(); +static void tpci200_destructor(QOSGraphObject *obj) +{ + QTpci200 *tpci200 = (QTpci200 *) obj; + g_free(tpci200); +} - qtest_end(); +static void *tpci200_create(void *pci_bus, QGuestAllocator *alloc, void *addr) +{ + QTpci200 *tpci200 = g_new0(QTpci200, 1); + tpci200->obj.destructor = tpci200_destructor; + tpci200->obj.get_driver = tpci200_get_driver; - return ret; + return &tpci200->obj; } + +static void tpci200_register_nodes(void) +{ + qos_node_create_driver("tpci200", tpci200_create); + qos_node_consumes("tpci200", "pci-bus", &(QOSGraphEdgeOptions) { + .extra_device_opts = "id=ipack0", + }); + qos_node_produces("tpci200", "ipack"); +} + +libqos_init(tpci200_register_nodes); + +static void register_tpci200_test(void) +{ + qos_add_test("tpci200-test", "tpci200", nop, NULL); +} + +libqos_init(register_tpci200_test); From patchwork Mon Aug 20 12:02:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emanuele Giuseppe Esposito X-Patchwork-Id: 959642 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="C8YKI96F"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vCG25wv9z9s3C for ; Mon, 20 Aug 2018 22:06:34 +1000 (AEST) Received: from localhost ([::1]:46675 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frix6-0000mI-DX for incoming@patchwork.ozlabs.org; Mon, 20 Aug 2018 08:06:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fritH-0005q6-1f for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fritF-0002VB-UX for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:34 -0400 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]:46234) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fritF-0002Uh-M3; Mon, 20 Aug 2018 08:02:33 -0400 Received: by mail-ed1-x52e.google.com with SMTP id o8-v6so8317089edt.13; Mon, 20 Aug 2018 05:02:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fet0rhtqzmoMQe8WS86XUExTc/VVE3tEb5w2FQY5ZFw=; b=C8YKI96FYvgT1Jn6z43hgvTlZu4PUDWn/sVHoKZ2NNLx76R9cRfhh8+0BOpi4Vsryu V3mfa+wct2t1L//yXyP4nFkMZdsJTrWTz3N1kLINDGiwjtqE3X7aEw6BtIxP7RHFkoK1 AuF3+XFTxMayztqJRU4VpnKkUaD0Z7Zo1GEUH9ow2C0H1D/veRwxAo3j37kz4UAYNatK GYJHZRrBfwo9YSs+ZfPTvxn6eaHaeT9gvai0Y1vVoHPmslcJuHzSFAHBeAcXqTgSncTj jU1mM8JpK/+ICjCS2cKXssHwGt7qLolsYq9r9/8+hxrGc6cJXKNtn03e/7xsszP5BFnl gClg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fet0rhtqzmoMQe8WS86XUExTc/VVE3tEb5w2FQY5ZFw=; b=GkcnnN//ms7Izriz7E+m4BDL+ff+erH42xccMPjq5bMJdh2caRh5asWr6AFvUoRLot QnGzGBXU2GwImItrcitAEh01TnkmUPnLZGq4ZO55UhVuzZ4HDBhw/Zim+Vamh1+PuMX9 bCY5Cm4OsGWpLFhIXLpE5hI0CYhWOBsltiS39MrTzLVfH+hp0+aQst8r6K2OwaAXH86Z coN+pmt3iCFPI+YXhnTLbaSvhlyuMn3tsIIt4ga4I90JA1Oc9eklUiebDX1EYEEMcqPZ RGd7TcwSwiU1DF7EQLH/2/gogOdIdXoSEd/JT0lzC6acAIzTtwxpAyuHHEO67OoDvn1v zv1g== X-Gm-Message-State: AOUpUlG0FM2Qnw30+pxYFGWeuVRkgB1WiWz2X39BorpqodY7E6RXL1yM 6/f6an8m/EovK2e0b0+mZTgTQN/I9wc= X-Google-Smtp-Source: AA+uWPzEMRJ5qtXG/fYsfAxa5UtKCdDmuJ0+zcBe5qFKPJK+x9J4xzZkGzojfXvmC/909kr9HAYpJg== X-Received: by 2002:a50:83e6:: with SMTP id 93-v6mr53636143edi.164.1534766552368; Mon, 20 Aug 2018 05:02:32 -0700 (PDT) Received: from emanuele-MacBookPro.mobile.usilu.net ([194.230.159.211]) by smtp.gmail.com with ESMTPSA id b20-v6sm1348486edc.30.2018.08.20.05.02.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 05:02:31 -0700 (PDT) From: Emanuele Giuseppe Esposito To: qemu-devel@nongnu.org Date: Mon, 20 Aug 2018 14:02:04 +0200 Message-Id: <20180820120213.11095-8-e.emanuelegiuseppe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> References: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::52e Subject: [Qemu-devel] [PATCH 07/16] test/qgraph: ipoctal232 test node X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Dmitry Fleytman , Fam Zheng , =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Amit Shah , Jason Wang , "Michael S. Tsirkin" , Emanuele Giuseppe Esposito , Alexander Graf , Greg Kurz , Keith Busch , qemu-ppc@nongnu.org, Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , John Snow , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Convert tests/ipoctal232-test in qgraph test node, ipoctal232-test. Since it's a nop test, node creation and initialization is made in the same file. This test creates a tpci200 node that produces an interface ipack consumed by the ipoctal232 device. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 3 +-- tests/ipoctal232-test.c | 42 ++++++++++++++++++++++++++++++++--------- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 1daee93de5..6a7848bd34 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -184,7 +184,6 @@ gcov-files-generic-y = qdev-monitor.c qmp.c check-qtest-generic-y += tests/cdrom-test$(EXESUF) gcov-files-ipack-y += hw/ipack/ipack.c -check-qtest-ipack-y += tests/ipoctal232-test$(EXESUF) gcov-files-ipack-y += hw/char/ipoctal232.c gcov-files-virtioserial-y += hw/char/virtio-console.c @@ -793,6 +792,7 @@ libqgraph-tests-obj-y += tests/virtio-net-test.o libqgraph-tests-obj-y += tests/virtio-scsi-test.o libqgraph-tests-obj-y += tests/ac97-test.o libqgraph-tests-obj-y += tests/tpci200-test.o +libqgraph-tests-obj-y += tests/ipoctal232-test.o check-unit-y += tests/test-qgraph$(EXESUF) tests/test-qgraph$(EXESUF): tests/test-qgraph.o $(libqgraph-obj-y) @@ -837,7 +837,6 @@ tests/wdt_ib700-test$(EXESUF): tests/wdt_ib700-test.o tests/tco-test$(EXESUF): tests/tco-test.o $(libqos-pc-obj-y) tests/virtio-ccw-test$(EXESUF): tests/virtio-ccw-test.o tests/display-vga-test$(EXESUF): tests/display-vga-test.o -tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o tests/qom-test$(EXESUF): tests/qom-test.o tests/test-hmp$(EXESUF): tests/test-hmp.o tests/machine-none-test$(EXESUF): tests/machine-none-test.o diff --git a/tests/ipoctal232-test.c b/tests/ipoctal232-test.c index 684914164d..3514b89107 100644 --- a/tests/ipoctal232-test.c +++ b/tests/ipoctal232-test.c @@ -9,23 +9,47 @@ #include "qemu/osdep.h" #include "libqtest.h" +#include "libqos/qgraph.h" + +typedef struct QIpoctal232 QIpoctal232; + +struct QIpoctal232 { + QOSGraphObject obj; +}; /* Tests only initialization so far. TODO: Replace with functional tests */ -static void nop(void) +static void nop(void *obj, void *data, QGuestAllocator *alloc) +{ +} + +static void ipoctal232_destructor(QOSGraphObject *obj) { + QIpoctal232 *ipoctal232 = (QIpoctal232 *) obj; + g_free(ipoctal232); } -int main(int argc, char **argv) +static void *ipoctal232_create(void *pci_bus, QGuestAllocator *alloc, + void *addr) { - int ret; + QIpoctal232 *ipoctal232 = g_new0(QIpoctal232, 1); + ipoctal232->obj.destructor = ipoctal232_destructor; - g_test_init(&argc, &argv, NULL); - qtest_add_func("/ipoctal232/tpci200/nop", nop); + return &ipoctal232->obj; +} - qtest_start("-device tpci200,id=ipack0 -device ipoctal232,bus=ipack0.0"); - ret = g_test_run(); +static void ipoctal232_register_nodes(void) +{ + qos_node_create_driver("ipoctal232", ipoctal232_create); + qos_node_consumes("ipoctal232", "ipack", &(QOSGraphEdgeOptions) { + .extra_device_opts = "bus=ipack0.0", + }); +} - qtest_end(); +libqos_init(ipoctal232_register_nodes); - return ret; +static void register_ipoctal232_test(void) +{ + qos_add_test("ipoctal232-test", "ipoctal232", nop, NULL); } + +libqos_init(register_ipoctal232_test); From patchwork Mon Aug 20 12:02:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emanuele Giuseppe Esposito X-Patchwork-Id: 959647 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gnLRIc4O"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vCNX56R1z9s4s for ; Mon, 20 Aug 2018 22:12:12 +1000 (AEST) Received: from localhost ([::1]:46721 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frj2Y-0006Cq-Ax for incoming@patchwork.ozlabs.org; Mon, 20 Aug 2018 08:12:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60932) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fritK-0005rC-AM for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fritH-0002W3-Mc for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:36 -0400 Received: from mail-ed1-x544.google.com ([2a00:1450:4864:20::544]:33940) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fritH-0002Vc-Em; Mon, 20 Aug 2018 08:02:35 -0400 Received: by mail-ed1-x544.google.com with SMTP id h1-v6so8335695eds.1; Mon, 20 Aug 2018 05:02:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CnnmCLMdOBpS/cOSOfl/ZxjdYjILK9Li9gUkWB+q+bQ=; b=gnLRIc4O+uExDEVZIReYnSm/Rju48iHknvNvN6RXMr4Hl2T6lkdj50srH/YonJz2X5 TMWGluvUYf47IFntxatOcnjbjdvVwZD/Yd/f9nn7nDC8WLjJ1PixeSKp85I+dEG7Q1D6 SPYsJViK9aYfUY52W1W7QZy7yVMHlxn0xn5GFyz24V6B7kucAKEHIRLkaQZWFhr9eriC 4H/jJD/+VZr9dG2hNdheloWU+3GV4nD+iBk/3q13yn6fPj4tTNadVvnkU4iXgR1dUoq2 ZwLTv3llakaT7yvTJcX0RglPPFizVm219Jjp2f0mkEan3Qew2SPOz5BOllAuj4Np376t M5Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CnnmCLMdOBpS/cOSOfl/ZxjdYjILK9Li9gUkWB+q+bQ=; b=BLQtR1vq6YEsWJ3I8LvYm9WIsHPqF1Ia7Rbu0WpYZxhvQQb1wtTSytoVyTNUr9NGgv lCS+iZ0Y3uMut9YQpW7OG3TJLImi4H0/9UwYu6o2Z1Ggym0KTHW9tWz2En9l6SZkTtA5 vPLiDIb9D+Kjvh07O54XzD6wiREAAO/H4DUg/ZBNG4E18pTTck3cGCU8MM4oMyR9H8nz Z8Lidbl4ucIYviScqF2NjYOpkBvQbJOGJnTbb4GsCLqnAjTBqewlb1j5WaIms3wAUh24 36k920bmGHYa4aoRbY7xZAF4812XIlIA6kvmnp44Zg6I2Dv4mNFUFLA2sXwdxW8dT75+ wfhg== X-Gm-Message-State: AOUpUlHnRJE737WS3qaaVMr2TLdFnX8Yazji+ZOcuQAjysfudiW66RV/ M7WWrwMfaeX/7oBG9eqRvI/VPyBvUJ4= X-Google-Smtp-Source: AA+uWPyK31Xwm4vJyFADCCe7Gu2aDot4zxrYnOj4VyseqRALmHezSO1lP7yYkiPntt1YSwZETSOJSQ== X-Received: by 2002:aa7:d40a:: with SMTP id z10-v6mr54788405edq.203.1534766554155; Mon, 20 Aug 2018 05:02:34 -0700 (PDT) Received: from emanuele-MacBookPro.mobile.usilu.net ([194.230.159.211]) by smtp.gmail.com with ESMTPSA id b20-v6sm1348486edc.30.2018.08.20.05.02.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 05:02:33 -0700 (PDT) From: Emanuele Giuseppe Esposito To: qemu-devel@nongnu.org Date: Mon, 20 Aug 2018 14:02:05 +0200 Message-Id: <20180820120213.11095-9-e.emanuelegiuseppe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> References: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::544 Subject: [Qemu-devel] [PATCH 08/16] test/qgraph: ne2k_pci test node X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Dmitry Fleytman , Fam Zheng , =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Amit Shah , Jason Wang , "Michael S. Tsirkin" , Emanuele Giuseppe Esposito , Alexander Graf , Greg Kurz , Keith Busch , qemu-ppc@nongnu.org, Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , John Snow , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Convert tests/ne2000-test in qgraph test node, ne2000-test. Since it's a nop test, node creation and initialization is made in the same file. The actual device consumed by the test is ne2k_pci. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 3 +-- tests/ne2000-test.c | 39 ++++++++++++++++++++++++++++++--------- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 6a7848bd34..dea79797c5 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -212,7 +212,6 @@ gcov-files-pci-y += hw/net/pcnet.c gcov-files-pci-y += hw/net/pcnet-pci.c check-qtest-pci-y += tests/eepro100-test$(EXESUF) gcov-files-pci-y += hw/net/eepro100.c -check-qtest-pci-y += tests/ne2000-test$(EXESUF) gcov-files-pci-y += hw/net/ne2000.c check-qtest-pci-y += tests/nvme-test$(EXESUF) gcov-files-pci-y += hw/block/nvme.c @@ -793,6 +792,7 @@ libqgraph-tests-obj-y += tests/virtio-scsi-test.o libqgraph-tests-obj-y += tests/ac97-test.o libqgraph-tests-obj-y += tests/tpci200-test.o libqgraph-tests-obj-y += tests/ipoctal232-test.o +libqgraph-tests-obj-y += tests/ne2000-test.o check-unit-y += tests/test-qgraph$(EXESUF) tests/test-qgraph$(EXESUF): tests/test-qgraph.o $(libqgraph-obj-y) @@ -832,7 +832,6 @@ tests/pcnet-test$(EXESUF): tests/pcnet-test.o tests/pnv-xscom-test$(EXESUF): tests/pnv-xscom-test.o tests/eepro100-test$(EXESUF): tests/eepro100-test.o tests/vmxnet3-test$(EXESUF): tests/vmxnet3-test.o -tests/ne2000-test$(EXESUF): tests/ne2000-test.o tests/wdt_ib700-test$(EXESUF): tests/wdt_ib700-test.o tests/tco-test$(EXESUF): tests/tco-test.o $(libqos-pc-obj-y) tests/virtio-ccw-test$(EXESUF): tests/virtio-ccw-test.o diff --git a/tests/ne2000-test.c b/tests/ne2000-test.c index b7cf3dd2f5..aeb2232e2a 100644 --- a/tests/ne2000-test.c +++ b/tests/ne2000-test.c @@ -9,23 +9,44 @@ #include "qemu/osdep.h" #include "libqtest.h" +#include "libqos/qgraph.h" + +typedef struct QNe2k_pci QNe2k_pci; + +struct QNe2k_pci { + QOSGraphObject obj; +}; /* Tests only initialization so far. TODO: Replace with functional tests */ -static void pci_nop(void) +static void pci_nop(void *obj, void *data, QGuestAllocator *alloc) +{ +} + +static void ne2k_pci_destructor(QOSGraphObject *obj) { + QNe2k_pci *ne2k_pci = (QNe2k_pci *)obj; + g_free(ne2k_pci); } -int main(int argc, char **argv) +static void *ne2k_pci_create(void *pci_bus, QGuestAllocator *alloc, void *addr) { - int ret; + QNe2k_pci *ne2k_pci = g_new0(QNe2k_pci, 1); + ne2k_pci->obj.destructor = ne2k_pci_destructor; - g_test_init(&argc, &argv, NULL); - qtest_add_func("/ne2000/pci/nop", pci_nop); + return &ne2k_pci->obj; +} - qtest_start("-device ne2k_pci"); - ret = g_test_run(); +static void ne2000_register_nodes(void) +{ + qos_node_create_driver("ne2k_pci", ne2k_pci_create); + qos_node_consumes("ne2k_pci", "pci-bus", NULL); +} - qtest_end(); +libqos_init(ne2000_register_nodes); - return ret; +static void register_ne2000_test(void) +{ + qos_add_test("ne2000-test", "ne2k_pci", pci_nop, NULL); } + +libqos_init(register_ne2000_test); \ No newline at end of file From patchwork Mon Aug 20 12:02:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emanuele Giuseppe Esposito X-Patchwork-Id: 959639 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="c7TWIjv8"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vCBm3FF8z9s3C for ; Mon, 20 Aug 2018 22:03:44 +1000 (AEST) Received: from localhost ([::1]:46658 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1friuM-00069t-33 for incoming@patchwork.ozlabs.org; Mon, 20 Aug 2018 08:03:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fritL-0005si-Ns for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fritJ-0002Wz-Kx for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:39 -0400 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]:33205) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fritJ-0002Wg-DI; Mon, 20 Aug 2018 08:02:37 -0400 Received: by mail-ed1-x52e.google.com with SMTP id h9-v6so897897edr.0; Mon, 20 Aug 2018 05:02:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=H2t12HhRMXUkLxCxah5OGJ4PxzIcdFv6zaqIdbsPNPY=; b=c7TWIjv8xEhP6VhVJeJyHZ/2VqN4IJJ/qVjimHUozGV3f4mvSkzIXkMByDr/v7cW82 eeW6hG6BAKgapRKZ1Vy84p5OpR20+ajXkERboALlN7giJmKU9hwDdinXEsqEREJ/BcCq UCyms6xMxONOFUtjdQ0f7c5hoCzfScLIS0RebFxiuo1gG6KraVDOt239mdGxsGVVl4Xn ZY/PFJv/dH9nT6O1Ipk4s6S7QIEMsr95vZGS3MnC436CjUaxu0z0oxyqs0SUa7iWWRvt fJbk9ZWhvlMgs9ElPSTE0waZXvEGr0E4pLpKvNRliht1OKkYWb/dxa6Novwa8ja2Uxmm lHVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=H2t12HhRMXUkLxCxah5OGJ4PxzIcdFv6zaqIdbsPNPY=; b=d7EI+JW4ZoKt5oRBNPBGvOkrCUR/jJk7QjLa/3rtmWJcNnFM+Pc9G5R4X1lz5ybvf/ g/QCKh7TiB+aEjbSEddAYY6+luNIxUXkjCLyY6k38TX9vksi0BODNDBTjXAr4ay2AkM/ bOpUp1ehbNfP3dLirjOOuK9bCKRX9dHye7bSnG1C05c5MSaPZXr7BRn4NRy2SXIBL8Z7 BQ2+sFEFZAcUZ3q7+nGQpM6DwdTSJp/j7raXzxmElI4xhGCTgtxYS88N8JeNiIrBtifA OYZBgI+GdzBBM2at/vjhMfXHEjVN/9XDzNHYojAHLT12k4TBJUp79iK9d4n4aj7A8uF5 bvrQ== X-Gm-Message-State: AOUpUlGPghfOdEh/up0nnUxu7ooXsng6MRlKgOkGmrU8Ff9b5tUpJ9bb dS+VceUZX4rkkwYG1tDbpQM/DemupmE= X-Google-Smtp-Source: AA+uWPzXcKdYHCBBDPJKMd/DPP29ajmr3lq/h3eSZAOzpXL2LuCNLT4GBcSb9fppm6+cwNqBgHI6Hw== X-Received: by 2002:aa7:d299:: with SMTP id w25-v6mr2261333edq.295.1534766556050; Mon, 20 Aug 2018 05:02:36 -0700 (PDT) Received: from emanuele-MacBookPro.mobile.usilu.net ([194.230.159.211]) by smtp.gmail.com with ESMTPSA id b20-v6sm1348486edc.30.2018.08.20.05.02.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 05:02:35 -0700 (PDT) From: Emanuele Giuseppe Esposito To: qemu-devel@nongnu.org Date: Mon, 20 Aug 2018 14:02:06 +0200 Message-Id: <20180820120213.11095-10-e.emanuelegiuseppe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> References: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::52e Subject: [Qemu-devel] [PATCH 09/16] test/qgraph: nvme test node X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Dmitry Fleytman , Fam Zheng , =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Amit Shah , Jason Wang , "Michael S. Tsirkin" , Emanuele Giuseppe Esposito , Alexander Graf , Greg Kurz , Keith Busch , qemu-ppc@nongnu.org, Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , John Snow , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Convert tests/nvme-test in qgraph test node, nvme-test. Since it's a nop test, node creation and initialization is made in the same file. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 3 +-- tests/nvme-test.c | 43 ++++++++++++++++++++++++++++++++---------- 2 files changed, 34 insertions(+), 12 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index dea79797c5..62e74b28d1 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -213,7 +213,6 @@ gcov-files-pci-y += hw/net/pcnet-pci.c check-qtest-pci-y += tests/eepro100-test$(EXESUF) gcov-files-pci-y += hw/net/eepro100.c gcov-files-pci-y += hw/net/ne2000.c -check-qtest-pci-y += tests/nvme-test$(EXESUF) gcov-files-pci-y += hw/block/nvme.c gcov-files-pci-y += hw/audio/ac97.c check-qtest-pci-y += tests/es1370-test$(EXESUF) @@ -793,6 +792,7 @@ libqgraph-tests-obj-y += tests/ac97-test.o libqgraph-tests-obj-y += tests/tpci200-test.o libqgraph-tests-obj-y += tests/ipoctal232-test.o libqgraph-tests-obj-y += tests/ne2000-test.o +libqgraph-tests-obj-y += tests/nvme-test.o check-unit-y += tests/test-qgraph$(EXESUF) tests/test-qgraph$(EXESUF): tests/test-qgraph.o $(libqgraph-obj-y) @@ -841,7 +841,6 @@ tests/test-hmp$(EXESUF): tests/test-hmp.o tests/machine-none-test$(EXESUF): tests/machine-none-test.o tests/drive_del-test$(EXESUF): tests/drive_del-test.o $(libqos-virtio-obj-y) tests/qdev-monitor-test$(EXESUF): tests/qdev-monitor-test.o $(libqos-pc-obj-y) -tests/nvme-test$(EXESUF): tests/nvme-test.o tests/pvpanic-test$(EXESUF): tests/pvpanic-test.o tests/i82801b11-test$(EXESUF): tests/i82801b11-test.o tests/es1370-test$(EXESUF): tests/es1370-test.o diff --git a/tests/nvme-test.c b/tests/nvme-test.c index 7674a446e4..f6209e45cb 100644 --- a/tests/nvme-test.c +++ b/tests/nvme-test.c @@ -9,24 +9,47 @@ #include "qemu/osdep.h" #include "libqtest.h" +#include "libqos/qgraph.h" + +typedef struct QNvme QNvme; + +struct QNvme { + QOSGraphObject obj; +}; /* Tests only initialization so far. TODO: Replace with functional tests */ -static void nop(void) +static void nop(void *obj, void *data, QGuestAllocator *alloc) +{ +} + +static void nvme_destructor(QOSGraphObject *obj) { + QNvme *nvme = (QNvme *)obj; + g_free(nvme); } -int main(int argc, char **argv) +static void *nvme_create(void *pci_bus, QGuestAllocator *alloc, void *addr) { - int ret; + QNvme *nvme = g_new0(QNvme, 1); + nvme->obj.destructor = nvme_destructor; - g_test_init(&argc, &argv, NULL); - qtest_add_func("/nvme/nop", nop); + return &nvme->obj; +} - qtest_start("-drive id=drv0,if=none,file=null-co://,format=raw " - "-device nvme,drive=drv0,serial=foo"); - ret = g_test_run(); +static void nvme_register_nodes(void) +{ + qos_node_create_driver("nvme", nvme_create); + qos_node_consumes("nvme", "pci-bus", &(QOSGraphEdgeOptions) { + .extra_device_opts = "drive=drv0,serial=foo", + .before_cmd_line = "-drive id=drv0,if=none,file=null-co://,format=raw", + }); +} - qtest_end(); +libqos_init(nvme_register_nodes); - return ret; +static void register_nvme_test(void) +{ + qos_add_test("nvme-test", "nvme", nop, NULL); } + +libqos_init(register_nvme_test); From patchwork Mon Aug 20 12:02:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emanuele Giuseppe Esposito X-Patchwork-Id: 959646 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="F3zeCMJE"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vCKw5jC6z9s3C for ; Mon, 20 Aug 2018 22:09:56 +1000 (AEST) Received: from localhost ([::1]:46696 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frj0M-0003QW-EJ for incoming@patchwork.ozlabs.org; Mon, 20 Aug 2018 08:09:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32774) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fritM-0005tT-AU for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fritL-0002Y0-95 for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:40 -0400 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:42778) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fritL-0002XR-2s; Mon, 20 Aug 2018 08:02:39 -0400 Received: by mail-ed1-x52f.google.com with SMTP id r4-v6so8313822edp.9; Mon, 20 Aug 2018 05:02:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Td3Ch2KEzMTNSWUq9cJOVCvaNkz/Fa/lkQUZz1c17Mw=; b=F3zeCMJEt3uYM/DTYe9007VDR83A3Q1EnnD9Ao4q7NiemzhUGVfh/E/v1TEI/lbLkQ bAA2Z5uw2yrg97DoxzJrLrw10o7pmZ4g75wInJjvB+V0h2BZFe3OWKTYsL99iceWvITo DiFxcRp9b/EqW4WtN/M4VvDWTeB3iXonvmRiPD2LgTrHLMDZDk9g4vGr1Z2RjDs2/t75 mcHOIKiIVEhzgBLDHGzGXTjk8u8SCLJCuc6h22A3J/bRH7jKWOpchfl1mPtLxIf9nJxN W6XN2EZviDgFZRVwPkpuS8tUaUXmGEc2BeWPctZqSjNEL5lQU6C5we2O2q4g2THbGFey QFtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Td3Ch2KEzMTNSWUq9cJOVCvaNkz/Fa/lkQUZz1c17Mw=; b=pop1slutarE2nc6i/819sS2CD+32jwN9GGVtvLmyVIW2icdzcvFfXKdm4FE5EJj+BN ua2SkVGAZjIB+/8mFgOZ9FRq4RcePaIMT5zQzurWMXoqslp9A2pt5kbK09lahf23V6aN z5AaCrp2ztnhP+jfREqsOkHJXUsxbOxxmcyv/ud1S/YsXtKA5PvHc+Pts30tpYPWqKa7 QAu5jXlbE7NZ+6I90LHIQj9aLljV2AeD/3bGVu8uVj9U+Rv2DsXEDIfFc0Hex4VCkvPw UyvrnYPZkk/Nhw9hrY1dmeSvNghjiO6huAyNenZKGDxGNhaKtIM7vEvw81nMFpGarB+H 1PLA== X-Gm-Message-State: AOUpUlGQaCgzW9WOlAxx4uCksXWwwmrnXgjweu60EIwCkyHDQRUJATaf 2eN6UhJ/Txh0a8uu1iYJsgYoLbAQv2o= X-Google-Smtp-Source: AA+uWPx7ua7QN6Nrl3K2AqRF+7HH9fIWvLOt9cYdUz1opdJmLZsbkq9miTHS4j9KOWAfUDvdaH9zLQ== X-Received: by 2002:a50:865b:: with SMTP id 27-v6mr53827589edt.42.1534766557721; Mon, 20 Aug 2018 05:02:37 -0700 (PDT) Received: from emanuele-MacBookPro.mobile.usilu.net ([194.230.159.211]) by smtp.gmail.com with ESMTPSA id b20-v6sm1348486edc.30.2018.08.20.05.02.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 05:02:37 -0700 (PDT) From: Emanuele Giuseppe Esposito To: qemu-devel@nongnu.org Date: Mon, 20 Aug 2018 14:02:07 +0200 Message-Id: <20180820120213.11095-11-e.emanuelegiuseppe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> References: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::52f Subject: [Qemu-devel] [PATCH 10/16] test/qgraph: pcnet test node X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Dmitry Fleytman , Fam Zheng , =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Amit Shah , Jason Wang , "Michael S. Tsirkin" , Emanuele Giuseppe Esposito , Alexander Graf , Greg Kurz , Keith Busch , qemu-ppc@nongnu.org, Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , John Snow , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Convert tests/pcnet-test in qgraph test node, pcnet-test. Since it's a nop test, node creation and initialization is made in the same file. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 3 +-- tests/pcnet-test.c | 39 ++++++++++++++++++++++++++++++--------- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 62e74b28d1..1a2b645209 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -207,7 +207,6 @@ gcov-files-pci-y += hw/net/e1000.c gcov-files-pci-y += hw/net/e1000e.c hw/net/e1000e_core.c check-qtest-pci-y += tests/rtl8139-test$(EXESUF) gcov-files-pci-y += hw/net/rtl8139.c -check-qtest-pci-y += tests/pcnet-test$(EXESUF) gcov-files-pci-y += hw/net/pcnet.c gcov-files-pci-y += hw/net/pcnet-pci.c check-qtest-pci-y += tests/eepro100-test$(EXESUF) @@ -793,6 +792,7 @@ libqgraph-tests-obj-y += tests/tpci200-test.o libqgraph-tests-obj-y += tests/ipoctal232-test.o libqgraph-tests-obj-y += tests/ne2000-test.o libqgraph-tests-obj-y += tests/nvme-test.o +libqgraph-tests-obj-y += tests/pcnet-test.o check-unit-y += tests/test-qgraph$(EXESUF) tests/test-qgraph$(EXESUF): tests/test-qgraph.o $(libqgraph-obj-y) @@ -828,7 +828,6 @@ tests/q35-test$(EXESUF): tests/q35-test.o $(libqos-pc-obj-y) tests/fw_cfg-test$(EXESUF): tests/fw_cfg-test.o $(libqos-pc-obj-y) tests/e1000-test$(EXESUF): tests/e1000-test.o tests/rtl8139-test$(EXESUF): tests/rtl8139-test.o $(libqos-pc-obj-y) -tests/pcnet-test$(EXESUF): tests/pcnet-test.o tests/pnv-xscom-test$(EXESUF): tests/pnv-xscom-test.o tests/eepro100-test$(EXESUF): tests/eepro100-test.o tests/vmxnet3-test$(EXESUF): tests/vmxnet3-test.o diff --git a/tests/pcnet-test.c b/tests/pcnet-test.c index efb1ef44e9..0f89d6510b 100644 --- a/tests/pcnet-test.c +++ b/tests/pcnet-test.c @@ -9,23 +9,44 @@ #include "qemu/osdep.h" #include "libqtest.h" +#include "libqos/qgraph.h" + +typedef struct QPcnet QPcnet; + +struct QPcnet { + QOSGraphObject obj; +}; /* Tests only initialization so far. TODO: Replace with functional tests */ -static void pci_nop(void) +static void pci_nop(void *obj, void *data, QGuestAllocator *alloc) +{ +} + +static void pcnet_destructor(QOSGraphObject *obj) { + QPcnet *pcnet = (QPcnet *)obj; + g_free(pcnet); } -int main(int argc, char **argv) +static void *pcnet_create(void *pci_bus, QGuestAllocator *alloc, void *addr) { - int ret; + QPcnet *pcnet = g_new0(QPcnet, 1); + pcnet->obj.destructor = pcnet_destructor; - g_test_init(&argc, &argv, NULL); - qtest_add_func("/pcnet/pci/nop", pci_nop); + return &pcnet->obj; +} - qtest_start("-device pcnet"); - ret = g_test_run(); +static void pcnet_register_nodes(void) +{ + qos_node_create_driver("pcnet", pcnet_create); + qos_node_consumes("pcnet", "pci-bus", NULL); +} - qtest_end(); +libqos_init(pcnet_register_nodes); - return ret; +static void register_pcnet_test(void) +{ + qos_add_test("pcnet-test", "pcnet", pci_nop, NULL); } + +libqos_init(register_pcnet_test); From patchwork Mon Aug 20 12:02:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emanuele Giuseppe Esposito X-Patchwork-Id: 959658 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="UBVeDSAn"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vCVT4XdVz9s4s for ; Mon, 20 Aug 2018 22:17:20 +1000 (AEST) Received: from localhost ([::1]:46763 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frj7U-0001qZ-VR for incoming@patchwork.ozlabs.org; Mon, 20 Aug 2018 08:17:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fritQ-0005xD-LR for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fritN-0002ZZ-AI for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:43 -0400 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]:46233) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fritN-0002Yr-4G; Mon, 20 Aug 2018 08:02:41 -0400 Received: by mail-ed1-x52c.google.com with SMTP id o8-v6so8317308edt.13; Mon, 20 Aug 2018 05:02:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EfWDcYSRWmLGwqGJ3pt9KYbZ5CWBpSNdAjKr5CATVpw=; b=UBVeDSAnFE1TySX+g2+gZ3Zr4w6K9hYapcuDzcc3/wOcw1euhFs1mjDyf7XYVtQPfJ Pw7Eb0KHtaJgq0ijxitSGh4IEiU74M6jy6n0BDka/PQZrdCC/HWdJ5zZgUI+qV4XXQYq ckf4w4gICmt90AH9EMkhC80pubV/lsXSAvQEpYdFEtsDcHBFBGmDrKlQBB7uAdSLAUVz ZyZo88pqoUgCSQM2PcIXuLefqtOJS3E8+vz1wyjBo58089cutda91W5yGlfmrL+p8680 zKNW3Woz6rzvbrRiVkeb0cF5hKFXerygH/1R4O42Dczh1OYSx1sI4G/2nXvuN6mF2htA pDwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=EfWDcYSRWmLGwqGJ3pt9KYbZ5CWBpSNdAjKr5CATVpw=; b=VnYAudkJKv8eyVZPmwVgN87doMgrqEoXO7jv14vobCvieF3Y+9mFbBsMLoV5GPr103 2x7setwdofqP3OGsXc1YGpu3wcS1X2gL5pNWFT1oJpikYNXMzB63INpcu9fE9nWGRKr9 ILtmgvOREJ+p7+aQPxvilmshMKNg4u9nZG8Wk5xlmGLiypl53VlrEFbOOEFaQl3vWxeM Ub+vUOQWPPShYG3h0jaEIhUgQiyArPDS80vZUca5fmBveV33qoQS+AkHFFkBKpJ9wKMD dSkCI3OnbgzYwrpRa4U3neVG5twj8Xi32pb3yHRdOX4FjRmb2oTXcT0dK1otHGDJfT3T qnfA== X-Gm-Message-State: AOUpUlFrSAa1h268dzHOk5yqNr3dYP/ckVm4UUQvc2a6FGSRgdpa/QOb BnALgro5IZMp6XcQ/2ZIUKsFhzF2UyY= X-Google-Smtp-Source: AA+uWPzlw2jIfUihVybR0OCXkL34iFRUi1OGXUenN1vQllbKvJLVZ4FucrP09Y9nYBuMaE6LC+UQcQ== X-Received: by 2002:aa7:c74b:: with SMTP id c11-v6mr3505336eds.113.1534766559648; Mon, 20 Aug 2018 05:02:39 -0700 (PDT) Received: from emanuele-MacBookPro.mobile.usilu.net ([194.230.159.211]) by smtp.gmail.com with ESMTPSA id b20-v6sm1348486edc.30.2018.08.20.05.02.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 05:02:39 -0700 (PDT) From: Emanuele Giuseppe Esposito To: qemu-devel@nongnu.org Date: Mon, 20 Aug 2018 14:02:08 +0200 Message-Id: <20180820120213.11095-12-e.emanuelegiuseppe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> References: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::52c Subject: [Qemu-devel] [PATCH 11/16] test/qgraph: spapr-phb test node X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Dmitry Fleytman , Fam Zheng , =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Amit Shah , Jason Wang , "Michael S. Tsirkin" , Emanuele Giuseppe Esposito , Alexander Graf , Greg Kurz , Keith Busch , qemu-ppc@nongnu.org, Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , John Snow , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Convert tests/spapr-phb-test in qgraph test node, spapr-phb-test. This test adds another spapr-pci-host-bridge device in the ppc64/pseries machine Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 3 +-- tests/spapr-phb-test.c | 28 +++++++++++----------------- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 1a2b645209..5b006b85d1 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -326,7 +326,6 @@ gcov-files-ppc-y += hw/timer/m48t59.c check-qtest-ppc64-y = $(check-qtest-ppc-y) gcov-files-ppc64-y = $(subst ppc-softmmu/,ppc64-softmmu/,$(gcov-files-ppc-y)) -check-qtest-ppc64-y += tests/spapr-phb-test$(EXESUF) gcov-files-ppc64-y += ppc64-softmmu/hw/ppc/spapr_pci.c check-qtest-ppc64-y += tests/pnv-xscom-test$(EXESUF) check-qtest-ppc64-y += tests/migration-test$(EXESUF) @@ -793,6 +792,7 @@ libqgraph-tests-obj-y += tests/ipoctal232-test.o libqgraph-tests-obj-y += tests/ne2000-test.o libqgraph-tests-obj-y += tests/nvme-test.o libqgraph-tests-obj-y += tests/pcnet-test.o +libqgraph-tests-obj-y += tests/spapr-phb-test.o check-unit-y += tests/test-qgraph$(EXESUF) tests/test-qgraph$(EXESUF): tests/test-qgraph.o $(libqgraph-obj-y) @@ -805,7 +805,6 @@ tests/device-introspect-test$(EXESUF): tests/device-introspect-test.o tests/rtc-test$(EXESUF): tests/rtc-test.o tests/m48t59-test$(EXESUF): tests/m48t59-test.o tests/endianness-test$(EXESUF): tests/endianness-test.o -tests/spapr-phb-test$(EXESUF): tests/spapr-phb-test.o $(libqos-obj-y) tests/prom-env-test$(EXESUF): tests/prom-env-test.o $(libqos-obj-y) tests/rtas-test$(EXESUF): tests/rtas-test.o $(libqos-spapr-obj-y) tests/fdc-test$(EXESUF): tests/fdc-test.o diff --git a/tests/spapr-phb-test.c b/tests/spapr-phb-test.c index d3522ea093..5b754b777c 100644 --- a/tests/spapr-phb-test.c +++ b/tests/spapr-phb-test.c @@ -7,29 +7,23 @@ * This work is licensed under the terms of the GNU GPL, version 2 or later. * See the COPYING file in the top-level directory. */ -#include "qemu/osdep.h" +#include "qemu/osdep.h" #include "libqtest.h" - -#define TYPE_SPAPR_PCI_HOST_BRIDGE "spapr-pci-host-bridge" +#include "libqos/qgraph.h" /* Tests only initialization so far. TODO: Replace with functional tests */ -static void test_phb_device(void) +static void test_phb_device(void *obj, void *data, QGuestAllocator *alloc) { } -int main(int argc, char **argv) +static void register_phb_test(void) { - int ret; - - g_test_init(&argc, &argv, NULL); - qtest_add_func("/spapr-phb/device", test_phb_device); - - qtest_start("-device " TYPE_SPAPR_PCI_HOST_BRIDGE ",index=30"); - - ret = g_test_run(); - - qtest_end(); - - return ret; + qos_add_test("spapr-phb-test", "ppc64/pseries", + test_phb_device, &(QOSGraphTestOptions) { + .edge.before_cmd_line = "-device spapr-pci-host-bridge" + ",index=30", + }); } + +libqos_init(register_phb_test); From patchwork Mon Aug 20 12:02:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emanuele Giuseppe Esposito X-Patchwork-Id: 959655 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Hsj9f3vT"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vCS64nFhz9s4s for ; Mon, 20 Aug 2018 22:15:18 +1000 (AEST) Received: from localhost ([::1]:46745 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frj5Y-0008VG-7v for incoming@patchwork.ozlabs.org; Mon, 20 Aug 2018 08:15:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fritQ-0005xG-LV for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fritP-0002aK-4T for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:44 -0400 Received: from mail-ed1-x542.google.com ([2a00:1450:4864:20::542]:37279) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fritO-0002a1-Tl; Mon, 20 Aug 2018 08:02:43 -0400 Received: by mail-ed1-x542.google.com with SMTP id b10-v6so8331668eds.4; Mon, 20 Aug 2018 05:02:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4vMReIIMkv9bGGr8hRPZwV0cF1MVL3ELg4VJ1IfDMYc=; b=Hsj9f3vTNtBTKf0cgIBM5Fa81bCAjv2kHPO10G0U4ic+iKMnmBj2WRQu4MXO3jyeHG b+A4rcI7crHiNmxhdEmaz79Hb6YFMzHOtU+J4ywZEHFGL/brcC/GuQ3eQk2EhTH+gokN /zREcNNONv/qxTyxpwx4EJ65fdDX2xkzgUXjHE7y077X809EPSiR5oA3UPQobVrvwFSi 7PU06fvtVnzjGBkXm2JXe2XeP7NLLer0pCNazDOmstaBTelZfCPzj6EMgXCECSDogzKT tv+6BsXDiH1MjqPhP7tGipL00cP128pY0QGewg6ml1uFxK836SpemJvcNX3sQyEySASK 10Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4vMReIIMkv9bGGr8hRPZwV0cF1MVL3ELg4VJ1IfDMYc=; b=tRZQuLQh7cZWFBpiVZLNyL8CvW08n/kZiHupMuE/ooTnkvkKmweyAXgLmT20GQzqT3 l/2OZHCKQMJxwxNe2sJLGSbNskTis6rArvdqHSYjB8/Wdci+/WAvN93Ybpd2aOEjiZdf BvfxaVWiKsOFX5Wn+mebL621hCxbRk3DrqYLr8RKkLXgpsgQYW24Wy5lJ4wY/JCyvxHv Y/RwuiO0/+i3wRuRFtla1HabU7tTsBuV1q9ZBYxuNTxBo+zMdHhspy+GvXc8gWCjrRK4 gLn8wS02Xvb667cjSjIosEceJqjoIsfiaNmlaRQAOcsfmp9Jfy7uQYhu5F9zWGhxsgXY MQYw== X-Gm-Message-State: AOUpUlFYVLn5b3LfhAeCjVX3TrHHmkqEOl/q3jWkkK6muUzSpCfAYfJl UuJ019sn4kJhXcrWpoOuWb7mD56E880= X-Google-Smtp-Source: AA+uWPxixi2Khk2gdxVtFAPdkUwTKu9hMih353cmyGvmFsvAcgx77THYpbigHTl7axnI20LKt8auHw== X-Received: by 2002:a50:b53a:: with SMTP id y55-v6mr10504325edd.191.1534766561545; Mon, 20 Aug 2018 05:02:41 -0700 (PDT) Received: from emanuele-MacBookPro.mobile.usilu.net ([194.230.159.211]) by smtp.gmail.com with ESMTPSA id b20-v6sm1348486edc.30.2018.08.20.05.02.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 05:02:40 -0700 (PDT) From: Emanuele Giuseppe Esposito To: qemu-devel@nongnu.org Date: Mon, 20 Aug 2018 14:02:09 +0200 Message-Id: <20180820120213.11095-13-e.emanuelegiuseppe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> References: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::542 Subject: [Qemu-devel] [PATCH 12/16] test/qgraph: usb-hcd-ohci test node X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Dmitry Fleytman , Fam Zheng , =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Amit Shah , Jason Wang , "Michael S. Tsirkin" , Emanuele Giuseppe Esposito , Alexander Graf , Greg Kurz , Keith Busch , qemu-ppc@nongnu.org, Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , John Snow , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Convert tests/usb-hcd-ohci-test in qgraph test node, usb-hcd-ohci-test. Since it's a nop test, node creation and initialization is made in the same file. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 4 +--- tests/usb-hcd-ohci-test.c | 46 +++++++++++++++++++++++++++++---------- 2 files changed, 35 insertions(+), 15 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 5b006b85d1..e60890adb9 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -268,7 +268,6 @@ check-qtest-i386-y += tests/i82801b11-test$(EXESUF) gcov-files-i386-y += hw/pci-bridge/i82801b11.c check-qtest-i386-y += tests/ioh3420-test$(EXESUF) gcov-files-i386-y += hw/pci-bridge/ioh3420.c -check-qtest-i386-y += tests/usb-hcd-ohci-test$(EXESUF) gcov-files-i386-y += hw/usb/hcd-ohci.c check-qtest-i386-y += tests/usb-hcd-uhci-test$(EXESUF) gcov-files-i386-y += hw/usb/hcd-uhci.c @@ -331,7 +330,6 @@ check-qtest-ppc64-y += tests/pnv-xscom-test$(EXESUF) check-qtest-ppc64-y += tests/migration-test$(EXESUF) check-qtest-ppc64-y += tests/rtas-test$(EXESUF) check-qtest-ppc64-$(CONFIG_SLIRP) += tests/pxe-test$(EXESUF) -check-qtest-ppc64-y += tests/usb-hcd-ohci-test$(EXESUF) gcov-files-ppc64-y += hw/usb/hcd-ohci.c check-qtest-ppc64-y += tests/usb-hcd-uhci-test$(EXESUF) gcov-files-ppc64-y += hw/usb/hcd-uhci.c @@ -793,6 +791,7 @@ libqgraph-tests-obj-y += tests/ne2000-test.o libqgraph-tests-obj-y += tests/nvme-test.o libqgraph-tests-obj-y += tests/pcnet-test.o libqgraph-tests-obj-y += tests/spapr-phb-test.o +libqgraph-tests-obj-y += tests/usb-hcd-ohci-test.o $(libqos-usb-obj-y) check-unit-y += tests/test-qgraph$(EXESUF) tests/test-qgraph$(EXESUF): tests/test-qgraph.o $(libqgraph-obj-y) @@ -844,7 +843,6 @@ tests/i82801b11-test$(EXESUF): tests/i82801b11-test.o tests/es1370-test$(EXESUF): tests/es1370-test.o tests/intel-hda-test$(EXESUF): tests/intel-hda-test.o tests/ioh3420-test$(EXESUF): tests/ioh3420-test.o -tests/usb-hcd-ohci-test$(EXESUF): tests/usb-hcd-ohci-test.o $(libqos-usb-obj-y) tests/usb-hcd-uhci-test$(EXESUF): tests/usb-hcd-uhci-test.o $(libqos-usb-obj-y) tests/usb-hcd-ehci-test$(EXESUF): tests/usb-hcd-ehci-test.o $(libqos-usb-obj-y) tests/usb-hcd-xhci-test$(EXESUF): tests/usb-hcd-xhci-test.o $(libqos-usb-obj-y) diff --git a/tests/usb-hcd-ohci-test.c b/tests/usb-hcd-ohci-test.c index 4758813d78..9796c1e02d 100644 --- a/tests/usb-hcd-ohci-test.c +++ b/tests/usb-hcd-ohci-test.c @@ -10,30 +10,52 @@ #include "qemu/osdep.h" #include "libqtest.h" #include "libqos/usb.h" +#include "libqos/qgraph.h" +typedef struct QOhci_pci QOhci_pci; -static void test_ohci_init(void) -{ +struct QOhci_pci { + QOSGraphObject obj; +}; +/* Tests only initialization so far. TODO: Replace with functional tests */ +static void test_ohci_init(void *obj, void *data, QGuestAllocator *alloc) +{ } -static void test_ohci_hotplug(void) +static void test_ohci_hotplug(void *obj, void *data, QGuestAllocator *alloc) { usb_test_hotplug("ohci", 1, NULL); } -int main(int argc, char **argv) +static void ohci_pci_destructor(QOSGraphObject *obj) +{ + QOhci_pci *ohci_pci = (QOhci_pci *)obj; + g_free(ohci_pci); +} + +static void *ohci_pci_create(void *pci_bus, QGuestAllocator *alloc, void *addr) { - int ret; + QOhci_pci *ohci_pci = g_new0(QOhci_pci, 1); + ohci_pci->obj.destructor = ohci_pci_destructor; - g_test_init(&argc, &argv, NULL); + return &ohci_pci->obj; +} - qtest_add_func("/ohci/pci/init", test_ohci_init); - qtest_add_func("/ohci/pci/hotplug", test_ohci_hotplug); +static void ohci_pci_register_nodes(void) +{ + qos_node_create_driver("pci-ohci", ohci_pci_create); + qos_node_consumes("pci-ohci", "pci-bus", &(QOSGraphEdgeOptions) { + .extra_device_opts = "id=ohci", + }); +} - qtest_start("-device pci-ohci,id=ohci"); - ret = g_test_run(); - qtest_end(); +libqos_init(ohci_pci_register_nodes); - return ret; +static void register_ohci_pci_test(void) +{ + qos_add_test("ohci_pci-test-nop", "pci-ohci", test_ohci_init, NULL); + qos_add_test("ohci_pci-test-hotplug", "pci-ohci", test_ohci_hotplug, NULL); } + +libqos_init(register_ohci_pci_test); From patchwork Mon Aug 20 12:02:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emanuele Giuseppe Esposito X-Patchwork-Id: 959645 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="lgqk2DJ+"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vCKl0lZPz9s3C for ; Mon, 20 Aug 2018 22:09:47 +1000 (AEST) Received: from localhost ([::1]:46695 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frj0C-0003Ge-LP for incoming@patchwork.ozlabs.org; Mon, 20 Aug 2018 08:09:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32902) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fritS-000619-Bd for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fritQ-0002bU-UC for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:46 -0400 Received: from mail-ed1-x542.google.com ([2a00:1450:4864:20::542]:32959) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fritQ-0002aq-Kd; Mon, 20 Aug 2018 08:02:44 -0400 Received: by mail-ed1-x542.google.com with SMTP id h9-v6so898157edr.0; Mon, 20 Aug 2018 05:02:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=13ZGytJfuYcLih9nkrJD1EdKh4SZ207JxOPzsUsmY9c=; b=lgqk2DJ+7Uz+PGbdRbIcsE38AlFZVriMwU65rVqQQpYRe6NaPoNiIlvv1+R4cD9CbV PGxJDtaHABGuwh4ia9DKGJlKCPWMK0Dpf7e6BJuXEyKg12chOAkBr1eRv2bbLQfuovfY KJox2jfxevNGnWZQqd2JoPJHrIH3VYssphENL8lvCKjZ/PPs+Gct3kvRf9/+4HoUu14E b483Y2t5Gf2ZoHMIAs/LvQwpCl2qNrSml8cqw6AU2w++pO+BuvneNbmyne1IofAzv10U /fg49SFGqMowxAzy3seyIHa2h4FW+M2EOoKhtHPqf9OspFuphu7gt4IP646zes41cvJ0 tDvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=13ZGytJfuYcLih9nkrJD1EdKh4SZ207JxOPzsUsmY9c=; b=tVZGpXNnnlcYKQcpaPWTJKM9c+iuUemWXQojNTOCqJo8oaWkzeghgmh4uk4BvIgmzs RRcW/aNmt7JQpzLyq9mADfBAWFOe6FsiOoGp7S7BK3O7LY6kenB54I/NX/Y1oXZ5u3n0 o5oLoXXbb0ExTE6e7STJvAdKiUtUToznxYt5kbByisTsrVhy2gmZqU3tnTbXWUnsaIxP 2FBV5TONx6XuKviKs9FSocElRG2szKW/95r3QBJp/RB9S8E4+VlJ3P9iQmvdPx+a9xa+ qbOGmZBtMEIrhe4vy4u8ZPmEjHC0/qM8BomAjcRPWIE2+F5z9mx+ivuYcLRwxCQoRY5M DMaw== X-Gm-Message-State: AOUpUlGZErU6XP7N8rU3U+XN/cvU5L9sWJI+N60MmX6PU8AMQN3ia0gC sjcpl8KeGZVPgII8A6gxwpupdjTwO6Q= X-Google-Smtp-Source: AA+uWPy5yWRzHPK/419k0HJIzuUFDE6TVVyel+/jh5N6aJ90FxZrtNrmdCEVe8B8tvplPOyjngaLrA== X-Received: by 2002:a50:b642:: with SMTP id c2-v6mr54202316ede.288.1534766563283; Mon, 20 Aug 2018 05:02:43 -0700 (PDT) Received: from emanuele-MacBookPro.mobile.usilu.net ([194.230.159.211]) by smtp.gmail.com with ESMTPSA id b20-v6sm1348486edc.30.2018.08.20.05.02.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 05:02:42 -0700 (PDT) From: Emanuele Giuseppe Esposito To: qemu-devel@nongnu.org Date: Mon, 20 Aug 2018 14:02:10 +0200 Message-Id: <20180820120213.11095-14-e.emanuelegiuseppe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> References: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::542 Subject: [Qemu-devel] [PATCH 13/16] test/qgraph: vmxnet3 test node X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Dmitry Fleytman , Fam Zheng , =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Amit Shah , Jason Wang , "Michael S. Tsirkin" , Emanuele Giuseppe Esposito , Alexander Graf , Greg Kurz , Keith Busch , qemu-ppc@nongnu.org, Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , John Snow , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Convert tests/vmxnet3-test in qgraph test node, vmxnet3-test. Since it's a nop test, node creation and initialization is made in the same file. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 3 +-- tests/vmxnet3-test.c | 39 ++++++++++++++++++++++++++++++--------- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index e60890adb9..9370f79f2c 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -258,7 +258,6 @@ check-qtest-i386-y += tests/tco-test$(EXESUF) gcov-files-i386-y += hw/watchdog/watchdog.c hw/watchdog/wdt_ib700.c check-qtest-i386-y += $(check-qtest-pci-y) gcov-files-i386-y += $(gcov-files-pci-y) -check-qtest-i386-y += tests/vmxnet3-test$(EXESUF) gcov-files-i386-y += hw/net/vmxnet3.c gcov-files-i386-y += hw/net/net_rx_pkt.c gcov-files-i386-y += hw/net/net_tx_pkt.c @@ -792,6 +791,7 @@ libqgraph-tests-obj-y += tests/nvme-test.o libqgraph-tests-obj-y += tests/pcnet-test.o libqgraph-tests-obj-y += tests/spapr-phb-test.o libqgraph-tests-obj-y += tests/usb-hcd-ohci-test.o $(libqos-usb-obj-y) +libqgraph-tests-obj-y += tests/vmxnet3-test.o check-unit-y += tests/test-qgraph$(EXESUF) tests/test-qgraph$(EXESUF): tests/test-qgraph.o $(libqgraph-obj-y) @@ -828,7 +828,6 @@ tests/e1000-test$(EXESUF): tests/e1000-test.o tests/rtl8139-test$(EXESUF): tests/rtl8139-test.o $(libqos-pc-obj-y) tests/pnv-xscom-test$(EXESUF): tests/pnv-xscom-test.o tests/eepro100-test$(EXESUF): tests/eepro100-test.o -tests/vmxnet3-test$(EXESUF): tests/vmxnet3-test.o tests/wdt_ib700-test$(EXESUF): tests/wdt_ib700-test.o tests/tco-test$(EXESUF): tests/tco-test.o $(libqos-pc-obj-y) tests/virtio-ccw-test$(EXESUF): tests/virtio-ccw-test.o diff --git a/tests/vmxnet3-test.c b/tests/vmxnet3-test.c index 159c0ad728..2bbd0352fa 100644 --- a/tests/vmxnet3-test.c +++ b/tests/vmxnet3-test.c @@ -9,23 +9,44 @@ #include "qemu/osdep.h" #include "libqtest.h" +#include "libqos/qgraph.h" + +typedef struct QVmxnet3 QVmxnet3; + +struct QVmxnet3 { + QOSGraphObject obj; +}; /* Tests only initialization so far. TODO: Replace with functional tests */ -static void nop(void) +static void nop(void *obj, void *data, QGuestAllocator *alloc) +{ +} + +static void vmxnet3_destructor(QOSGraphObject *obj) { + QVmxnet3 *vmxnet3 = (QVmxnet3 *)obj; + g_free(vmxnet3); } -int main(int argc, char **argv) +static void *vmxnet3_create(void *pci_bus, QGuestAllocator *alloc, void *addr) { - int ret; + QVmxnet3 *vmxnet3 = g_new0(QVmxnet3, 1); + vmxnet3->obj.destructor = vmxnet3_destructor; - g_test_init(&argc, &argv, NULL); - qtest_add_func("/vmxnet3/nop", nop); + return &vmxnet3->obj; +} - qtest_start("-device vmxnet3"); - ret = g_test_run(); +static void vmxnet3_register_nodes(void) +{ + qos_node_create_driver("vmxnet3", vmxnet3_create); + qos_node_consumes("vmxnet3", "pci-bus", NULL); +} - qtest_end(); +libqos_init(vmxnet3_register_nodes); - return ret; +static void register_vmxnet3_test(void) +{ + qos_add_test("vmxnet3-test", "vmxnet3", nop, NULL); } + +libqos_init(register_vmxnet3_test); From patchwork Mon Aug 20 12:02:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emanuele Giuseppe Esposito X-Patchwork-Id: 959648 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="di+2x8DS"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vCNf3MHmz9s4s for ; Mon, 20 Aug 2018 22:12:18 +1000 (AEST) Received: from localhost ([::1]:46722 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frj2e-0006Id-2B for incoming@patchwork.ozlabs.org; Mon, 20 Aug 2018 08:12:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32953) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fritT-00062u-R6 for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fritS-0002eZ-Q9 for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:47 -0400 Received: from mail-ed1-x543.google.com ([2a00:1450:4864:20::543]:37280) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fritS-0002dT-FD; Mon, 20 Aug 2018 08:02:46 -0400 Received: by mail-ed1-x543.google.com with SMTP id b10-v6so8331785eds.4; Mon, 20 Aug 2018 05:02:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KpCuCxOgGuJFQVwgp5+0g/k52+1pJ/dHu8t7O5z6Fw8=; b=di+2x8DSuWedYrqcjlpWBkLM1RY3i2kfJwL10/L1azY/z9/4G+/8JuKKkxlZR3WXVR /35gCCPR4/xD8eB9Bri6TQMdhN4qFUcRnuE1pqnNc/1NRtuE9iPd9XJpliyYQLWw9m9w qbfUisPZTiN7vd1YOrqHdShmzyr8ALDUD6dRyPMQaSmebktrveyyJ+xipw7a8vDRcqqH yRy1PyzG/fBeMn06EjdsZjAeJrogdLdcOsxKQhYGoUFC+9smqXSUjxP9QjFJMOJHpBH0 gm3+hnUxMYSM0X0UnyrBk1hpjBs0nq9YPwY8fkgAY5fCVq2fGLq8vXa5qsoCD3UVxvjW FCzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KpCuCxOgGuJFQVwgp5+0g/k52+1pJ/dHu8t7O5z6Fw8=; b=jt4BWcT4csPXSTAKBYoeJyJnUcGgK+Kod4UGx1ldQBMYwS43JFTm7fWuTZrnI0/4Is ZQ+GQgD5c4UNfz/mzDRjVI9az3xDIc6xatOZNv6Juxp6HoI0Qaw2XOujx7KE2xoPgMb8 AnKpJF4wBANzGVjnYby6lV7B1U4RS7+P4NCIHwMGzG7+tLT28kZ5WS2dwJK3o4idtM2F X8DvF9njLHZzJ7/supBFXH6kPXtZFwlW8NHMFtOCUaijdBBVbzDMbTiVlJD/dCEvPj5v zXxuy6DWU0LAQIJH09XuodeMBYLF0HO9SJmwaP2LCTEqIH1w2PQ96kSykuWuiXRj+rU4 JT6w== X-Gm-Message-State: APzg51AKTTeHd+y/m/N3oULlVC7Y8hX/S7ddXCK04qVrXg6eNz/haz1U akIPBFs5leMFCn/WlMXvN1VIywuTQzQ= X-Google-Smtp-Source: ANB0VdZ4RVkH07dj8Y55oB9iZiVglltnCbJk9EgATcRaEm/oNMpBZ+9jjOI6eOf6nbpUahHzSXc+5Q== X-Received: by 2002:a50:8ea1:: with SMTP id w30-v6mr1973282edw.197.1534766565012; Mon, 20 Aug 2018 05:02:45 -0700 (PDT) Received: from emanuele-MacBookPro.mobile.usilu.net ([194.230.159.211]) by smtp.gmail.com with ESMTPSA id b20-v6sm1348486edc.30.2018.08.20.05.02.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 05:02:44 -0700 (PDT) From: Emanuele Giuseppe Esposito To: qemu-devel@nongnu.org Date: Mon, 20 Aug 2018 14:02:11 +0200 Message-Id: <20180820120213.11095-15-e.emanuelegiuseppe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> References: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::543 Subject: [Qemu-devel] [PATCH 14/16] test/qgraph: es1370 test node X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Dmitry Fleytman , Fam Zheng , =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Amit Shah , Jason Wang , "Michael S. Tsirkin" , Emanuele Giuseppe Esposito , Alexander Graf , Greg Kurz , Keith Busch , qemu-ppc@nongnu.org, Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , John Snow , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Convert tests/es1370-test in qgraph test node, es1370-test. Since it's a nop test, node creation and initialization is made in the same file. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 3 +-- tests/es1370-test.c | 39 ++++++++++++++++++++++++++++++--------- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 9370f79f2c..46ef183c5f 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -214,7 +214,6 @@ gcov-files-pci-y += hw/net/eepro100.c gcov-files-pci-y += hw/net/ne2000.c gcov-files-pci-y += hw/block/nvme.c gcov-files-pci-y += hw/audio/ac97.c -check-qtest-pci-y += tests/es1370-test$(EXESUF) gcov-files-pci-y += hw/audio/es1370.c check-qtest-pci-y += $(check-qtest-virtio-y) gcov-files-pci-y += $(gcov-files-virtio-y) hw/virtio/virtio-pci.c @@ -792,6 +791,7 @@ libqgraph-tests-obj-y += tests/pcnet-test.o libqgraph-tests-obj-y += tests/spapr-phb-test.o libqgraph-tests-obj-y += tests/usb-hcd-ohci-test.o $(libqos-usb-obj-y) libqgraph-tests-obj-y += tests/vmxnet3-test.o +libqgraph-tests-obj-y += tests/es1370-test.o check-unit-y += tests/test-qgraph$(EXESUF) tests/test-qgraph$(EXESUF): tests/test-qgraph.o $(libqgraph-obj-y) @@ -839,7 +839,6 @@ tests/drive_del-test$(EXESUF): tests/drive_del-test.o $(libqos-virtio-obj-y) tests/qdev-monitor-test$(EXESUF): tests/qdev-monitor-test.o $(libqos-pc-obj-y) tests/pvpanic-test$(EXESUF): tests/pvpanic-test.o tests/i82801b11-test$(EXESUF): tests/i82801b11-test.o -tests/es1370-test$(EXESUF): tests/es1370-test.o tests/intel-hda-test$(EXESUF): tests/intel-hda-test.o tests/ioh3420-test$(EXESUF): tests/ioh3420-test.o tests/usb-hcd-uhci-test$(EXESUF): tests/usb-hcd-uhci-test.o $(libqos-usb-obj-y) diff --git a/tests/es1370-test.c b/tests/es1370-test.c index 199fe193ce..a734dbe404 100644 --- a/tests/es1370-test.c +++ b/tests/es1370-test.c @@ -9,23 +9,44 @@ #include "qemu/osdep.h" #include "libqtest.h" +#include "libqos/qgraph.h" + +typedef struct QES1370 QES1370; + +struct QES1370 { + QOSGraphObject obj; +}; /* Tests only initialization so far. TODO: Replace with functional tests */ -static void nop(void) +static void nop(void *obj, void *data, QGuestAllocator *alloc) +{ +} + +static void es1370_destructor(QOSGraphObject *obj) { + QES1370 *es1370 = (QES1370 *)obj; + g_free(es1370); } -int main(int argc, char **argv) +static void *es1370_create(void *pci_bus, QGuestAllocator *alloc, void *addr) { - int ret; + QES1370 *es1370 = g_new0(QES1370, 1); + es1370->obj.destructor = es1370_destructor; - g_test_init(&argc, &argv, NULL); - qtest_add_func("/es1370/nop", nop); + return &es1370->obj; +} - qtest_start("-device ES1370"); - ret = g_test_run(); +static void es1370_register_nodes(void) +{ + qos_node_create_driver("ES1370", es1370_create); + qos_node_consumes("ES1370", "pci-bus", NULL); +} - qtest_end(); +libqos_init(es1370_register_nodes); - return ret; +static void register_es1370_test(void) +{ + qos_add_test("es1370-test", "ES1370", nop, NULL); } + +libqos_init(register_es1370_test); From patchwork Mon Aug 20 12:02:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emanuele Giuseppe Esposito X-Patchwork-Id: 959643 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="i5hJoxa4"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vCH218JQz9s4v for ; Mon, 20 Aug 2018 22:07:26 +1000 (AEST) Received: from localhost ([::1]:46681 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frixv-0001O9-OR for incoming@patchwork.ozlabs.org; Mon, 20 Aug 2018 08:07:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33015) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fritV-00065U-Pd for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fritU-0002gC-Lq for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:49 -0400 Received: from mail-ed1-x541.google.com ([2a00:1450:4864:20::541]:36416) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fritU-0002fW-Dk; Mon, 20 Aug 2018 08:02:48 -0400 Received: by mail-ed1-x541.google.com with SMTP id k15-v6so8339137edr.3; Mon, 20 Aug 2018 05:02:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DpQOrZe31eNElj0Qc9wdZ7jvjs1JOUqB/OChXNp6tTk=; b=i5hJoxa47ZYZC9LpZ/9guQ318a7K8WKBNIylj9zZIBNsCHr2Z+GScrFRNBkfHrIkHy qgMfBTHyRnxRD7VUdmAsA6wtrvnEl782pRnnCBtPG7z2SLRnGQfyuUWoR0rFVUxIcmWU bypb/jZZNjUAVbcEo8McHkKUiOmSkXxPPAvR3pn0tzGwtJswxmpG6w5BDf/XDc4Rp6Tx gOnh7ojSXD995uJgeJn4epRSc4EI/ahCsG/19s2RxST5YbYEJLNG8DaRcU5UuI71esHR O7NfxxESKV71StSakqQeZBYsqLuiCOKs9PcKhSoZUpJd/C1SDchW3i9+XEIUc9Hg9gPG o+cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DpQOrZe31eNElj0Qc9wdZ7jvjs1JOUqB/OChXNp6tTk=; b=bDlqbsq9DSba0CDgRP4I/tuvQgVs8CmDvHEAdVv2GXGf/i0bj415sDuPqpwOIP81Ur Uy4cvUBq3Orp849KhyBZR45YofmYu4sMObVahICz0XdU+gGq0MZFWref0vDjo2gNvQBK Pkq9gml6jBTww51+Q46xUx5BHYJq0s3C43OCruvA1loNdY2InjOjyQIJCWMCVIa8kjql Jec6Kr/HNlg3RreHwhDhqaBxOt1QeWPq50o2TlzplQSeT/SZxmvrfCjvs0wFOctVUqL0 EPH3AIpXnPmZ914mNH22ysX6eO/9+bKErYrz2Zv5u9p/faj8pvcECGh8siUv+IM1ASun FvNw== X-Gm-Message-State: AOUpUlGjLdyX3BuzKDEgNvxMeOWNks9rSOJo+ZqHMVy1iVLproyzj4sb 08I2QTln/uH5K+sL1T2MyIorr7715LE= X-Google-Smtp-Source: AA+uWPzw0a2K8rJQmSAT3t2Wbwzd5YwqZUmqYNSvalND4XpTc8C1eKzP2s/DjvvKCdCdnJiITE+GSg== X-Received: by 2002:a50:ba39:: with SMTP id g54-v6mr10310488edc.148.1534766566788; Mon, 20 Aug 2018 05:02:46 -0700 (PDT) Received: from emanuele-MacBookPro.mobile.usilu.net ([194.230.159.211]) by smtp.gmail.com with ESMTPSA id b20-v6sm1348486edc.30.2018.08.20.05.02.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 05:02:46 -0700 (PDT) From: Emanuele Giuseppe Esposito To: qemu-devel@nongnu.org Date: Mon, 20 Aug 2018 14:02:12 +0200 Message-Id: <20180820120213.11095-16-e.emanuelegiuseppe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> References: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::541 Subject: [Qemu-devel] [PATCH 15/16] test/qgraph: eepro100 test node X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Dmitry Fleytman , Fam Zheng , =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Amit Shah , Jason Wang , "Michael S. Tsirkin" , Emanuele Giuseppe Esposito , Alexander Graf , Greg Kurz , Keith Busch , qemu-ppc@nongnu.org, Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , John Snow , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Convert tests/eepro100-test in qgraph test nodes, eepro100-test. Since it's a nop test, node creation and initialization is made in the same file. In addition, all nodes share the same constructor and destructor. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 3 +-- tests/eepro100-test.c | 61 +++++++++++++++++++++++++++--------------- 2 files changed, 41 insertions(+), 23 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 46ef183c5f..e7893cac65 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -209,7 +209,6 @@ check-qtest-pci-y += tests/rtl8139-test$(EXESUF) gcov-files-pci-y += hw/net/rtl8139.c gcov-files-pci-y += hw/net/pcnet.c gcov-files-pci-y += hw/net/pcnet-pci.c -check-qtest-pci-y += tests/eepro100-test$(EXESUF) gcov-files-pci-y += hw/net/eepro100.c gcov-files-pci-y += hw/net/ne2000.c gcov-files-pci-y += hw/block/nvme.c @@ -792,6 +791,7 @@ libqgraph-tests-obj-y += tests/spapr-phb-test.o libqgraph-tests-obj-y += tests/usb-hcd-ohci-test.o $(libqos-usb-obj-y) libqgraph-tests-obj-y += tests/vmxnet3-test.o libqgraph-tests-obj-y += tests/es1370-test.o +libqgraph-tests-obj-y += tests/eepro100-test.o check-unit-y += tests/test-qgraph$(EXESUF) tests/test-qgraph$(EXESUF): tests/test-qgraph.o $(libqgraph-obj-y) @@ -827,7 +827,6 @@ tests/fw_cfg-test$(EXESUF): tests/fw_cfg-test.o $(libqos-pc-obj-y) tests/e1000-test$(EXESUF): tests/e1000-test.o tests/rtl8139-test$(EXESUF): tests/rtl8139-test.o $(libqos-pc-obj-y) tests/pnv-xscom-test$(EXESUF): tests/pnv-xscom-test.o -tests/eepro100-test$(EXESUF): tests/eepro100-test.o tests/wdt_ib700-test$(EXESUF): tests/wdt_ib700-test.o tests/tco-test$(EXESUF): tests/tco-test.o $(libqos-pc-obj-y) tests/virtio-ccw-test$(EXESUF): tests/virtio-ccw-test.o diff --git a/tests/eepro100-test.c b/tests/eepro100-test.c index bdc8a67d57..432695f422 100644 --- a/tests/eepro100-test.c +++ b/tests/eepro100-test.c @@ -9,23 +9,13 @@ #include "qemu/osdep.h" #include "libqtest.h" +#include "libqos/qgraph.h" -static void test_device(gconstpointer data) -{ - const char *model = data; - QTestState *s; - char *args; - - args = g_strdup_printf("-device %s", model); - s = qtest_start(args); +typedef struct QEepro100 QEepro100; - /* Tests only initialization so far. TODO: Implement functional tests */ - - if (s) { - qtest_quit(s); - } - g_free(args); -} +struct QEepro100 { + QOSGraphObject obj; +}; static const char *models[] = { "i82550", @@ -43,19 +33,48 @@ static const char *models[] = { "i82801", }; -int main(int argc, char **argv) +/* Tests only initialization so far. TODO: Replace with functional tests */ +static void nop(void *obj, void *data, QGuestAllocator *alloc) +{ +} + +static void eepro100_destructor(QOSGraphObject *obj) +{ + QEepro100 *eepro100 = (QEepro100 *)obj; + g_free(eepro100); +} + +static void *eepro100_create(void *pci_bus, QGuestAllocator *alloc, void *addr) +{ + QEepro100 *eepro100 = g_new0(QEepro100, 1); + eepro100->obj.destructor = eepro100_destructor; + + return &eepro100->obj; +} + +static void eepro100_register_nodes(void) { int i; - g_test_init(&argc, &argv, NULL); + for (i = 0; i < ARRAY_SIZE(models); i++) { + qos_node_create_driver(models[i], eepro100_create); + qos_node_consumes(models[i], "pci-bus", NULL); + } +} + +libqos_init(eepro100_register_nodes); + +static void register_eepro100_test(void) +{ + int i; for (i = 0; i < ARRAY_SIZE(models); i++) { char *path; - path = g_strdup_printf("eepro100/%s", models[i]); - qtest_add_data_func(path, models[i], test_device); + path = g_strdup_printf("%s-eepro100-test", models[i]); + qos_add_test(path, models[i], nop, NULL); g_free(path); } - - return g_test_run(); } + +libqos_init(register_eepro100_test); From patchwork Mon Aug 20 12:02:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emanuele Giuseppe Esposito X-Patchwork-Id: 959656 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ktL5AURl"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41vCSc5dTWz9s4s for ; Mon, 20 Aug 2018 22:15:44 +1000 (AEST) Received: from localhost ([::1]:46752 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frj5y-0000U4-Dj for incoming@patchwork.ozlabs.org; Mon, 20 Aug 2018 08:15:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33148) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fritb-0006AC-VK for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fritW-0002hL-3a for qemu-devel@nongnu.org; Mon, 20 Aug 2018 08:02:55 -0400 Received: from mail-ed1-x544.google.com ([2a00:1450:4864:20::544]:38358) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fritV-0002gj-Ry; Mon, 20 Aug 2018 08:02:50 -0400 Received: by mail-ed1-x544.google.com with SMTP id t2-v6so8328159edr.5; Mon, 20 Aug 2018 05:02:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Y9RZky4qBZJa7kfu8J7o4pHxLpKtm6W9P8orqbVwgGg=; b=ktL5AURlgIb3bZ9+Mp87UfoHkcbpmj5Kgv5a15T4lKphOtENPLVF13P4rrJX+gOGgu rDOdiVFEb6Zq2z5hVJNJUvdntZ2GBuwZEiXtzNGtYoGpHObiXd8h8nhjBIKYhCjlrubj fz/18HpOdsH810Fuq37YS/1M+usFwSVeyAN6ETreH31DK+4BkrzPwWRxitWnJCEu4mHF BK/QTTCGPT1pV5cmDR4nfKoRCUu+rlJ3SfmcE3zATqJIolNRtXdvAJlCyXuXxtHU6KYt h2i8JCr8+yf2m+mRM6p+OkJArUs0aXNowdVnvHosd8xpt8gICtWAQBHhNjrWcZPuQ4px tcxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Y9RZky4qBZJa7kfu8J7o4pHxLpKtm6W9P8orqbVwgGg=; b=WnTnDFXLEEWd6mA8Oly7zUbGhJt1ZKXCVVJTQB2SbMLyFz66PBMM73Xt9jcKB1QyX7 yqT3jpg4mUJMWE+URJ8Iu2j7NcqTCZ67K1S1pvd4TgQPzzl94UFk326fJU2Mrh/9lamf SjB45y0TGq8Cx/cnf/hcDCM4izQJgXTV8mTQ3/jT+y8pmc7VVnC5u/jlgoyZ18qXWeIP S5mn5hT4HZPXe+w6LgtViEJVX/6HJ7HGRHlfO3GRNbewA6Ej9zOnEXv1TTzdAwTlN0ob 6w0wXkFWGsPyV9hLcMGPWcpYAKrZBcPqGR9GfjXSqUHRCr/fp4ki/IqZd/JfogvPfJhj Ayug== X-Gm-Message-State: AOUpUlEqPqc0l9tt0SJqRb6w2r/NKW6ceY5igwwhBEnHevqxnIRvKKmT vo1Hq7oBb4UU4w8aBCcb3Ui/RFO8LKk= X-Google-Smtp-Source: AA+uWPyviTewi2QucH7xZkkbYlCv9bvxbA+iJrVVVB2RnwUvO+GY4H574G2K5PcuD11vIxoAmJYzhg== X-Received: by 2002:a50:976d:: with SMTP id d42-v6mr55780790edb.153.1534766568485; Mon, 20 Aug 2018 05:02:48 -0700 (PDT) Received: from emanuele-MacBookPro.mobile.usilu.net ([194.230.159.211]) by smtp.gmail.com with ESMTPSA id b20-v6sm1348486edc.30.2018.08.20.05.02.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 05:02:47 -0700 (PDT) From: Emanuele Giuseppe Esposito To: qemu-devel@nongnu.org Date: Mon, 20 Aug 2018 14:02:13 +0200 Message-Id: <20180820120213.11095-17-e.emanuelegiuseppe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> References: <20180820120213.11095-1-e.emanuelegiuseppe@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::544 Subject: [Qemu-devel] [PATCH 16/16] test/qgraph: e1000 test node X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Dmitry Fleytman , Fam Zheng , =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, Amit Shah , Jason Wang , "Michael S. Tsirkin" , Emanuele Giuseppe Esposito , Alexander Graf , Greg Kurz , Keith Busch , qemu-ppc@nongnu.org, Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , John Snow , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Convert tests/e1000-test in qgraph test nodes, e1000-test. Since it's a nop test, node creation and initialization is made in the same file. In addition, all nodes share the same constructor and destructor. Signed-off-by: Emanuele Giuseppe Esposito --- tests/Makefile.include | 3 +-- tests/e1000-test.c | 60 ++++++++++++++++++++++++++++-------------- 2 files changed, 41 insertions(+), 22 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index e7893cac65..546fdf603c 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -202,7 +202,6 @@ gcov-files-virtio-y += i386-softmmu/hw/char/virtio-serial-bus.c check-qtest-virtio-y += $(check-qtest-virtioserial-y) gcov-files-virtio-y += $(gcov-files-virtioserial-y) -check-qtest-pci-y += tests/e1000-test$(EXESUF) gcov-files-pci-y += hw/net/e1000.c gcov-files-pci-y += hw/net/e1000e.c hw/net/e1000e_core.c check-qtest-pci-y += tests/rtl8139-test$(EXESUF) @@ -792,6 +791,7 @@ libqgraph-tests-obj-y += tests/usb-hcd-ohci-test.o $(libqos-usb-obj-y) libqgraph-tests-obj-y += tests/vmxnet3-test.o libqgraph-tests-obj-y += tests/es1370-test.o libqgraph-tests-obj-y += tests/eepro100-test.o +libqgraph-tests-obj-y += tests/e1000-test.o check-unit-y += tests/test-qgraph$(EXESUF) tests/test-qgraph$(EXESUF): tests/test-qgraph.o $(libqgraph-obj-y) @@ -824,7 +824,6 @@ tests/m25p80-test$(EXESUF): tests/m25p80-test.o tests/i440fx-test$(EXESUF): tests/i440fx-test.o $(libqos-pc-obj-y) tests/q35-test$(EXESUF): tests/q35-test.o $(libqos-pc-obj-y) tests/fw_cfg-test$(EXESUF): tests/fw_cfg-test.o $(libqos-pc-obj-y) -tests/e1000-test$(EXESUF): tests/e1000-test.o tests/rtl8139-test$(EXESUF): tests/rtl8139-test.o $(libqos-pc-obj-y) tests/pnv-xscom-test$(EXESUF): tests/pnv-xscom-test.o tests/wdt_ib700-test$(EXESUF): tests/wdt_ib700-test.o diff --git a/tests/e1000-test.c b/tests/e1000-test.c index 0c5fcdcc44..93e47abc2c 100644 --- a/tests/e1000-test.c +++ b/tests/e1000-test.c @@ -9,22 +9,13 @@ #include "qemu/osdep.h" #include "libqtest.h" +#include "libqos/qgraph.h" -/* Tests only initialization so far. TODO: Replace with functional tests */ -static void test_device(gconstpointer data) -{ - const char *model = data; - QTestState *s; - char *args; +typedef struct QE1000 QE1000; - args = g_strdup_printf("-device %s", model); - s = qtest_start(args); - - if (s) { - qtest_quit(s); - } - g_free(args); -} +struct QE1000 { + QOSGraphObject obj; +}; static const char *models[] = { "e1000", @@ -33,19 +24,48 @@ static const char *models[] = { "e1000-82545em", }; -int main(int argc, char **argv) +/* Tests only initialization so far. TODO: Replace with functional tests */ +static void nop(void *obj, void *data, QGuestAllocator *alloc) +{ +} + +static void e1000_destructor(QOSGraphObject *obj) +{ + QE1000 *e1000 = (QE1000 *)obj; + g_free(e1000); +} + +static void *e1000_create(void *pci_bus, QGuestAllocator *alloc, void *addr) +{ + QE1000 *e1000 = g_new0(QE1000, 1); + e1000->obj.destructor = e1000_destructor; + + return &e1000->obj; +} + +static void e1000_register_nodes(void) { int i; - g_test_init(&argc, &argv, NULL); + for (i = 0; i < ARRAY_SIZE(models); i++) { + qos_node_create_driver(models[i], e1000_create); + qos_node_consumes(models[i], "pci-bus", NULL); + } +} + +libqos_init(e1000_register_nodes); + +static void register_e1000_test(void) +{ + int i; for (i = 0; i < ARRAY_SIZE(models); i++) { char *path; - path = g_strdup_printf("e1000/%s", models[i]); - qtest_add_data_func(path, models[i], test_device); + path = g_strdup_printf("%s-e1000-test", models[i]); + qos_add_test(path, models[i], nop, NULL); g_free(path); } - - return g_test_run(); } + +libqos_init(register_e1000_test);