[root@localhost ~]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.154.8 netmask 255.255.0.0 broadcast 192.168.255.255
inet6 fe80::5054:ff:fefe:4c4f prefixlen 64 scopeid 0x20<link>
inet6 2001:db8:0:f101::2 prefixlen 64 scopeid 0x0<global>
inet6 2001:db8:0:f101::1 prefixlen 64 scopeid 0x0<global>
ether 52:54:00:fe:4c:4f txqueuelen 1000 (Ethernet)
RX packets 1535 bytes 123240 (120.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1133 bytes 160636 (156.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0:0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 102.168.168.168 netmask 255.255.0.0 broadcast 192.168.255.255
ether 52:54:00:fe:4c:4f txqueuelen 1000 (Ethernet)
eth0:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.101.197 netmask 255.255.255.0 broadcast 192.168.101.255
ether 52:54:00:fe:4c:4f txqueuelen 1000 (Ethernet)
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 16436
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 8 bytes 616 (616.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8 bytes 616 (616.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@localhost ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 52:54:00:fe:4c:4f brd ff:ff:ff:ff:ff:ff
inet6 2001:db8:0:f101::2/64 scope global
valid_lft forever preferred_lft forever
inet6 2001:db8:0:f101::1/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::5054:ff:fefe:4c4f/64 scope link
valid_lft forever preferred_lft forever
[root@localhost ~]#
Now, qemu-guest-agent returns back (after making it pretty):
{
"return": [
{
"name": "lo",
"ip-addresses": [
{
"ip-address-type": "ipv4",
"ip-address": "127.0.0.1",
"prefix": 8
},
{
"ip-address-type": "ipv6",
"ip-address": "::1",
"prefix": 128
}
],
"hardware-address": "00:00:00:00:00:00"
},
{
"name": "eth0",
"ip-addresses": [
{
"ip-address-type": "ipv4",
"ip-address": "192.168.154.8",
"prefix": 16
},
{
"ip-address-type": "ipv6",
"ip-address": "2001:db8:0:f101::2",
"prefix": 64
},
{
"ip-address-type": "ipv6",
"ip-address": "2001:db8:0:f101::1",
"prefix": 64
},
{
"ip-address-type": "ipv6",
"ip-address": "fe80::5054:ff:fefe:4c4f",
"prefix": 64
}
],
"hardware-address": "52:54:00:fe:4c:4f"
},
{
"name": "eth0:1",
"ip-addresses": [
{
"ip-address-type": "ipv4",
"ip-address": "192.168.101.197",
"prefix": 24
}
],
"hardware-address": "52:54:00:fe:4c:4f"
},
{
"name": "eth0:0",
"ip-addresses": [
{
"ip-address-type": "ipv4",
"ip-address": "102.168.168.168",
"prefix": 16
}
],
"hardware-address": "52:54:00:fe:4c:4f"
}
]
}
So, qemu-ga doesn't understand that there can't be more than one
device with same MAC addr. So, I think we are left with the following
MAC address grouped under one interface only.
(ii) Let the reply be as it is now. Strip the ":0", ":1" from the response
of guest agent (Is this really necessary?) . We'll have to parse the JSON
according to the MAC addresses.