Skip to content

Commit

Permalink
Drop usage of virtinterfaced
Browse files Browse the repository at this point in the history
Nothing uses this any more.

`HostVmsList` already didn't expect an `interfaces` property any more,
so drop specifying it.

Fixes cockpit-project#1777
  • Loading branch information
martinpitt committed Aug 26, 2024
1 parent 28e2e32 commit 95d35ce
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 122 deletions.
1 change: 0 additions & 1 deletion packaging/cockpit-machines.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ Requires: libvirt-daemon-driver-qemu
Requires: libvirt-daemon-driver-network
Requires: libvirt-daemon-driver-nodedev
Requires: libvirt-daemon-driver-storage-core
Requires: (libvirt-daemon-driver-interface if virt-install)
Requires: (libvirt-daemon-config-network if virt-install)
Recommends: libvirt-daemon-driver-storage-disk
%if 0%{?rhel}
Expand Down
8 changes: 0 additions & 8 deletions src/actions/store-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {
UNDEFINE_NETWORK,
UNDEFINE_STORAGE_POOL,
UNDEFINE_VM,
UPDATE_ADD_INTERFACE,
UPDATE_ADD_NETWORK,
UPDATE_ADD_NODE_DEVICE,
UPDATE_ADD_STORAGE_POOL,
Expand Down Expand Up @@ -141,13 +140,6 @@ export function updateDomainSnapshots({ connectionName, domainPath, snaps }) {
};
}

export function updateOrAddInterface(props) {
return {
type: UPDATE_ADD_INTERFACE,
payload: { iface: props },
};
}

export function updateOrAddNetwork(props, updateOnly) {
return {
type: UPDATE_ADD_NETWORK,
Expand Down
3 changes: 1 addition & 2 deletions src/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class AppActive extends React.Component {
}

render() {
const { vms, config, storagePools, systemInfo, ui, networks, nodeDevices, interfaces } = store.getState();
const { vms, config, storagePools, systemInfo, ui, networks, nodeDevices } = store.getState();
const { path, cloudInitSupported, downloadOSSupported, unattendedSupported, unattendedUserLogin, virtInstallAvailable } = this.state;
const combinedVms = [...vms, ...dummyVmsFilter(vms, ui.vms)];
const properties = {
Expand Down Expand Up @@ -337,7 +337,6 @@ class AppActive extends React.Component {
ui={ui}
libvirtVersion={systemInfo.libvirtVersion}
storagePools={storagePools}
interfaces={interfaces}
networks={networks}
actions={vmActions}
resourceHasError={this.state.resourceHasError}
Expand Down
1 change: 0 additions & 1 deletion src/constants/store-action-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export const SET_NODE_MAX_MEMORY = "SET_NODE_MAX_MEMORY";
export const UNDEFINE_NETWORK = "UNDEFINE_NETWORK";
export const UNDEFINE_STORAGE_POOL = "UNDEFINE_STORAGE_POOL";
export const UNDEFINE_VM = "UNDEFINE_VM";
export const UPDATE_ADD_INTERFACE = "UPDATE_ADD_INTERFACE";
export const UPDATE_ADD_NETWORK = "UPDATE_ADD_NETWORK";
export const UPDATE_ADD_NODE_DEVICE = "UPDATE_ADD_NODE_DEVICE";
export const UPDATE_ADD_VM = "UPDATE_ADD_VM";
Expand Down
75 changes: 0 additions & 75 deletions src/libvirtApi/interface.js

This file was deleted.

29 changes: 0 additions & 29 deletions src/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {
UNDEFINE_NETWORK,
UNDEFINE_STORAGE_POOL,
UNDEFINE_VM,
UPDATE_ADD_INTERFACE,
UPDATE_ADD_NETWORK,
UPDATE_ADD_NODE_DEVICE,
UPDATE_ADD_VM,
Expand Down Expand Up @@ -93,33 +92,6 @@ function lazyComposedReducer({ parentReducer, getSubreducer, getSubstate, setSub
};
}

function interfaces(state, action) {
state = state || [];

switch (action.type) {
case UPDATE_ADD_INTERFACE: {
const { iface } = action.payload;

if (isObjectEmpty(iface))
return [...state, iface]; // initialize iface to empty object

const connectionName = iface.connectionName;
const index = getFirstIndexOfResource(state, 'name', iface.name, connectionName);
if (index < 0) { // add
const initObjIndex = state.findIndex(obj => isObjectEmpty(obj));
if (initObjIndex >= 0)
state.splice(initObjIndex, 1); // remove empty initial object
return [...state, iface];
}

const updatedIface = Object.assign({}, state[index], iface);
return replaceResource({ state, updatedResource: updatedIface, index });
}
default:
return state;
}
}

function networks(state, action) {
state = state || [];

Expand Down Expand Up @@ -428,7 +400,6 @@ export default combineReducers({
getSubstate: (state) => state.providerState,
setSubstate: (state, subState) => Object.assign({}, state, { providerState: subState }),
}),
interfaces,
networks,
nodeDevices,
vms,
Expand Down
1 change: 0 additions & 1 deletion test/browser/browser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ sh -x test/vm.install

if [ "${PLATFORM_ID:-}" != "platform:el8" ]; then
# https://gitlab.com/libvirt/libvirt/-/issues/219
systemctl start virtinterfaced.socket
systemctl start virtnetworkd.socket
systemctl start virtnodedevd.socket
systemctl start virtstoraged.socket
Expand Down
5 changes: 0 additions & 5 deletions test/vm.install
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ if grep -q 'ID=debian' /usr/lib/os-release; then
echo '* soft core unlimited' >> /etc/security/limits.conf
fi

if grep -q 'ID="opensuse' /usr/lib/os-release; then
# Make sure virtinterfaced.socket is enabled
systemctl enable --now virtinterfaced.socket
fi

systemctl enable cockpit.socket

# don't force https:// (self-signed cert)
Expand Down

0 comments on commit 95d35ce

Please sign in to comment.