qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v1 1/1] vl.c: Allow sysbus devices to be attache


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH v1 1/1] vl.c: Allow sysbus devices to be attached via commandline
Date: Tue, 15 Apr 2014 17:11:55 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

Hi,

Am 26.03.2014 01:47, schrieb Alistair Francis:
> This patch introduces a new command line argument that allows
> sysbus devices to be attached via the command line.
> 
> This allows devices to be added after the machine init but
> before anything is booted
> 
> The new argument is -sysbusdev
> 
> A new argument is being used to avoid confusion and user
> errors that would appear if the same command for hot-plugging
> was used instead. This could be changed to use -device and
> specify sysbus by using something like 'bus=sysbus' if that
> is preferred
> 
> This patch requires the machine to support this, by passing
> the interrupt controller back to main() OR the device can
> be attached without an IRQ line
> 
> An example usage is adding UART to zynq using these two options:
> -sysbusdev device=cadence_uart,addr=E0000000,irq=27
> -sysbusdev device=cadence_uart,addr=E0001000,irq=50
> 
> Signed-off-by: Alistair Francis <address@hidden>

Since this topic came up on today's KVM call, let me repeat here that
considering how many subtle fixes have gone into the -device and
device_add code paths lately, I am seriously opposed to duplicating that
functionality into a new function. Checks on DeviceClass fields,
reference counting etc. absolutely need to be reused for easy maintenance.

Also please note that there can be multiple MemoryRegions per
SysBusDevice as well as multiple IRQs, so "addr" and "irq" seem
insufficient.

This obviously does not yet constitute a full review of the code.

Regards,
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]