On 09/02/2015 04:23 AM, Ján Tomko wrote:
On Sat, Aug 29, 2015 at 04:19:10PM -0400, Jonathan Toppins wrote:
Adds a new interface type using UDP sockets, this seems only applicable
to QEMU but have edited tree-wide to support the new interface type.

The interface type required the addition of a "localaddr" (local
address), this then maps into the following xml and qemu call.

<interface type='udp'>
        <mac address='52:54:00:5c:67:56'/>
        <source address='127.0.0.1' port='11112' >
                <local address='127.0.0.1' port='22222'/>
        </source>
        <model type='virtio'/>
        <address type='pci' domain='0x0000' bus='0x00' slot='0x07' 
function='0x0'/>
        ...

QEMU call:
        -net socket,udp=127.0.0.1:11112,localaddr=127.0.0.1:22222

Notice the xml "local" entry becomes the "localaddr" for the qemu call.

reference:
http://lists.gnu.org/archive/html/qemu-devel/2011-11/msg00629.html

Signed-off-by: Jonathan Toppins <jtopp...@cumulusnetworks.com>
---

since v1:
  I expect there will be one more round, thanks for the comments thus far. 
Wanted
  to go a head and send this out since it has been a little to long to get to
  this point. Some final issues I am seeing:
  * there seems to be some trouble with adding a new UDP type interface to a
    running VM. Stanley who is CC'ed and helping me test has more details.
  * unittests pass even though qemuxml2argvtest still fails, this appears to be
    due to disk-drive-network-gluster failing - analysis looks to be the URI is
    incorrect, not enough slashes - cuz more is better ;)

Works fine for me, what is your libxml version?
This could be related to
http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=8f17d0e

commit 8f17d0eaae7ee2fa3e214b79b188fc14ed5aa1eb
     util: Prepare URI formatting for libxml2 >= 2.9.2

jtoppins@penguin:~$ apt-cache policy libxml2
libxml2:
  Installed: 2.9.1+dfsg1-5
  Candidate: 2.9.1+dfsg1-5
  Version table:
 *** 2.9.1+dfsg1-5 0
        500 http://ftp.us.debian.org/debian/ jessie/main amd64 Packages
        100 /var/lib/dpkg/status
jtoppins@penguin:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 8.1 (jessie)
Release:        8.1
Codename:       jessie

So looks like its related to the commit listed.


  * please verify I have added the schema correctly, was kinda confusing

  Code Comments:
  [Laine Stump]
  * [DONE] change to using "local" as a nested element inside the "source" 
element
  * [DONE] enhance schema to validate the new formatting of the source and 
local elements
  [Ján Tomko]
  * [DONE] implement unit tests in tests/qemuxml2argvtest.c and 
tests/qemuxml2xmltest.c
  * [DONE] increase verbosity and note when the feature was added in 
formatdomain.html.in

  docs/formatdomain.html.in                        | 24 ++++++++
  docs/schemas/domaincommon.rng                    | 27 +++++++++
  src/conf/domain_conf.c                           | 74 ++++++++++++++++++++++--
  src/conf/domain_conf.h                           |  3 +
  src/conf/netdev_bandwidth_conf.h                 |  1 +
  src/libxl/libxl_conf.c                           |  1 +
  src/lxc/lxc_controller.c                         |  1 +
  src/lxc/lxc_process.c                            |  1 +
  src/qemu/qemu_command.c                          | 12 ++++
  src/qemu/qemu_hotplug.c                          |  1 +
  src/qemu/qemu_interface.c                        |  2 +
  src/uml/uml_conf.c                               |  5 ++
  src/xenconfig/xen_sxpr.c                         |  1 +
  tests/qemuxml2argvdata/qemuxml2argv-net-udp.args |  6 ++
  tests/qemuxml2argvdata/qemuxml2argv-net-udp.xml  | 34 +++++++++++
  tests/qemuxml2argvtest.c                         |  1 +
  tests/qemuxml2xmltest.c                          |  1 +
  tools/virsh-domain.c                             |  1 +
  18 files changed, 190 insertions(+), 6 deletions(-)
  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-udp.args
  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-udp.xml


ACK

I have fixed the nits mentioned below and pushed the patch.

Thanks Ján. Sorry it was still a little messy.

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to