Skip to content

Commit f66dd32

Browse files
Marcello Serirobhoes
authored andcommitted
[CP-18781] Add device information in VIF.state (#288)
Signed-off-by: Marcello Seri <[email protected]>
1 parent 467271d commit f66dd32

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

lib/xenops_utils.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,7 @@ let unplugged_vif = {
568568
plugged = false;
569569
kthread_pid = 0;
570570
media_present = false;
571+
device = None;
571572
}
572573

573574
let unplugged_vgpu = {

xc/xenops_server_xen.ml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2590,11 +2590,14 @@ module VIF = struct
25902590
from xenstore. The corrolary is that: only when the device
25912591
is finally deleted from xenstore, can we remove bridges or
25922592
switch configuration. *)
2593+
let domid = d.Device_common.frontend.Device_common.domid in
2594+
let device = "vif" ^ (string_of_int domid) ^ "." ^ (string_of_int vif.position) in
25932595
{
25942596
Vif.active = true;
25952597
plugged = true;
25962598
media_present = true;
2597-
kthread_pid = kthread_pid
2599+
kthread_pid = kthread_pid;
2600+
device = Some device
25982601
}
25992602
with
26002603
| (Does_not_exist(_,_))

xl/xenops_server_xenlight.ml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1651,11 +1651,14 @@ module VIF = struct
16511651
from xenstore. The corrolary is that: only when the device
16521652
is finally deleted from xenstore, can we remove bridges or
16531653
switch configuration. *)
1654+
let domid = d.Device_common.frontend.Device_common.domid in
1655+
let device = "vif" ^ (string_of_int domid) ^ "." ^ (string_of_int vif.position) in
16541656
{
16551657
Vif.active = true;
16561658
plugged = true;
16571659
media_present = true;
1658-
kthread_pid = kthread_pid
1660+
kthread_pid = kthread_pid;
1661+
device = Some device
16591662
}
16601663
with
16611664
| (Does_not_exist(_,_))

0 commit comments

Comments
 (0)