[libvirt] [PATCH 45/66] vbox: Rewrite vboxDomainAttachDeviceFlags

Michal Privoznik mprivozn at redhat.com
Tue Aug 12 15:31:19 UTC 2014


On 11.08.2014 12:06, Taowei wrote:
> ---
>   src/vbox/vbox_common.c        |   14 ++++++++++++++
>   src/vbox/vbox_tmpl.c          |   15 ---------------
>   src/vbox/vbox_uniformed_api.h |    2 ++
>   3 files changed, 16 insertions(+), 15 deletions(-)
>
> diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
> index 84d82d7..f22cb5b 100644
> --- a/src/vbox/vbox_common.c
> +++ b/src/vbox/vbox_common.c
> @@ -4155,3 +4155,17 @@ int vboxDomainAttachDevice(virDomainPtr dom, const char *xml)
>   {
>       return vboxDomainAttachDeviceImpl(dom, xml, 0);
>   }
> +
> +int vboxDomainAttachDeviceFlags(virDomainPtr dom, const char *xml,
> +                                unsigned int flags)
> +{
> +    virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1);
> +
> +    if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
> +        virReportError(VIR_ERR_OPERATION_INVALID, "%s",
> +                       _("cannot modify the persistent configuration of a domain"));
> +        return -1;
> +    }

I know you're just copying pre-existing code, but this doesn't make much 
sense to me. I'd just drop VIR_DOMAIN_AFFECT_CONFIG flag from the 
virCheckFlags().

Michal




More information about the libvir-list mailing list