summary refs log tree commit diff stats
path: root/gitlab/issues_text/target_missing/host_missing/accel_missing/935
blob: 899aaf0b64e8d738a982a35d92b2f3fbf6dc14d5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
insert ivshmem device into pci-bridge, but vm network disconnects
Description of problem:
To extend PCI slot number in Windows vm, a new pci-bridge is created in Windows vm as bus.1. But when I insert a ivshmem file in host to this pci-bridge(bus.1), the Windows vm disconnects(lose remote desktop connection).
Steps to reproduce:
1. add new pci-bridge into windows vm, add windows vm xml configuration like this:
```xml
<devices>
  <controller type='pci' index='0' model='pci-root'/>
  <controller type='pci' index='1' model='pci-bridge'>
    <address type='pci' domain='0' bus='0' slot='0x0d' function='0' multifunction='off'/>
  </controller>
</devices>
```

2.restart this Windows vm, new pci-bridge has been created, its name is pci.1 and bus is bus.1:
```sh
$ virsh qemu-monitor-command --hmp --domain 56 --cmd info pci
  Bus  0, device  13, function 0:
    PCI bridge: PCI device 1b36:0001
      IRQ 10.
      BUS 0.
      secondary bus 1.
      subordinate bus 1.
      IO range [0xc000, 0xcfff]
      memory range [0xfe000000, 0xfe1fffff]
      prefetchable memory range [0xe4000000, 0xe41fffff]
      BAR0: 64 bit memory at 0xfe422000 [0xfe4220ff].
      id "pci.1"
```
3. create a shm file `/dev/shm/test1` in host using `shm_open()`, size is 32M

4. create new object: 
```sh
virsh qemu-monitor-command --hmp --domain 56 --cmd object_add memory-backend-file,share=on,id=objtest1,size=32M,mem-path=/dev/shm/test1
```

5. insert this ivshmem file into new pci-bridge and use bus.1 slot number(1:1.0):
```sh
virsh qemu-monitor-command --hmp --domain 56 --cmd device_add ivshmem-plain,memdev=objtest1,id=test1,bus=pci.1,addr=0x01.0x00
```

6. After inserting this ivshmem file into new pci-bridge, the remote desktop connection of this windows vm disconnects.

7. New ivshmem file has been created:
```
$ virsh qemu-monitor-command --hmp --domain 57 --cmd info pci
  Bus  1, device   1, function 0:
    RAM controller: PCI device 1af4:1110
      BAR0: 32 bit memory at 0xfe1fff00 [0xfe1fffff].
      BAR2: 64 bit prefetchable memory at 0x4bc000000 [0x4bfffffff].
      id "test1"

```
Additional information:
When insert ivshmem file into bus.1(pci-bridge), the remote desktop connection of Windows vm is sometimes disconnected, and sometimes it is normal.

The newly added ivshmem device can be found in the device manager of the Windows vm, but sometimes it cannot be found.

Thanks for your help!