~ubuntu-branches/ubuntu/quantal/virtinst/quantal-proposed

« back to all changes in this revision

Viewing changes to virtinst/VirtualHostDevice.py

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-07-24 08:52:01 UTC
  • mfrom: (1.6.8 sid)
  • Revision ID: package-import@ubuntu.com-20120724085201-q3h0cbabg4t46gfm
Tags: 0.600.2-1ubuntu1
* Merge from debian unstable. Remaining changes:
  - debian/patches/9003-fix-path-to-hvmloader-in-testsuite.patch: adjust
    testsuite for 0001-fix-path-to-hvmloader.patch and
    0002-Fix-path-to-pygrub.patch.
  - debian/patches/9004_ubuntu_fix_tree_support.patch: Fix tree detection
    for all ISO/HTTP source, to not longer fail with cobbler/koan.
  - debian/patches/0004-Fix-path-to-qemu-dm.patch: fix the path to the
    qemu-dm binary.
  - debian/{control,rules,pyversions}: Build using dh_python2, use
    debhelper v8 instead of cdbs; for some reason the package build an
    empty binary package when using dh_python2.
  - debian/control: added acl package to depends.
  - debian/control: added libvirt-bin to recommends
* Dropped patches:
  - debian/patches/9005_ubuntu_releases.patch: Upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
214
214
 
215
215
        self.vendor = nodedev.vendor_id
216
216
        self.product = nodedev.product_id
217
 
        self.bus = nodedev.bus
218
 
        self.device = nodedev.device
 
217
 
 
218
        if not (self.vendor or self.product):
 
219
            self.bus = nodedev.bus
 
220
            self.device = nodedev.device
219
221
 
220
222
    def _get_source_xml(self):
221
223
        xml = ""
 
224
        found = False
 
225
 
222
226
        if self.vendor and self.product:
223
227
            xml += "        <vendor id='%s'/>\n" % self.vendor
224
228
            xml += "        <product id='%s'/>\n" % self.product
225
 
        elif self.bus and self.device:
 
229
            found = True
 
230
 
 
231
        if self.bus and self.device:
226
232
            xml += "        <address bus='%s' device='%s'/>\n" % (self.bus,
227
233
                                                                  self.device)
228
 
        else:
 
234
            found = True
 
235
 
 
236
        if not found:
229
237
            raise RuntimeError(_("'vendor' and 'product', or 'bus' and "
230
238
                                 " 'device' are required."))
231
239
        return xml