[libvirt] [PATCH v5 2/3] qemu: add dtb option supprt
Daniel P. Berrange
berrange at redhat.com
Tue Mar 19 12:24:43 UTC 2013
On Thu, Mar 14, 2013 at 12:49:43PM +0800, Olivia Yin wrote:
> The "dtb" option sets the filename for the device tree.
> If without this option support, "-dtb file" will be converted into
> <qemu:commandline> in domain XML file.
> For example, '-dtb /media/ram/test.dtb' will be converted into
> <qemu:commandline>
> <qemu:arg value='-dtb'/>
> <qemu:arg value='/media/ram/test.dtb'/>
> </qemu:commandline>
>
> This is not very friendly.
> This patchset add special <dtb> tag like <kernel> and <initrd>
> which is easier for user to write domain XML file.
> <os>
> <type arch='ppc' machine='ppce500v2'>hvm</type>
> <kernel>/media/ram/uImage</kernel>
> <initrd>/media/ram/ramdisk</initrd>
> <dtb>/media/ram/test.dtb</dtb>
> <cmdline>root=/dev/ram rw console=ttyS0,115200</cmdline>
> </os>
> ---
> src/qemu/qemu_capabilities.c | 8 ++++-
> src/qemu/qemu_capabilities.h | 1 +
> src/qemu/qemu_command.c | 6 ++++
> tests/qemuhelptest.c | 30 +++++++++++++------
> tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args | 1 +
> tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.xml | 28 ++++++++++++++++++
> tests/qemuxml2argvtest.c | 2 +
> tests/testutilsqemu.c | 33 ++++++++++++++++++++++
> 8 files changed, 97 insertions(+), 12 deletions(-)
> create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args
> create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.xml
ACK
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index 79cfdb3..636608a 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -210,7 +210,8 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
>
> "rng-random", /* 130 */
> "rng-egd",
> - "virtio-ccw"
> + "virtio-ccw",
> + "dtb",
> );
>
> struct _virQEMUCaps {
> @@ -1173,8 +1174,10 @@ virQEMUCapsComputeCmdFlags(const char *help,
> if (version >= 12000)
> virQEMUCapsSet(qemuCaps, QEMU_CAPS_PCI_ROMBAR);
>
> - if (version >= 11000)
> + if (version >= 11000) {
> virQEMUCapsSet(qemuCaps, QEMU_CAPS_CPU_HOST);
> + virQEMUCapsSet(qemuCaps, QEMU_CAPS_DTB);
> + }
Doesn't '-dtb' show up in the -help output ? If it does, then it
is preferrable to check for that, instead of using a version number
based check
> @@ -2299,6 +2302,7 @@ virQEMUCapsInitQMPBasic(virQEMUCapsPtr qemuCaps)
> virQEMUCapsSet(qemuCaps, QEMU_CAPS_NETDEV_BRIDGE);
> virQEMUCapsSet(qemuCaps, QEMU_CAPS_SECCOMP_SANDBOX);
> virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_KVM_PIT);
> + virQEMUCapsSet(qemuCaps, QEMU_CAPS_DTB);
This bit is fine for QMP.
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
More information about the libvir-list
mailing list