def create_8021Q_vea_cmd(lpar_id, slotnum, port_vlan_id, addl_vlan_ids):
    """
    Generate IVM command to create 8021Q virtual ethernet adapter.

    :param lpar_id: LPAR id
    :param slotnum: virtual adapter slot number
    :param port_vlan_id: untagged port vlan id
    :param addl_vlan_ids: tagged VLAN id list
    :returns: A HMC command that can create 8021Q veth based on the
              specification from input.
    """
    vids = [] if not addl_vlan_ids else addl_vlan_ids
    cmd = ('chhwres -r virtualio --rsubtype eth -o a -s %(slot)s '
           '--id %(lparid)s -a ieee_virtual_eth=1,'
           'port_vlan_id=%(pvid)s,is_trunk=1,'
           'trunk_priority=1,\\\"addl_vlan_ids=%(addlvids)s\\\"' %
           {'slot': slotnum,
            'lparid': lpar_id,
            'pvid': port_vlan_id,
            'addlvids': ",".join(str(x) for x in vids)})

    return cmd