Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Aug 2023 07:18:45 GMT
From:      Corvin =?utf-8?Q?K=C3=B6hne?= <corvink@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 51e32fe73405 - stable/13 - bhyve: add bus, slot and func to device name
Message-ID:  <202308180718.37I7Ijfw017600@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by corvink:

URL: https://cgit.FreeBSD.org/src/commit/?id=51e32fe73405a20caed05cd24310d4e6bb718507

commit 51e32fe73405a20caed05cd24310d4e6bb718507
Author:     Vitaliy Gusev <gusev.vitaliy@gmail.com>
AuthorDate: 2023-05-15 14:28:45 +0000
Commit:     Corvin Köhne <corvink@FreeBSD.org>
CommitDate: 2023-08-18 07:04:26 +0000

    bhyve: add bus, slot and func to device name
    
    Each device needs a unique identifier to store and restore snapshots
    properly. Adding the pci bsf information to the device name creates a
    unique identifier as a bsf can't be occupied twice.
    
    Reviewed by:            corvink
    MFC after:              1 week
    Sponsored by:           vStack
    Differential Revision:  https://reviews.freebsd.org/D40107
    
    (cherry picked from commit 14c80457b0f6a5eb6ff9a1db573462410c64a454)
---
 usr.sbin/bhyve/pci_emul.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/usr.sbin/bhyve/pci_emul.c b/usr.sbin/bhyve/pci_emul.c
index 47ddf3f1809c..f52bf94b7c3d 100644
--- a/usr.sbin/bhyve/pci_emul.c
+++ b/usr.sbin/bhyve/pci_emul.c
@@ -1023,7 +1023,8 @@ pci_emul_init(struct vmctx *ctx, struct pci_devemu *pde, int bus, int slot,
 	pdi->pi_lintr.pirq_pin = 0;
 	pdi->pi_lintr.ioapic_irq = 0;
 	pdi->pi_d = pde;
-	snprintf(pdi->pi_name, PI_NAMESZ, "%s-pci-%d", pde->pe_emu, slot);
+	snprintf(pdi->pi_name, PI_NAMESZ, "%s@pci.%d.%d.%d", pde->pe_emu, bus,
+	    slot, func);
 
 	/* Disable legacy interrupts */
 	pci_set_cfgdata8(pdi, PCIR_INTLINE, 255);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202308180718.37I7Ijfw017600>