[libvirt] [PATCH] Do not allow changing the UUID of a nwfilter
Eric Blake
eblake at redhat.com
Mon Jul 7 22:08:44 UTC 2014
On 07/07/2014 07:57 AM, Ján Tomko wrote:
> From: Hu Jianwei <jiahu at redhat.com>
>
> https://bugzilla.redhat.com/show_bug.cgi?id=1077009
> ---
> src/conf/nwfilter_conf.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
ACK.
>
> diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c
> index 0f633da..52f24e4 100644
> --- a/src/conf/nwfilter_conf.c
> +++ b/src/conf/nwfilter_conf.c
> @@ -3058,6 +3058,17 @@ virNWFilterObjAssignDef(virNWFilterObjListPtr nwfilters,
> return NULL;
> }
> virNWFilterObjUnlock(nwfilter);
> + } else {
> + nwfilter = virNWFilterObjFindByName(nwfilters, def->name);
> + if (nwfilter) {
> + char uuidstr[VIR_UUID_STRING_BUFLEN];
> + virUUIDFormat(nwfilter->def->uuid, uuidstr);
> + virReportError(VIR_ERR_OPERATION_FAILED,
> + _("filter '%s' already exists with uuid %s"),
> + def->name, uuidstr);
> + virNWFilterObjUnlock(nwfilter);
> + return NULL;
> + }
> }
>
> if (virNWFilterDefLoopDetect(nwfilters, def) < 0) {
>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140707/708a9175/attachment-0001.sig>
More information about the libvir-list
mailing list