[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/4] qdev: Don't compile hotplug code in user-mo
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 3/4] qdev: Don't compile hotplug code in user-mode emulation |
Date: |
Fri, 26 Apr 2019 10:27:58 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
On 25/04/19 22:00, Eduardo Habkost wrote:
> diff --git a/hw/core/qdev-hotplug-stubs.c b/hw/core/qdev-hotplug-stubs.c
> new file mode 100644
> index 0000000000..c710f23388
> --- /dev/null
> +++ b/hw/core/qdev-hotplug-stubs.c
> @@ -0,0 +1,44 @@
> +/*
> + * qdev hotplug handler stubs (for user-mode emulation and unit tests)
Can you explain the issue with unit tests in the commit message?
> + * Copyright (c) 2019 Red Hat Inc
> + *
> + * Authors:
> + * Eduardo Habkost <address@hidden>
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2 of the License, or (at your option) any later version.
> + *
> + * 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
> <http://www.gnu.org/licenses/>.
> + */
> +
> +#include "qemu/osdep.h"
> +#include "hw/qdev-core.h"
> +#include "hw/hotplug.h"
> +
> +HotplugHandler *qdev_get_hotplug_handler(DeviceState *dev)
> +{
> + return NULL;
> +}
> +
> +void hotplug_handler_pre_plug(HotplugHandler *plug_handler,
> + DeviceState *plugged_dev,
> + Error **errp)
> +{
> + assert(plug_handler == NULL);
> +}
> +
> +void hotplug_handler_plug(HotplugHandler *plug_handler,
> + DeviceState *plugged_dev,
> + Error **errp)
> +{
> + assert(plug_handler == NULL);
> +}
Would it work if you instead make these functions (and the others in
hw/core/hotplug.c) inlines in include/hw/hotplug.h?
Then all that remains is qdev_get_hotplug_handler.
Paolo
- [Qemu-devel] [PATCH 0/4] Remove some qdev_get_machine() calls from CONFIG_USER_ONLY, Eduardo Habkost, 2019/04/25
- [Qemu-devel] [PATCH 3/4] qdev: Don't compile hotplug code in user-mode emulation, Eduardo Habkost, 2019/04/25
- Re: [Qemu-devel] [PATCH 3/4] qdev: Don't compile hotplug code in user-mode emulation,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 4/4] qdev-hotplug: Don't check type of qdev_get_machine(), Eduardo Habkost, 2019/04/25
- [Qemu-devel] [PATCH 1/4] machine: Move gpio code to hw/core/gpio.c, Eduardo Habkost, 2019/04/25
- [Qemu-devel] [PATCH 2/4] move qdev hotplug code to qdev-hotplug.c, Eduardo Habkost, 2019/04/25
- Re: [Qemu-devel] [PATCH 0/4] Remove some qdev_get_machine() calls from CONFIG_USER_ONLY, no-reply, 2019/04/25
- Re: [Qemu-devel] [PATCH 0/4] Remove some qdev_get_machine() calls from CONFIG_USER_ONLY, Like Xu, 2019/04/26