Signed-off-by: Loiseleur Michel <mloiseleur at linagora.com> --- app/models/vm.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/app/models/vm.rb b/app/models/vm.rb index 88e0aef..0be3f89 100644 --- a/app/models/vm.rb +++ b/app/models/vm.rb @@ -27,7 +27,7 @@ class Vm < ActiveRecord::Base find(:all, :conditions=>{:state=>Task::STATE_QUEUED}) end end - has_and_belongs_to_many :storage_volumes + has_and_belongs_to_many :storage_volumes, :uniq => true has_many :nics, :dependent => :destroy -- 1.6.2.5
Hi, Just to point you this patch, which is quite important and not ACK at the moment. Thanks, Loiseleur Michel a ?crit :> Signed-off-by: Loiseleur Michel <mloiseleur at linagora.com> > --- > app/models/vm.rb | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/app/models/vm.rb b/app/models/vm.rb > index 88e0aef..0be3f89 100644 > --- a/app/models/vm.rb > +++ b/app/models/vm.rb > @@ -27,7 +27,7 @@ class Vm < ActiveRecord::Base > find(:all, :conditions=>{:state=>Task::STATE_QUEUED}) > end > end > - has_and_belongs_to_many :storage_volumes > + has_and_belongs_to_many :storage_volumes, :uniq => true > > has_many :nics, :dependent => :destroy > >-- Loiseleur Michel Responsable de l'OSSA Linagora / 27, rue de Berri / 75008 PARIS Tel/Fax : 01 58 18 68 28 / 01 58 18 68 29 http://job.linagora.com/ | http://www.tosca-project.net "Ce n'est pas le logiciel qui est libre, c'est vous"
Pierre-Gilles Mialon
2009-Dec-01 16:47 UTC
[Ovirt-devel] Re: [PATCH] fix storages crazyness
Hi, Could you please have a look at this patch ? We really need it, and I think that almost user need it too. It ensure that a disk is assigned only once to one vm (wich means never two times or more the same disk for a single vm). This became usefull when the number of message in qpidd increase. Thanks, Le lundi 16 novembre 2009 15:39:37 Michel Loiseleur, vous avez ?crit :> Hi, > > Just to point you this patch, which is quite important and not ACK at > the moment. > > Thanks, > > Loiseleur Michel a ?crit : > > Signed-off-by: Loiseleur Michel <mloiseleur at linagora.com> > > --- > > app/models/vm.rb | 2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/app/models/vm.rb b/app/models/vm.rb > > index 88e0aef..0be3f89 100644 > > --- a/app/models/vm.rb > > +++ b/app/models/vm.rb > > @@ -27,7 +27,7 @@ class Vm < ActiveRecord::Base > > find(:all, :conditions=>{:state=>Task::STATE_QUEUED}) > > end > > end > > - has_and_belongs_to_many :storage_volumes > > + has_and_belongs_to_many :storage_volumes, :uniq => true > > > > has_many :nics, :dependent => :destroy >-- Pierre-Gilles Mialon Responsable h?bergement :: Head of Hosting services pmialon at linagora.com :: +33.1 58 18 65 46 Linagora :: http://www.linagora.com 27 rue de Berri :: 75008 PARIS -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20091201/4810b4e9/attachment.sig>
Loiseleur Michel wrote:> Signed-off-by: Loiseleur Michel <mloiseleur at linagora.com> > --- > app/models/vm.rb | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/app/models/vm.rb b/app/models/vm.rb > index 88e0aef..0be3f89 100644 > --- a/app/models/vm.rb > +++ b/app/models/vm.rb > @@ -27,7 +27,7 @@ class Vm < ActiveRecord::Base > find(:all, :conditions=>{:state=>Task::STATE_QUEUED}) > end > end > - has_and_belongs_to_many :storage_volumes > + has_and_belongs_to_many :storage_volumes, :uniq => true > > has_many :nics, :dependent => :destroy > >ACK, This works for removing duplicate entries when returning the list of storage volumes. This won't prevent duplicate records from being created in the first place, though. So this can be pushed as-is, but we should probably resolve the duplication at the source as well -- why are we getting duplicate entries? In addition, we could put a unique constraint at the database level if necessary. Scott
Reasonably Related Threads
- [PATCH] Increase timeout for live migration
- [PATCH] fix storage problem.
- [PATCH] Enhance vms display
- [PATCH server] Replace the occurence of the type @qmfc.object(Qmf::Query.new(:class => "xxx", 'key' => search_key)) for @qmfc.object(Qmf::Query.new(:class => "xxx"), 'key' => search_key) else the search on the key is not functionnal.
- [PATCH] Fix optimistic locking during vm migration