Michael Pasternak has posted comments on this change.

Change subject: rest: Add Port Mirroring to VM interface
......................................................................


Patch Set 26: (3 inline comments)

....................................................
File 
backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata_v-3.1.yaml
Line 325:         optionalArguments: {nic.network.id|name: 'xs:string', 
nic.name: 'xs:string', nic.mac.address: 'xs:string', nic.interface: 
'xs:string', nic.port_mirroring--COLLECTION: {port_mirroring.network.id: 
'xs:string'}}
should be 

nic.port_mirroring.networks.network--COLLECTION: {network.id: 'xs:string'}}

Line 348:         optionalArguments: {nic.mac.address: 'xs:string', 
nic.interface: 'xs:string', nic.port_mirroring--COLLECTION: 
{port_mirroring.network.id: 'xs:string'}}
same as above

....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmNicsResource.java
Line 93:     protected NIC populate(NIC model, VmNetworkInterface entity) {
this is not efficient, on listing networks you will preform extra query 
getAllNetworks
for each network,

in previous patch-set i intentionally gave you file and line number, so you 
reuse
code that doing getAllNetworks only once to list all networks, please see 
BackendNicsResource.java:53

please remove this populate override, and add your P.M code at [1], of
BackendNicsResource.java:56

    @Override
    public Nics list() {
        Nics nics = new Nics();
        List<VmNetworkInterface> entities = getBackendCollection(queryType, 
queryParams);
        Guid clusterId = getClusterId();
        List<network> networks = getBackendCollection(network.class,
             VdcQueryType.GetAllNetworksByClusterId,
             new VdsGroupQueryParamenters(clusterId));
        for (VmNetworkInterface entity : entities) {
            network network = lookupClusterNetwork(clusterId, null, 
entity.getNetworkName(), networks);
            NIC nic = populate(map(entity), entity);
            if (network!=null && network.getId()!=null) {

==>> [1] inject P.M herer

                nic.getNetwork().setId(network.getId().toString());
                nic.getNetwork().setName(null);
            }
            if (validate(nic)) {
                nics.getNics().add(addLinks(nic));
            }
        }
        return nics;
    }


thanks

--
To view, visit http://gerrit.ovirt.org/3727
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic03d841d6d0f6cb7250a25e43bdda3d3e9b7488b
Gerrit-PatchSet: 26
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi <shav...@redhat.com>
Gerrit-Reviewer: Livnat Peer <lp...@redhat.com>
Gerrit-Reviewer: Michael Pasternak <mpast...@redhat.com>
Gerrit-Reviewer: Ori Liel <ol...@redhat.com>
Gerrit-Reviewer: Shahar Havivi <shav...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to