[Bug 200746] [PATCH] Add libxo support to jls

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Jun 9 21:27:38 UTC 2015


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=200746

            Bug ID: 200746
           Summary: [PATCH] Add libxo support to jls
           Product: Base System
           Version: 11.0-CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Keywords: patch
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: elbarto at bocal.org
          Keywords: patch

Created attachment 157588
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=157588&action=edit
jls libxo support

Hello,

This patch add libxo support to jls.
It also correct an error in -q switch (the value was always quoted).

For boolean values, text is the same, for json and xml it is set to true/false.
For multiple value (ip for example), for json it's on a array.

Here is some sample outputs :

$ jls -qnh --libxo json | python2.7 -m json.tool


{
    "jails": [
        {
            "allow.chflags": false,
            "allow.mount": false,
            "allow.mount.devfs": true,
            "allow.mount.fdescfs": false,
            "allow.mount.nullfs": false,
            "allow.mount.procfs": false,
            "allow.mount.tmpfs": false,
            "allow.mount.zfs": false,
            "allow.quotas": false,
            "allow.raw_sockets": false,
            "allow.set_hostname": true,
            "allow.socket_af": false,
            "allow.sysvipc": false,
            "children.cur": "0",
            "children.max": "0",
            "cpuset.id": "2",
            "devfs_ruleset": "4",
            "dying": false,
            "enforce_statfs": "2",
            "host": "new",
            "host.domainname": "\"\"",
            "host.hostid": "0",
            "host.hostname": "jail1",
            "host.hostuuid": "6568ce83-0d95-11e5-a67f-44a8420e7030",
            "ip4": "disable",
            "ip4.addr": "10.0.0.2",
            "ip4.saddrsel": true,
            "ip6": "disable",
            "ip6.saddrsel": true,
            "jid": "5",
            "name": "ioc-6568ce83-0d95-11e5-a67f-44a8420e7030",
            "osreldate": "1100076",
            "osrelease": "11.0-CURRENT",
            "parent": "0",
            "path": "/iocage/jails/6568ce83-0d95-11e5-a67f-44a8420e7030/root",
            "persist": true,
            "securelevel": "2"
        }
    ]
}

$ jls -qnh --libxo xml                                                          
<jails><devfs_ruleset>4</devfs_ruleset><dying>false</dying><enforce_statfs>2</enforce_statfs><host>new</host><ip4>disable</ip4><ip6>disable</ip6><jid>5</jid><name>ioc-6568ce83-0d95-11e5-a67f-44a8420e7030</name><osreldate>1100076</osreldate><osrelease>11.0-CURRENT</osrelease><parent>0</parent><path>/iocage/jails/6568ce83-0d95-11e5-a67f-44a8420e7030/root</path><persist>true</persist><securelevel>2</securelevel><allow.chflags>false</allow.chflags><allow.mount>false</allow.mount><allow.mount.devfs>true</allow.mount.devfs><allow.mount.fdescfs>false</allow.mount.fdescfs><allow.mount.nullfs>false</allow.mount.nullfs><allow.mount.procfs>false</allow.mount.procfs><allow.mount.tmpfs>false</allow.mount.tmpfs><allow.mount.zfs>false</allow.mount.zfs><allow.quotas>false</allow.quotas><allow.raw_sockets>false</allow.raw_sockets><allow.set_hostname>true</allow.set_hostname><allow.socket_af>false</allow.socket_af><allow.sysvipc>false</allow.sysvipc><children.cur>0</children.cur><children.max>0</child
 ren.max><cpuset.id>2</cpuset.id><host.domainname>""</host.domainname><host.hostid>0</host.hostid><host.hostname>jail1</host.hostname><host.hostuuid>6568ce83-0d95-11e5-a67f-44a8420e7030</host.hostuuid><ip4.addr>10.0.0.2/ip4.addr><ip4.saddrsel>true</ip4.saddrsel><ip6.saddrsel>true</ip6.saddrsel></jails>

The diff is attached and also on the libxo_support branch of my fork on github
(https://github.com/evadot/freebsd/tree/libxo_support)

Cheers.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list