[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-4.15] x86/dmop: Properly fail for PV guests


  • To: Ian Jackson <iwj@xxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Thu, 25 Feb 2021 17:39:01 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Rzm2ZUwCo5v9VUZDH4J5k9fXJhtts7Pxz9WMJAjKWuw=; b=mgUmtF62APfw/qzUsIJs6ixaVsi3dttgMb8aqvYnArfLOvCHmaex5mzibTGO+8v4eF1W6KEe44+Wg2QKMrsNcqnNPJtoaOHrBDUsaWVftGIY8B3LLc+2mlMT1cdbF2uRTjwiEc2xgsvc2a/PpWv3xN5UFrrGuMjVoaj7zH10aQjHMba4FjGv/y/L2WpU41WVKoZfEcvldN/f7wjOuqIEJohfHdN8ko8qPK7kYTbmAAAffPJCCtnu7kavPpqtNMeSesWNKwwJAllWNx0ES9joJIX+7idiNxQbk3ShcFEJ8B1NkJMoVVEuNs/GLkJFNOt0hfcXV1ZZmBzhoRlCkxXYDw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CupvdXhC/dUBbsRN6mZ4v63KH875YGIWBoSEg37CNxtFCOX0A06Bp9qDDe83emrdvnhSmDcVytQ/TlO9xUY6+voXFjNF3Z0fgUieATcF4O5kJ8rlWIwc9OqBVm9kEgdbW+/yW67VYWrbSw90WlZHJf2aNYz78sMCG9kOzn1Plxx8VMS2i1lFMvB8YRLAJDboHJSNE4MU6+ip7TGnnjEQODmdYOK0AP7PWE6U4r5ijkYdyNHlV29PnqfE6QT6YzyHn5WwA5oTaBC0DnrcJ1SkHDk/hZBYhubjyPOiORKugQ4nL1ps104GkW7tEIGdCPJVNbmfsvx70eTOf88oDtYWVA==
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Paul Durrant <paul@xxxxxxx>
  • Delivery-date: Thu, 25 Feb 2021 17:39:18 +0000
  • Ironport-sdr: bMtk4e9rOrZT0xBDxAVYQ5yzeccnbxIcFTU90AV684VSp5F0tTsn/jYF60YvA/+7PDZlND68KR DY5iEZV1ZtMxBuxUe0ruGa+N3qOIZmH5Xs66l0B76dVpJxJdrw+qPclWmcp/qeOZDv+ojOhB4Z lf8gPD+72+cTJXWQ2aNpjjaLHuG4nR+OuKAMljJmTw/CtXOUSsXBUcX+KPBzjDwIsOmrtyEIZT zWXNS6PjuHVwI58Ei2KDh120WpEeHwft8ZtXO8mt/5u7c7toeG0Pz+XrMKyXx03RVhFMw1eAtU Lz8=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 25/02/2021 17:22, Ian Jackson wrote:
> Andrew Cooper writes ("[PATCH for-4.15] x86/dmop: Properly fail for PV 
> guests"):
>> The current code has an early exit for PV guests, but it returns 0 having 
>> done
>> nothing.
> Reviewed-by: Ian Jackson <iwj@xxxxxxxxxxxxxx>

Thanks.

>
>> diff --git a/xen/arch/x86/hvm/dm.c b/xen/arch/x86/hvm/dm.c
>> index 5bc172a5d4..612749442e 100644
>> --- a/xen/arch/x86/hvm/dm.c
>> +++ b/xen/arch/x86/hvm/dm.c
>> @@ -365,6 +365,7 @@ int dm_op(const struct dmop_args *op_args)
>>      if ( rc )
>>          return rc;
>>  
>> +    rc = -EINVAL;
>>      if ( !is_hvm_domain(d) )
>>          goto out;
> Is this style, of setting rc outside the if, the standard hypervisor
> style ?

If you think the cyclomatic complexity is bad in libxl...

This is the prevailing style in this function.  Its common, but not
universal style.

~Andrew



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.