public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Lucas Meneghel Rodrigues <lmr@redhat.com>
To: Michael Goldish <mgoldish@redhat.com>
Cc: autotest@test.kernel.org, Avi Kivity <avi@redhat.com>,
	kvm@vger.kernel.org
Subject: Re: [Autotest] [KVM-AUTOTEST PATCH] KVM test: kvm_vm.py: don't require pci_assignable to be defined
Date: Mon, 07 Jun 2010 10:38:00 -0300	[thread overview]
Message-ID: <1275917880.2589.6.camel@freedom> (raw)
In-Reply-To: <1275917069.2589.5.camel@freedom>

On Mon, 2010-06-07 at 10:24 -0300, Lucas Meneghel Rodrigues wrote:
> On Sun, 2010-06-06 at 09:41 +0300, Michael Goldish wrote:
> > Currently to disable PCI device assignment pci_assignable must be explicitly
> > set to "no".  This patch allows it to remain undefined (and adds a warning
> > message and a comment).
> 
> I have noticed this on Friday, while I was testing the patches for RHEL6
> style unit tests. Thanks for your fix! :)
> 
> By the way, I have the original flat files sent by Naphtali on his
> initial patch, have you checked with Avi which ones are good to be
> checked in? Copying Avi on the message.

Nevermind, just talked to Avi, we'll have to modify the whole test. Will
keep you posted.

> 
> > 
> > Signed-off-by: Michael Goldish <mgoldish@redhat.com>
> > ---
> >  client/tests/kvm/kvm_vm.py |   47 +++++++++++++++++++++----------------------
> >  1 files changed, 23 insertions(+), 24 deletions(-)
> > 
> > diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
> > index af45a81..78cbb16 100755
> > --- a/client/tests/kvm/kvm_vm.py
> > +++ b/client/tests/kvm/kvm_vm.py
> > @@ -502,49 +502,48 @@ class VM:
> >                  self.uuid = f.read().strip()
> >                  f.close()
> >  
> > -            if not params.get("pci_assignable") == "no":
> > -                pa_type = params.get("pci_assignable")
> > +            # Assign a PCI assignable device
> > +            self.pci_assignable = None
> > +            pa_type = params.get("pci_assignable")
> > +            if pa_type in ["vf", "pf", "mixed"]:
> >                  pa_devices_requested = params.get("devices_requested")
> >  
> >                  # Virtual Functions (VF) assignable devices
> >                  if pa_type == "vf":
> > -                    pa_driver = params.get("driver")
> > -                    pa_driver_option = params.get("driver_option")
> > -                    self.pci_assignable = kvm_utils.PciAssignable(type=pa_type,
> > -                                        driver=pa_driver,
> > -                                        driver_option=pa_driver_option,
> > -                                        devices_requested=pa_devices_requested)
> > +                    self.pci_assignable = kvm_utils.PciAssignable(
> > +                        type=pa_type,
> > +                        driver=params.get("driver"),
> > +                        driver_option=params.get("driver_option"),
> > +                        devices_requested=pa_devices_requested)
> >                  # Physical NIC (PF) assignable devices
> >                  elif pa_type == "pf":
> > -                    pa_device_names = params.get("device_names")
> > -                    self.pci_assignable = kvm_utils.PciAssignable(type=pa_type,
> > -                                         names=pa_device_names,
> > -                                         devices_requested=pa_devices_requested)
> > +                    self.pci_assignable = kvm_utils.PciAssignable(
> > +                        type=pa_type,
> > +                        names=params.get("device_names"),
> > +                        devices_requested=pa_devices_requested)
> >                  # Working with both VF and PF
> >                  elif pa_type == "mixed":
> > -                    pa_device_names = params.get("device_names")
> > -                    pa_driver = params.get("driver")
> > -                    pa_driver_option = params.get("driver_option")
> > -                    self.pci_assignable = kvm_utils.PciAssignable(type=pa_type,
> > -                                        driver=pa_driver,
> > -                                        driver_option=pa_driver_option,
> > -                                        names=pa_device_names,
> > -                                        devices_requested=pa_devices_requested)
> > +                    self.pci_assignable = kvm_utils.PciAssignable(
> > +                        type=pa_type,
> > +                        driver=params.get("driver"),
> > +                        driver_option=params.get("driver_option"),
> > +                        names=params.get("device_names"),
> > +                        devices_requested=pa_devices_requested)
> >  
> >                  self.pa_pci_ids = self.pci_assignable.request_devs()
> >  
> >                  if self.pa_pci_ids:
> > -                    logging.debug("Successfuly assigned devices: %s" %
> > +                    logging.debug("Successfuly assigned devices: %s",
> >                                    self.pa_pci_ids)
> >                  else:
> >                      logging.error("No PCI assignable devices were assigned "
> >                                    "and 'pci_assignable' is defined to %s "
> > -                                  "on your config file. Aborting VM creation." %
> > +                                  "on your config file. Aborting VM creation.",
> >                                    pa_type)
> >                      return False
> >  
> > -            else:
> > -                self.pci_assignable = None
> > +            elif pa_type and pa_type != "no":
> > +                logging.warn("Unsupported pci_assignable type: %s", pa_type)
> >  
> >              # Make qemu command
> >              qemu_command = self.make_qemu_command()
> 
> 
> _______________________________________________
> Autotest mailing list
> Autotest@test.kernel.org
> http://test.kernel.org/cgi-bin/mailman/listinfo/autotest



      reply	other threads:[~2010-06-07 13:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-06  6:41 [KVM-AUTOTEST PATCH] KVM test: kvm_vm.py: don't require pci_assignable to be defined Michael Goldish
2010-06-07 13:24 ` Lucas Meneghel Rodrigues
2010-06-07 13:38   ` Lucas Meneghel Rodrigues [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1275917880.2589.6.camel@freedom \
    --to=lmr@redhat.com \
    --cc=autotest@test.kernel.org \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mgoldish@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox