[libvirt] [PATCH 3/5] qemuAgentGetInterfaces: Don't error out on missing HW address

Michal Privoznik mprivozn at redhat.com
Tue Mar 17 17:09:17 UTC 2015


On 17.03.2015 18:00, Michal Privoznik wrote:
> On 17.03.2015 17:58, Daniel P. Berrange wrote:
>> On Tue, Mar 17, 2015 at 05:52:55PM +0100, Michal Privoznik wrote:
>>> Now that we allow HW address to be not present on our RPC layer,
>>> don't error out if qemu-ga hasn't provided any.
>>>
>>> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>>> ---
>>>  src/qemu/qemu_agent.c | 7 -------
>>>  1 file changed, 7 deletions(-)
>>>
>>> diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
>>> index 5f90b15..a7b3279 100644
>>> --- a/src/qemu/qemu_agent.c
>>> +++ b/src/qemu/qemu_agent.c
>>> @@ -2054,13 +2054,6 @@ qemuAgentGetInterfaces(qemuAgentPtr mon,
>>>                  goto error;
>>>  
>>>              hwaddr = virJSONValueObjectGetString(tmp_iface, "hardware-address");
>>> -            if (!hwaddr) {
>>> -                virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
>>> -                               _("qemu agent didn't provide"
>>> -                                 " 'hardware-address' field"));
>>> -                goto error;
>>> -            }
>>
>> Why would QEMU guest agent not provide the MAC address ? That sounds
>> like it would be a bug if that ever happened surely.
> 
> Not every network interface has a HW address, e.g. PTP devices don't
> have one. Therefore, qemu-ga doesn't return any if that's the case.

This is from qga/qapi-schema.json:
##
# @GuestNetworkInterface:
#
# @name: The name of interface for which info are being delivered
#
# @hardware-address: Hardware address of @name
#
# @ip-addresses: List of addresses assigned to @name
#
# Since: 1.1
##
{ 'type': 'GuestNetworkInterface',
  'data': {'name': 'str',
           '*hardware-address': 'str',
           '*ip-addresses': ['GuestIpAddress'] } }

So the hardware address field is optional.

Michal




More information about the libvir-list mailing list