8000
Skip to content

incusd/device/nic: Fix connected logic for non-NIC QEMU devices#2855

Merged
stgraber merged 4 commits intolxc:mainfrom
bensmrs:nic-attached-connected
Jan 23, 2026
Merged

incusd/device/nic: Fix connected logic for non-NIC QEMU devices#2855
stgraber merged 4 commits intolxc:mainfrom
bensmrs:nic-attached-connected

Conversation

@bensmrs
Copy link
Copy Markdown
Contributor
@bensmrs bensmrs commented Jan 23, 2026

No description provided.

@bensmrs bensmrs requested a review from stgraber as a code owner January 23, 2026 20:53
@github-actions github-actions bot added the Documentation Documentation needs updating label Jan 23, 2026
@bensmrs bensmrs force-pushed the nic-attached-connected branch from 0422ca1 to c829eba Compare January 23, 2026 20:56
Signed-off-by: Benjamin Somers <benjamin.somers@imt-atlantique.fr>
Signed-off-by: Benjamin Somers <benjamin.somers@imt-atlantique.fr>
@stgraber stgraber enabled auto-merge January 23, 2026 21:13
@bensmrs
Copy link
Copy Markdown
Contributor Author
bensmrs commented Jan 23, 2026

No, wait a sec

@bensmrs
Copy link
Copy Markdown
Contributor Author
bensmrs commented Jan 23, 2026

I’m worried I also need to patch AddNIC

@bensmrs bensmrs requested a review from stgraber January 23, 2026 21:20
auto-merge was automatically disabled January 23, 2026 21:27

Head branch was pushed to by a user without write access

Signed-off-by: Benjamin Somers <benjamin.somers@imt-atlantique.fr>
@stgraber
8000 Copy link
Copy Markdown
Member

Still not helping sadly

@stgraber
Copy link
Copy Markdown
Member
stgraber@dakara:~/Code/lxc/incus (git:lxc/main)$ incus start v-sriov
Error: Failed setting up device via monitor: Failed setting up device "eth0": Failed setting NIC device link status: DeviceNotFound: Device 'dev-incus_eth0' not found
Try `incus info --show-log v-sriov` for more info
devices:
  eth0:
    nictype: sriov
    productid: 10fb
    type: nic
    vendorid: "8086"
root@dakara:~# cat /var/log/incus/v-sriov/qemu.qmp.log 
[2026-01-23T16:49:15-05:00] QUERY: {"execute":"qom-get","arguments":{"path":"/machine","property":"type"},"id":2}
[2026-01-23T16:49:15-05:00] REPLY: {"return": "pc-q35-10.2-machine", "id": 2}

[2026-01-23T16:49:15-05:00] QUERY: {"execute":"device_add","arguments":{"addr":"00.0","bootindex":1,"bus":"qemu_pcie4","driver":"vfio-pci","host":"0000:01:10.0","id":"dev-incus_eth0"},"id":4}
[2026-01-23T16:49:16-05:00] REPLY: {"return": {}, "id": 4}

[2026-01-23T16:49:16-05:00] QUERY: {"execute":"set_link","arguments":{"name":"dev-incus_eth0","up":false},"id":5}

@bensmrs
Copy link
Copy Markdown
Contributor Author
bensmrs commented Jan 23, 2026

Ok, found it

@bensmrs
Copy link
Copy Markdown
Contributor Author
bensmrs commented Jan 23, 2026

The logic worked with the assumption that all VM NICs defined the connected boolean, now it mirrors how I implemented it on the LXC side.

Signed-off-by: Benjamin Somers <benjamin.somers@imt-atlantique.fr>
@stgraber
Copy link
Copy Markdown
Member
stgraber@dakara:~/Code/lxc/incus (git:lxc/main)$ incus create images:debian/13 v-sriov --vm
Creating v-sriov
stgraber@dakara:~/Code/lxc/incus (git:lxc/main)$ incus config device add v-sriov eth0 nic nictype=sriov vendorid=8086 productid=10fb
Device eth0 added to v-sriov
stgraber@dakara:~/Code/lxc/incus (git:lxc/main)$ incus start v-sriov
stgraber@dakara:~/Code/lxc/incus (git:lxc/main)$ incus wait v-sriov agent
stgraber@dakara:~/Code/lxc/incus (git:lxc/main)$ incus exec v-sriov -- networkctl status enp5s0
● 2: enp5s0
                   Link File: /usr/lib/systemd/network/99-default.link
                Network File: /etc/systemd/network/enp5s0.network
                       State: routable (configured)
                Online state: online                                         
                        Type: ether
                        Path: pci-0000:05:00.0
                      Driver: ixgbevf
                      Vendor: Intel Corporation
                       Model: 82599 Ethernet Controller Virtual Function
           Alternative Names: enx10666a2ed1cd
            Hardware Address: 10:66:6a:2e:d1:cd (Zabbly)
                         MTU: 1500 (min: 68, max: 9710)
                       QDisc: mq
IPv6 Address Generation Mode: eui64
    Number of Queues (Tx/Rx): 8/8
            Auto negotiation: no
                       Speed: 10Gbps
                      Duplex: full
                     Address: 172.17.0.207 (DHCPv4 via 172.17.0.4)
                              2602:fc62:c:1000:1266:6aff:fe2e:d1cd
                              fe80::1266:6aff:fe2e:d1cd
                     Gateway: 172.17.0.1
                              fe80::200:5eff:fe00:205
                         DNS: 172.17.20.10
                              2602:fc62:b:10::1
              Search Domains: stgraber.net
           Activation Policy: up
         Required For Online: yes
            DHCPv4 Client ID: 10:66:6a:2e:d1:cd
          DHCPv6 Client DUID: DUID-EN/Vendor:0000ab118da2b7d84f146956

Jan 23 22:05:15 distrobuilder-abe2ce37-b683-4c1f-865b-235bd2199ffb systemd-networkd[323]: enp5s0: Configuring with /etc/systemd/network/enp5s0.network.
Jan 23 22:05:15 distrobuilder-abe2ce37-b683-4c1f-865b-235bd2199ffb systemd-networkd[323]: enp5s0: Link UP
Jan 23 22:05:15 distrobuilder-abe2ce37-b683-4c1f-865b-235bd2199ffb systemd-networkd[323]: enp5s0: Gained carrier
Jan 23 22:05:15 distrobuilder-abe2ce37-b683-4c1f-865b-235bd2199ffb systemd-networkd[323]: enp5s0: DHCPv4 address 172.17.0.207/24, gateway 172.17.0.1 acquired from 172.17.0.4
Jan 23 22:05:17 v-sriov systemd-networkd[323]: enp5s0: Gained IPv6LL
stgraber@dakara:~/Code/lxc/incus (git:lxc/main)$ 

@bensmrs
Copy link
Copy Markdown
Contributor Author
bensmrs commented Jan 23, 2026

Ok good. Hope I didn’t ruin your release demo video.

8000

@stgraber
Copy link
Copy Markdown
Member

@bensmrs haha, no, I caught it while writing the announcement.
The announcement was updated to use a container. The video will likely show both though.

@bensmrs
Copy link
Copy Markdown
Contributor Author
bensmrs commented Jan 23, 2026

Ok. I’ll try to familiarize myself with lxc-ci next month because the absence of PR tests for VMs made me a bit overconfident on the initial PR :)

@stgraber
Copy link
Copy Markdown
Member

@bensmrs we have an SRIOV test in the testsuite but Jenkins has been a bit backed up and we obviously didn't get a run between your PR landing and the release.

@bensmrs
Copy link
Copy Markdown
Contributor Author
bensmrs commented Jan 23, 2026

Yeah, that last squeeze before the release surely didn’t help

@stgraber stgraber merged commit 432359f into lxc:main Jan 23, 2026
158 of 160 checks passed
@bensmrs bensmrs deleted the nic-attached-connected branch February 3, 2026 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Documentation needs updating

Development

Successfully merging this pull request may close these issues.

2 participants

0