]> git.pld-linux.org Git - packages/virt-manager.git/blob - virt-manager-git.patch
- upstream fixes, R: libosinfo (by code changes)
[packages/virt-manager.git] / virt-manager-git.patch
1 diff -urN virt-manager-1.0.1/data/virt-manager.appdata.xml virt-manager/data/virt-manager.appdata.xml
2 --- virt-manager-1.0.1/data/virt-manager.appdata.xml    2014-02-17 17:37:52.000000000 +0000
3 +++ virt-manager/data/virt-manager.appdata.xml  2014-06-12 11:22:20.805891891 +0000
4 @@ -2,7 +2,8 @@
5  <!-- Copyright 2013 Cole Robinson -->
6  <application>
7   <id type="desktop">virt-manager.desktop</id>
8 - <licence>CC0</licence>
9 + <metadata_license>CC0-1.0</metadata_license>
10 + <project_license>GPL-2.0+</project_license>
11   <name>Virtual Machine Manager</name>
12   <summary>Graphically manage KVM, Xen, or LXC via libvirt</summary>
13   <description>
14 diff -urN virt-manager-1.0.1/man/virt-install.pod virt-manager/man/virt-install.pod
15 --- virt-manager-1.0.1/man/virt-install.pod     2014-03-22 16:27:02.000000000 +0000
16 +++ virt-manager/man/virt-install.pod   2014-06-12 11:22:20.806891891 +0000
17 @@ -123,6 +123,18 @@
18  
19  Use --metadata=? to see a list of all available sub options. Complete details at L<http://libvirt.org/formatdomain.html#elementsMetadata>
20  
21 +=item --events OPT=VAL,[...]
22 +
23 +Specify events values for the guest. Possible options include on_poweroff, on_reboot, and on_crash.
24 +
25 +Use --events=? to see a list of all available sub options. Complete details at L<http://libvirt.org/formatdomain.html#elementsEvents>
26 +
27 +=item --resource OPT=VAL,[...]
28 +
29 +Specify resource partitioning for the guest.
30 +
31 +Use --resource=? to see a list of all available sub options. Complete details at L<http://libvirt.org/formatdomain.html#resPartition>
32 +
33  =item --vcpus=VCPUS[,maxvcpus=MAX][,sockets=#][,cores=#][,threads=#][,cpuset=CPUSET]
34  
35  Number of virtual cpus to configure for the guest. If 'maxvcpus' is specified,
36 @@ -264,7 +276,7 @@
37  
38  =item --pm=PMOPTS
39  
40 -Configure guest power management features. Example suboptions include suspend_to_ram=on|off and suspend_to_disk=on|off
41 +Configure guest power management features. Example suboptions include suspend_to_mem=on|off and suspend_to_disk=on|off
42  
43  Use --pm=? to see a list of all available sub options. Complete details at L<http://libvirt.org/formatdomain.html#elementsPowerManagement>
44  
45 @@ -278,7 +290,7 @@
46  
47  =item  --cdrom=CDROM
48  
49 -File or device use as a virtual CD-ROM device for fully virtualized guests.
50 +File or device used as a virtual CD-ROM device for fully virtualized guests.
51  It can be path to an ISO image, or to a CDROM device. It can also be a URL
52  from which to fetch/access a minimal boot ISO image. The URLs take the same
53  format as described for the C<--location> argument. If a cdrom has been
54 @@ -399,11 +411,8 @@
55  the install media (currently only supported for URL installs). Autodetection
56  can be disabled with the special value 'none'.
57  
58 -If the special value 'list' is passed, virt-install will print the full
59 -list of variant values and exit. The printed format is not a stable
60 -interface, DO NOT PARSE IT.
61 -
62 -Use '--os-variant list' to see the full OS list
63 +Use the command "osinfo-query os" to get the list of the accepted OS
64 +variants.
65  
66  =item --boot=BOOTOPTS
67  
68 @@ -527,7 +536,7 @@
69  
70  =item B<device>
71  
72 -Disk device type. Value can be 'cdrom', 'disk', or 'floppy'. Default is
73 +Disk device type. Value can be 'cdrom', 'disk', 'lun' or 'floppy'. Default is
74  'disk'. If a 'cdrom' is specified, and no install method is chosen, the
75  cdrom is used as the install media.
76  
77 @@ -576,6 +585,13 @@
78  'writethrough' provides read caching. 'writeback' provides
79  read and write caching.
80  
81 +=item B<discard>
82 +
83 +Whether discard (also known as "trim" or "unmap") requests are ignored
84 +or passed to the filesystem. The value can be either "unmap" (allow
85 +the discard request to be passed) or "ignore" (ignore the discard
86 +request). Since 1.0.6 (QEMU and KVM only)
87 +
88  =item B<format>
89  
90  Disk image format. For file volumes, this can be 'raw', 'qcow2', 'vmdk', etc. See format types in L<http://libvirt.org/storage.html> for possible values. This is often mapped to the B<driver_type> value as well.
91 diff -urN virt-manager-1.0.1/man/virt-manager.pod virt-manager/man/virt-manager.pod
92 --- virt-manager-1.0.1/man/virt-manager.pod     2014-03-22 16:27:02.000000000 +0000
93 +++ virt-manager/man/virt-manager.pod   2014-06-12 11:22:20.806891891 +0000
94 @@ -93,7 +93,7 @@
95  
96  =head1 BUGS
97  
98 -Please see L<http://virt-manager.org/page/BugReporting>
99 +Please see L<http://virt-manager.org/bugs/>
100  
101  =head1 COPYRIGHT
102  
103 diff -urN virt-manager-1.0.1/setup.py virt-manager/setup.py
104 --- virt-manager-1.0.1/setup.py 2014-02-17 17:37:52.000000000 +0000
105 +++ virt-manager/setup.py       2014-06-12 11:22:20.912891892 +0000
106 @@ -1,8 +1,6 @@
107  #!/usr/bin/env python2
108  # Copyright (C) 2013, 2014 Red Hat, Inc.
109  
110 -# pylint: disable=W0201
111 -# Attribute defined outside __init__: custom commands require breaking this
112  
113  import datetime
114  import glob
115 @@ -22,6 +20,8 @@
116  from virtcli import cliconfig
117  
118  
119 +# pylint: disable=attribute-defined-outside-init
120 +
121  def _generate_potfiles_in():
122      def find(dirname, ext):
123          ret = []
124 @@ -324,6 +324,8 @@
125           "Hide config bits that are not considered stable (default=no)"),
126          ("default-graphics=", None,
127           "Default graphics type (spice or vnc) (default=spice)"),
128 +        ("with-bhyve=", None,
129 +         "whether enable Bhyve connection support (default=no)"),
130  
131      ]
132      description = "Configure the build, similar to ./configure"
133 @@ -341,6 +343,7 @@
134          self.preferred_distros = None
135          self.stable_defaults = None
136          self.default_graphics = None
137 +        self.with_bhyve = None
138  
139  
140      def run(self):
141 @@ -364,6 +367,8 @@
142                           self.stable_defaults)
143          if self.default_graphics is not None:
144              template += "default_graphics = %s\n" % self.default_graphics
145 +        if self.with_bhyve is not None:
146 +            template += "with_bhyve = %s\n" % self.with_bhyve
147  
148          file(cliconfig.cfgpath, "w").write(template)
149          print "Generated %s" % cliconfig.cfgpath
150 diff -urN virt-manager-1.0.1/tests/capabilities.py virt-manager/tests/capabilities.py
151 --- virt-manager-1.0.1/tests/capabilities.py    2014-03-22 16:26:50.000000000 +0000
152 +++ virt-manager/tests/capabilities.py  2014-06-12 11:22:20.913891892 +0000
153 @@ -20,6 +20,7 @@
154  
155  from tests import utils
156  from virtinst import CapabilitiesParser as capabilities
157 +from virtinst.capabilities import _CPUMapFileValues
158  
159  
160  def build_host_feature_dict(feature_list):
161 @@ -221,6 +222,7 @@
162          test_utils(new_caps_no_kvm, False, True, False, False, False)
163  
164      def testCPUMap(self):
165 +        _CPUMapFileValues.update_cpu_filename("tests/capabilities-xml/cpu_map.xml")
166          caps = self._buildCaps("libvirt-0.7.6-qemu-caps.xml")
167          cpu_64 = caps.get_cpu_values(None, "x86_64")
168          cpu_32 = caps.get_cpu_values(None, "i486")
169 diff -urN virt-manager-1.0.1/tests/clitest.py virt-manager/tests/clitest.py
170 --- virt-manager-1.0.1/tests/clitest.py 2014-03-22 16:26:50.000000000 +0000
171 +++ virt-manager/tests/clitest.py       2014-06-12 11:22:21.018891898 +0000
172 @@ -123,12 +123,10 @@
173  }
174  
175  
176 -
177  ######################
178  # Test class helpers #
179  ######################
180  
181 -
182  class Command(object):
183      """
184      Instance of a single cli command to test
185 @@ -378,7 +376,7 @@
186          self.categories = {}
187          self.cmds = []
188  
189 -    def _default_args(self, cli, iscompare):
190 +    def _default_args(self, cli, iscompare, auto_printarg):
191          args = ""
192          if not iscompare:
193              args = "--debug"
194 @@ -392,7 +390,7 @@
195              if "--ram " not in cli:
196                  args += " --ram 64"
197  
198 -        if iscompare:
199 +        if iscompare and auto_printarg:
200              if self.appname == "virt-install":
201                  if (not cli.count("--print-xml") and
202                      not cli.count("--print-step") and
203 @@ -418,11 +416,13 @@
204          return obj
205  
206      def _add(self, catname, testargs, valid, compfile,
207 -             skip_check=None, compare_check=None, input_file=None):
208 +             skip_check=None, compare_check=None, input_file=None,
209 +             auto_printarg=True):
210  
211          category = self.categories[catname]
212          args = category.default_args + " " + testargs
213 -        args = self._default_args(args, bool(compfile)) + " " + args
214 +        args = (self._default_args(args, bool(compfile), auto_printarg) +
215 +            " " + args)
216          cmdstr = "./%s %s" % (self.appname, args)
217  
218          cmd = Command(cmdstr)
219 @@ -472,6 +472,7 @@
220  c.add_valid("--memtune hard_limit=10,soft_limit=20,swap_hard_limit=30,min_guarantee=40")  # --memtune
221  c.add_valid("--memorybacking hugepages=yes,nosharepages=yes,locked=yes")  # --memorybacking nosharepages,locked
222  c.add_valid("--idmap uid_start=0,uid_target=1000,uid_count=10,gid_start=0,gid_target=1000,gid_count=10")  # --idmap
223 +c.add_valid("--resource partition=/virtualmachines/production")  # --resource
224  c.add_compare("--connect %(DEFAULTURI)s --cpuset auto --vcpus 2", "cpuset-auto")  # --cpuset=auto actually works
225  c.add_invalid("--vcpus 32 --cpuset=969-1000")  # Bogus cpuset
226  c.add_invalid("--vcpus 32 --cpuset=autofoo")  # Bogus cpuset
227 @@ -545,7 +546,7 @@
228  
229  c = vinst.add_category("misc", "--nographics --noautoconsole")
230  c.add_valid("--panic help --disk=?")  # Make sure introspection doesn't blow up
231 -c.add_compare("", "noargs-fail")  # No arguments
232 +c.add_compare("", "noargs-fail", auto_printarg=False)  # No arguments
233  c.add_compare("--hvm --nodisks --pxe --print-step all", "simple-pxe")  # Diskless PXE install
234  c.add_compare("--hvm --cdrom %(EXISTIMG2)s --file %(EXISTIMG1)s --os-variant win2k3 --wait 0 --vcpus cores=4 --controller usb,model=none", "w2k3-cdrom")  # HVM windows install with disk
235  c.add_compare("""--hvm --pxe \
236 @@ -554,12 +555,12 @@
237  --controller usb,model=ich9-uhci2,address=0:0:4.1,index=0,master=2 \
238  --controller usb,model=ich9-uhci3,address=0:0:4.2,index=0,master=4 \
239  --disk %(EXISTUPPER)s,cache=writeback,io=threads,perms=sh,serial=WD-WMAP9A966149,boot_order=2 \
240 ---disk %(NEWIMG1)s,sparse=false,size=.001,perms=ro,error_policy=enospace \
241 +--disk %(NEWIMG1)s,sparse=false,size=.001,perms=ro,error_policy=enospace,discard=unmap \
242  --disk device=cdrom,bus=sata,read_bytes_sec=1,read_iops_sec=2,total_bytes_sec=10,total_iops_sec=20,write_bytes_sec=5,write_iops_sec=6 \
243  --disk size=1 \
244  --serial tcp,host=:2222,mode=bind,protocol=telnet \
245  --filesystem /source,/target,mode=squash \
246 ---network user,mac=12:34:56:78:11:22 \
247 +--network user,mac=12:34:56:78:11:22,portgroup=foo \
248  --network bridge=foobar,model=virtio,driver_name=qemu,driver_queues=3 \
249  --network type=direct,source=eth5,source_mode=vepa,target=mytap12,virtualport_type=802.1Qbg,virtualport_managerid=12,virtualport_typeid=1193046,virtualport_typeidversion=1,virtualport_instanceid=09b11c53-8b5c-4eeb-8f00-d84eaa0aaa3b,boot_order=1 \
250  --channel spicevmc \
251 @@ -581,7 +582,7 @@
252  c.add_valid("--hvm --import --disk path=%(EXISTIMG1)s")  # FV Import install
253  c.add_valid("--hvm --import --disk path=%(EXISTIMG1)s --prompt --force")  # Working scenario w/ prompt shouldn't ask anything
254  c.add_valid("--paravirt --import --disk path=%(EXISTIMG1)s")  # PV Import install
255 -c.add_valid("--paravirt --import --disk path=%(EXISTIMG1)s --print-xml")  # PV Import install, print single XML
256 +c.add_valid("--paravirt --disk path=%(EXISTIMG1)s --print-xml")  # print single XML, implied import install
257  c.add_valid("--hvm --import --disk path=%(EXISTIMG1)s,device=floppy")  # Import a floppy disk
258  c.add_valid("--hvm --nodisks --pxe --autostart")  # --autostart flag
259  c.add_valid("--hvm --nodisks --pxe --description \"foobar & baz\"")  # --description
260 @@ -805,6 +806,7 @@
261  c.add_compare("""--metadata name=foo-my-new-name,uuid=12345678-12F4-1234-1234-123456789AFA,description="hey this is my
262  new
263  very,very=new desc\\\'",title="This is my,funky=new title" """, "edit-simple-metadata")
264 +c.add_compare("--events on_poweroff=destroy,on_reboot=restart,on_crash=preserve", "edit-simple-events")
265  c.add_compare("--memory 500,maxmemory=1000,hugepages=off", "edit-simple-memory")
266  c.add_compare("--vcpus 10,maxvcpus=20,cores=5,sockets=4,threads=1", "edit-simple-vcpus")
267  c.add_compare("--cpu model=pentium2,+x2apic,forbid=pbe", "edit-simple-cpu")
268 @@ -923,8 +925,8 @@
269  
270  
271  c = vclon.add_category("misc", "")
272 -c.add_compare("--connect %(KVMURI)s -o test-for-clone --auto-clone --clone-running", "clone-auto1")
273 -c.add_compare("-o test-clone-simple --name newvm --auto-clone --clone-running", "clone-auto2")
274 +c.add_compare("--connect %(KVMURI)s -o test-for-clone --auto-clone --clone-running", "clone-auto1", compare_check=support.SUPPORT_CONN_BARE_BACKINGSTORE)
275 +c.add_compare("-o test-clone-simple --name newvm --auto-clone --clone-running", "clone-auto2", compare_check=support.SUPPORT_CONN_BARE_BACKINGSTORE)
276  c.add_valid("-o test --auto-clone")  # Auto flag, no storage
277  c.add_valid("--original-xml %(CLONE_DISK_XML)s --auto-clone")  # Auto flag w/ storage,
278  c.add_valid("--original-xml %(CLONE_STORAGE_XML)s --auto-clone")  # Auto flag w/ managed storage,
279 diff -urN virt-manager-1.0.1/tests/cli-test-xml/compare/virt-clone-clone-auto1.xml virt-manager/tests/cli-test-xml/compare/virt-clone-clone-auto1.xml
280 --- virt-manager-1.0.1/tests/cli-test-xml/compare/virt-clone-clone-auto1.xml    2014-02-17 17:37:52.000000000 +0000
281 +++ virt-manager/tests/cli-test-xml/compare/virt-clone-clone-auto1.xml  2014-06-12 11:22:20.914891892 +0000
282 @@ -22,16 +22,19 @@
283      <disk type="block" device="floppy">
284        <driver type="vmdk"/>
285        <source dev="/dev/disk-pool/diskvol1-clone"/>
286 +      <backingStore/>
287        <target dev="fda" bus="fdc"/>
288        <address type="drive" controller="0" bus="0" target="0" unit="0"/>
289      </disk>
290      <disk type="block" device="disk">
291        <source dev="/dev/disk-pool/diskvol2"/>
292 +      <backingStore/>
293        <target dev="sda" bus="scsi"/>
294        <readonly/>
295        <address type="drive" controller="0" bus="0" target="0" unit="0"/>
296      </disk>
297      <disk type="block" device="cdrom">
298 +      <backingStore/>
299        <target dev="sdb" bus="scsi"/>
300        <readonly/>
301        <address type="drive" controller="0" bus="0" target="0" unit="1"/>
302 @@ -39,6 +42,7 @@
303      <disk type="block" device="disk">
304        <driver type="qcow2"/>
305        <source dev="/dev/default-pool/collidevol1.img"/>
306 +      <backingStore/>
307        <target dev="sdc" bus="scsi"/>
308        <readonly/>
309        <shareable/>
310 @@ -46,11 +50,13 @@
311      </disk>
312      <disk type="file" device="disk">
313        <source file="/dev/default-pool/default-vol-clone"/>
314 +      <backingStore/>
315        <target dev="hda" bus="ide"/>
316        <address type="drive" controller="0" bus="0" target="0" unit="0"/>
317      </disk>
318      <disk type="file" device="disk">
319        <source file="/dev/default-pool/testvol2-clone.img"/>
320 +      <backingStore/>
321        <target dev="hdb" bus="ide"/>
322        <address type="drive" controller="0" bus="0" target="0" unit="1"/>
323      </disk>
324 diff -urN virt-manager-1.0.1/tests/cli-test-xml/compare/virt-clone-clone-auto2.xml virt-manager/tests/cli-test-xml/compare/virt-clone-clone-auto2.xml
325 --- virt-manager-1.0.1/tests/cli-test-xml/compare/virt-clone-clone-auto2.xml    2014-02-17 17:37:52.000000000 +0000
326 +++ virt-manager/tests/cli-test-xml/compare/virt-clone-clone-auto2.xml  2014-06-12 11:22:20.914891892 +0000
327 @@ -22,6 +22,7 @@
328      <disk type="file" device="disk">
329        <driver type="qcow2"/>
330        <source file="/dev/default-pool/newvm.img"/>
331 +      <backingStore/>
332        <target dev="hda" bus="ide"/>
333        <address type="drive" controller="0" bus="0" target="0" unit="0"/>
334      </disk>
335 diff -urN virt-manager-1.0.1/tests/cli-test-xml/compare/virt-convert-ovf-compare.xml virt-manager/tests/cli-test-xml/compare/virt-convert-ovf-compare.xml
336 --- virt-manager-1.0.1/tests/cli-test-xml/compare/virt-convert-ovf-compare.xml  2014-02-18 22:43:49.000000000 +0000
337 +++ virt-manager/tests/cli-test-xml/compare/virt-convert-ovf-compare.xml        2014-06-12 11:22:20.914891892 +0000
338 @@ -1,5 +1,3 @@
339 -Copying test.ovf-disk1.vmdk to /tmp/test.ovf-disk1
340 -Copying testfile to /tmp/testfile
341  <domain type="kvm">
342    <name>test.ovf</name>
343    <uuid>00000000-1111-2222-3333-444444444444</uuid>
344 diff -urN virt-manager-1.0.1/tests/cli-test-xml/compare/virt-convert-vmx-compare.xml virt-manager/tests/cli-test-xml/compare/virt-convert-vmx-compare.xml
345 --- virt-manager-1.0.1/tests/cli-test-xml/compare/virt-convert-vmx-compare.xml  2014-02-18 22:43:49.000000000 +0000
346 +++ virt-manager/tests/cli-test-xml/compare/virt-convert-vmx-compare.xml        2014-06-12 11:22:20.914891892 +0000
347 @@ -1,4 +1,3 @@
348 -Running /usr/bin/qemu-img convert -O qcow2 fedora.vmdk /var/lib/libvirt/images/fedora.qcow2
349  <domain type="kvm">
350    <name>fedora</name>
351    <uuid>00000000-1111-2222-3333-444444444444</uuid>
352 diff -urN virt-manager-1.0.1/tests/cli-test-xml/compare/virt-install-many-devices.xml virt-manager/tests/cli-test-xml/compare/virt-install-many-devices.xml
353 --- virt-manager-1.0.1/tests/cli-test-xml/compare/virt-install-many-devices.xml 2014-02-17 17:37:52.000000000 +0000
354 +++ virt-manager/tests/cli-test-xml/compare/virt-install-many-devices.xml       2014-06-12 11:22:20.914891892 +0000
355 @@ -3,10 +3,6 @@
356    <uuid>00000000-1111-2222-3333-444444444444</uuid>
357    <memory>65536</memory>
358    <currentMemory>65536</currentMemory>
359 -  <vcpu>1</vcpu>
360 -  <numatune>
361 -    <memory mode="preferred" nodeset="1-3,5"/>
362 -  </numatune>
363    <blkiotune>
364      <weight>200</weight>
365      <device>
366 @@ -14,6 +10,10 @@
367        <weight>300</weight>
368      </device>
369    </blkiotune>
370 +  <vcpu>1</vcpu>
371 +  <numatune>
372 +    <memory mode="preferred" nodeset="1-3,5"/>
373 +  </numatune>
374    <os>
375      <type arch="i686">hvm</type>
376      <loader>/foo/bar</loader>
377 @@ -52,7 +52,7 @@
378        <boot order="2"/>
379      </disk>
380      <disk type="file" device="disk">
381 -      <driver error_policy="enospace"/>
382 +      <driver discard="unmap" error_policy="enospace"/>
383        <source file="/dev/default-pool/new1.img"/>
384        <target dev="hdb" bus="ide"/>
385        <readonly/>
386 @@ -93,6 +93,7 @@
387        <target dir="/target"/>
388      </filesystem>
389      <interface type="user">
390 +      <source portgroup="foo"/>
391        <mac address="12:34:56:78:11:22"/>
392      </interface>
393      <interface type="bridge">
394 @@ -147,10 +148,6 @@
395    <uuid>00000000-1111-2222-3333-444444444444</uuid>
396    <memory>65536</memory>
397    <currentMemory>65536</currentMemory>
398 -  <vcpu>1</vcpu>
399 -  <numatune>
400 -    <memory mode="preferred" nodeset="1-3,5"/>
401 -  </numatune>
402    <blkiotune>
403      <weight>200</weight>
404      <device>
405 @@ -158,6 +155,10 @@
406        <weight>300</weight>
407      </device>
408    </blkiotune>
409 +  <vcpu>1</vcpu>
410 +  <numatune>
411 +    <memory mode="preferred" nodeset="1-3,5"/>
412 +  </numatune>
413    <os>
414      <type arch="i686">hvm</type>
415      <loader>/foo/bar</loader>
416 @@ -196,7 +197,7 @@
417        <boot order="2"/>
418      </disk>
419      <disk type="file" device="disk">
420 -      <driver error_policy="enospace"/>
421 +      <driver discard="unmap" error_policy="enospace"/>
422        <source file="/dev/default-pool/new1.img"/>
423        <target dev="hdb" bus="ide"/>
424        <readonly/>
425 @@ -237,6 +238,7 @@
426        <target dir="/target"/>
427      </filesystem>
428      <interface type="user">
429 +      <source portgroup="foo"/>
430        <mac address="12:34:56:78:11:22"/>
431      </interface>
432      <interface type="bridge">
433 diff -urN virt-manager-1.0.1/tests/cli-test-xml/compare/virt-xml-edit-clear-disk.xml virt-manager/tests/cli-test-xml/compare/virt-xml-edit-clear-disk.xml
434 --- virt-manager-1.0.1/tests/cli-test-xml/compare/virt-xml-edit-clear-disk.xml  2014-02-17 17:37:52.000000000 +0000
435 +++ virt-manager/tests/cli-test-xml/compare/virt-xml-edit-clear-disk.xml        2014-06-12 11:22:20.916891892 +0000
436 @@ -4,10 +4,10 @@
437  -    <disk type="block" device="floppy">
438  -      <source dev="/dev/null"/>
439  +    <disk device="floppy">
440 -+      <source file="/foo/bar"/>
441         <target dev="fda" bus="fdc"/>
442  -      <boot order="5"/>
443  -      <address type="drive" controller="0" bus="0" target="0" unit="0"/>
444 ++      <source file="/foo/bar"/>
445       </disk>
446       <disk type="dir" device="floppy">
447         <source dir="/tmp"/>
448 diff -urN virt-manager-1.0.1/tests/cli-test-xml/compare/virt-xml-edit-simple-events.xml virt-manager/tests/cli-test-xml/compare/virt-xml-edit-simple-events.xml
449 --- virt-manager-1.0.1/tests/cli-test-xml/compare/virt-xml-edit-simple-events.xml       1970-01-01 00:00:00.000000000 +0000
450 +++ virt-manager/tests/cli-test-xml/compare/virt-xml-edit-simple-events.xml     2014-06-12 11:22:20.916891892 +0000
451 @@ -0,0 +1,11 @@
452 +   </clock>
453 +   <on_poweroff>destroy</on_poweroff>
454 +   <on_reboot>restart</on_reboot>
455 +-  <on_crash>restart</on_crash>
456 ++  <on_crash>preserve</on_crash>
457 +   <pm>
458 +     <suspend-to-mem enabled="no"/>
459 +   </pm>
460 +
461 +Domain 'test-many-devices' defined successfully.
462 +Changes will take effect after the next domain shutdown.
463 \ No newline at end of file
464 diff -urN virt-manager-1.0.1/tests/image.py virt-manager/tests/image.py
465 --- virt-manager-1.0.1/tests/image.py   2014-03-22 16:26:50.000000000 +0000
466 +++ virt-manager/tests/image.py 2014-06-12 11:22:21.065891894 +0000
467 @@ -25,7 +25,7 @@
468  qemuuri = "__virtinst_test__test:///default,caps=%s/tests/capabilities-xml/capabilities-kvm.xml,qemu,predictable" % os.getcwd()
469  
470  
471 -# pylint: disable=W0212
472 +# pylint: disable=protected-access
473  # Access to protected member, needed to unittest stuff
474  
475  class TestImageParser(unittest.TestCase):
476 diff -urN virt-manager-1.0.1/tests/__init__.py virt-manager/tests/__init__.py
477 --- virt-manager-1.0.1/tests/__init__.py        2014-03-22 16:26:50.000000000 +0000
478 +++ virt-manager/tests/__init__.py      2014-06-12 11:22:20.912891892 +0000
479 @@ -33,7 +33,7 @@
480  
481  from tests import utils
482  
483 -# pylint: disable=W0212
484 +# pylint: disable=protected-access
485  # Access to protected member, needed to unittest stuff
486  
487  # Force certain helpers to return consistent values
488 diff -urN virt-manager-1.0.1/tests/misc.py virt-manager/tests/misc.py
489 --- virt-manager-1.0.1/tests/misc.py    2014-03-22 16:26:50.000000000 +0000
490 +++ virt-manager/tests/misc.py  2014-06-12 11:22:21.088891894 +0000
491 @@ -22,8 +22,7 @@
492  import sys
493  import unittest
494  
495 -_badmodules = ["gi.repository.Gtk", "gi.repository.GObject",
496 -              "gi.repository.Gdk", "gi.repository.GLib"]
497 +_badmodules = ["gi.repository.Gtk", "gi.repository.Gdk"]
498  
499  
500  def _restore_modules(fn):
501 diff -urN virt-manager-1.0.1/tests/pep8.cfg virt-manager/tests/pep8.cfg
502 --- virt-manager-1.0.1/tests/pep8.cfg   2014-01-18 20:55:50.000000000 +0000
503 +++ virt-manager/tests/pep8.cfg 2014-06-12 11:22:21.115891895 +0000
504 @@ -2,7 +2,7 @@
505  
506  format = pylint
507  
508 -# E12*:            # Continuation line indents
509 +# E1* :            # Continuation line indents
510  # E203:            # Space before : in dictionary defs
511  # E221:            # Multiple spaces before operator
512  #                    (warngs about column aligning assigments)
513 @@ -11,4 +11,4 @@
514  # E303:            # Too many blank lines
515  # E501:            # Line too long
516  
517 -ignore=E121,E122,E123,E124,E125,E126,E127,E128,E203,E221,E241,E301,E303,E501
518 +ignore=E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E203,E221,E241,E301,E303,E501
519 diff -urN virt-manager-1.0.1/tests/pylint.cfg virt-manager/tests/pylint.cfg
520 --- virt-manager-1.0.1/tests/pylint.cfg 2014-03-22 15:53:22.000000000 +0000
521 +++ virt-manager/tests/pylint.cfg       2014-06-12 11:22:21.115891895 +0000
522 @@ -34,29 +34,7 @@
523  # multiple time (only on the command line, not in the configuration file where
524  # it should appear only once).
525  
526 -# Design: Things like 'too many arguments'
527 -# C0103: Name doesn't match some style regex
528 -# C0111: No docstring
529 -# C0301: Line too long
530 -# C0302: Too many lines in module
531 -# C0325: Superfluous parens
532 -# C0326: Bad whitespace
533 -# I0011: Warn about locally disabled pylint msgs
534 -# R0201: Method could be a function
535 -#
536 -# W0108: Lambda may not be necessary
537 -# W0142: Used * or ** magic*
538 -# W0603: Using the global statement
539 -# W0702: No exception type specified for 'catch'
540 -# W0703: Catch 'Exception'
541 -# W1401: Anomalous backslash in string
542 -#
543 -# May be useful to enable someday
544 -# Similarities: Code duplication
545 -# W1001: Use of 'property' on old style class,
546 -#        pylint can't detect our Gtk subclasses are new style
547 -# W0511: FIXME and XXX: messages
548 -disable=Design,Similarities,C0103,C0111,C0301,C0302,C0325,C0326,I0011,R0201,W0108,W0142,W0603,W0702,W0703,W1401,W1001,W0511
549 +disable=Design,Similarities,invalid-name,missing-docstring,line-too-long,too-many-lines,superfluous-parens,bad-whitespace,locally-disabled,no-self-use,unnecessary-lambda,star-args,fixme,global-statement,bare-except,anomalous-backslash-in-string,broad-except
550  
551  
552  [REPORTS]
553 diff -urN virt-manager-1.0.1/tests/storage.py virt-manager/tests/storage.py
554 --- virt-manager-1.0.1/tests/storage.py 2014-03-22 16:26:50.000000000 +0000
555 +++ virt-manager/tests/storage.py       2014-06-12 11:22:21.116891895 +0000
556 @@ -23,7 +23,7 @@
557  
558  from tests import utils
559  
560 -# pylint: disable=W0212
561 +# pylint: disable=protected-access
562  # Access to protected member, needed to unittest stuff
563  
564  basepath = os.path.join(os.getcwd(), "tests", "storage-xml")
565 @@ -188,10 +188,10 @@
566  
567          # Test creating with many devices
568          # XXX: Need to wire this up
569 -        #createPool(self.conn,
570 -        #           StoragePool.TYPE_LOGICAL, "pool-logical-manydev",
571 -        #           source_path=["/tmp/path1", "/tmp/path2", "/tmp/path3"],
572 -        #           target_path=None)
573 +        # createPool(self.conn,
574 +        #            StoragePool.TYPE_LOGICAL, "pool-logical-manydev",
575 +        #            source_path=["/tmp/path1", "/tmp/path2", "/tmp/path3"],
576 +        #            target_path=None)
577  
578      def testDiskPool(self):
579          poolobj = createPool(self.conn,
580 diff -urN virt-manager-1.0.1/tests/testdriver.xml virt-manager/tests/testdriver.xml
581 --- virt-manager-1.0.1/tests/testdriver.xml     2014-03-06 17:34:47.000000000 +0000
582 +++ virt-manager/tests/testdriver.xml   2014-06-12 11:22:21.117891895 +0000
583 @@ -1115,10 +1115,28 @@
584  
585  
586  <network>
587 -  <name>plainbridge</name>
588 +  <name>plainbridge-portgroups</name>
589    <uuid>b1b9d7c6-f620-048f-71ee-ca3ba1ac3e98</uuid>
590    <forward mode='bridge'/>
591    <bridge name='br2' />
592 +  <portgroup name='engineering' default='yes'>
593 +    <virtualport type='802.1Qbh'>
594 +      <parameters profileid='test'/>
595 +    </virtualport>
596 +    <bandwidth>
597 +      <inbound average='1000' peak='5000' burst='5120'/>
598 +      <outbound average='1000' peak='5000' burst='5120'/>
599 +    </bandwidth>
600 +  </portgroup>
601 +  <portgroup name='sales'>
602 +    <virtualport type='802.1Qbh'>
603 +      <parameters profileid='salestest'/>
604 +    </virtualport>
605 +    <bandwidth>
606 +      <inbound average='500' peak='2000' burst='2560'/>
607 +      <outbound average='128' peak='256' burst='256'/>
608 +    </bandwidth>
609 +  </portgroup>
610  </network>
611  
612  
613 diff -urN virt-manager-1.0.1/tests/test_urls.py virt-manager/tests/test_urls.py
614 --- virt-manager-1.0.1/tests/test_urls.py       2014-03-22 16:26:50.000000000 +0000
615 +++ virt-manager/tests/test_urls.py     2014-06-12 11:22:21.117891895 +0000
616 @@ -37,7 +37,7 @@
617  from virtinst.urlfetcher import MandrivaDistro
618  
619  
620 -# pylint: disable=W0212
621 +# pylint: disable=protected-access
622  # Access to protected member, needed to unittest stuff
623  
624  OLD_FEDORA_URL = "https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/%s/Fedora/%s/os/"
625 diff -urN virt-manager-1.0.1/tests/utils.py virt-manager/tests/utils.py
626 --- virt-manager-1.0.1/tests/utils.py   2014-03-22 16:26:50.000000000 +0000
627 +++ virt-manager/tests/utils.py 2014-06-12 11:22:21.117891895 +0000
628 @@ -31,7 +31,7 @@
629  # DON'T EDIT THIS. Use 'setup.py test --regenerate-output'
630  REGENERATE_OUTPUT = False
631  
632 -# pylint: disable=W0212
633 +# pylint: disable=protected-access
634  # Access to protected member, needed to unittest stuff
635  
636  _capsprefix  = ",caps=%s/tests/capabilities-xml/" % os.getcwd()
637 diff -urN virt-manager-1.0.1/tests/xmlconfig.py virt-manager/tests/xmlconfig.py
638 --- virt-manager-1.0.1/tests/xmlconfig.py       2014-03-22 16:26:50.000000000 +0000
639 +++ virt-manager/tests/xmlconfig.py     2014-06-12 11:22:21.121891895 +0000
640 @@ -34,7 +34,7 @@
641  
642  from tests import utils
643  
644 -# pylint: disable=W0212
645 +# pylint: disable=protected-access
646  # Access to protected member, needed to unittest stuff
647  
648  _testconn = utils.open_testdriver()
649 @@ -870,7 +870,7 @@
650          g.add_device(redir1)
651          g.add_device(redir2)
652  
653 -        #Panic Notifier device
654 +        # Panic Notifier device
655          pdev = VirtualPanicDevice(g.conn)
656          g.add_device(pdev)
657  
658 diff -urN virt-manager-1.0.1/tests/xmlparse.py virt-manager/tests/xmlparse.py
659 --- virt-manager-1.0.1/tests/xmlparse.py        2014-03-22 16:26:50.000000000 +0000
660 +++ virt-manager/tests/xmlparse.py      2014-06-12 11:22:21.124891895 +0000
661 @@ -90,7 +90,7 @@
662          return guest, outfile
663  
664      def test000ClearProps(self):
665 -        # pylint: disable=W0212
666 +        # pylint: disable=protected-access
667          # Access to protected member, needed to unittest stuff
668          virtinst.xmlbuilder._seenprops = []
669  
670 @@ -155,6 +155,10 @@
671          check("initrd", None)
672          check("kernel_args", None)
673  
674 +        guest.os.set_initargs_string("foo 'bar baz' frib")
675 +        self.assertEqual([i.val for i in guest.os.initargs],
676 +            ["foo", "bar baz", "frib"])
677 +
678          check = self._make_checker(guest.features)
679          check("acpi", True, False)
680          check("apic", True, True)
681 @@ -209,6 +213,9 @@
682          check("gid_target", None, 1000)
683          check("gid_count", None, 10)
684  
685 +        check = self._make_checker(guest.resource)
686 +        check("partition", None, "/virtualmachines/production")
687 +
688          check = self._make_checker(guest.get_devices("memballoon")[0])
689          check("model", "virtio", "none")
690  
691 @@ -331,6 +338,7 @@
692          check("driver_cache", None, "writeback")
693          check("driver_io", None, "threads")
694          check("driver_io", "threads", "native")
695 +        check("driver_discard", None, "unmap")
696          check("iotune_ris", 1, 0)
697          check("iotune_rbs", 2, 0)
698          check("iotune_wis", 3, 0)
699 @@ -361,6 +369,7 @@
700          console2    = guest.get_devices("console")[1]
701          channel1    = guest.get_devices("channel")[0]
702          channel2    = guest.get_devices("channel")[1]
703 +        channel3    = guest.get_devices("channel")[2]
704  
705          check = self._make_checker(serial1)
706          check("type", "null", "udp")
707 @@ -408,6 +417,12 @@
708          check("target_address", "1.2.3.4", "5.6.7.8")
709          check("target_port", 4567, 1199)
710  
711 +        check = self._make_checker(channel3)
712 +        check("type", "spiceport")
713 +        check("source_channel", "org.spice-space.webdav.0", "test.1")
714 +        check("target_type", "virtio")
715 +        check("target_name", "org.spice-space.webdav.0", "test.2")
716 +
717          self._alter_compare(guest.get_xml_config(), outfile)
718  
719      def testAlterControllers(self):
720 @@ -478,6 +493,7 @@
721          check("type", "direct")
722          check("source", "eth0.1")
723          check("source_mode", "vepa", "bridge")
724 +        check("portgroup", None, "sales")
725          check("driver_name", None, "vhost")
726          check("driver_queues", None, 5)
727  
728 @@ -958,7 +974,7 @@
729          check("autoconf", True, False)
730  
731          check = self._make_checker(iface.protocols[1].ips[1])
732 -        check("address", "fe80::215:58ff:fe6e:5", "foobar")
733 +        check("address", "fe80::215:58ff:fe6e:5", "2002::")
734          check("prefix", 64, 38)
735  
736          # Remove a child interface, verify it's data remains intact
737 @@ -1127,6 +1143,11 @@
738          check("mode", "nat", "route")
739          check("dev", None, "eth22")
740  
741 +        self.assertEquals(len(net.portgroups), 2)
742 +        check = self._make_checker(net.portgroups[0])
743 +        check("name", "engineering", "foo")
744 +        check("default", True, False)
745 +
746          self.assertEqual(len(net.ips), 4)
747          check = self._make_checker(net.ips[0])
748          check("address", "192.168.7.1", "192.168.8.1")
749 @@ -1175,7 +1196,7 @@
750          utils.diff_compare(guest.get_xml_config(), outfile)
751  
752      def testzzzzCheckProps(self):
753 -        # pylint: disable=W0212
754 +        # pylint: disable=protected-access
755          # Access to protected member, needed to unittest stuff
756  
757          # If a certain environment variable is set, XMLBuilder tracks
758 diff -urN virt-manager-1.0.1/tests/xmlparse-xml/change-chars-in.xml virt-manager/tests/xmlparse-xml/change-chars-in.xml
759 --- virt-manager-1.0.1/tests/xmlparse-xml/change-chars-in.xml   2014-02-17 17:37:52.000000000 +0000
760 +++ virt-manager/tests/xmlparse-xml/change-chars-in.xml 2014-06-12 11:22:21.122891895 +0000
761 @@ -44,5 +44,9 @@
762        <source mode="bind" path="/tmp/foobar"/>
763        <target type="guestfwd" address="1.2.3.4" port="4567"/>
764      </channel>
765 +    <channel type="spiceport">
766 +      <source channel="org.spice-space.webdav.0"/>
767 +      <target type="virtio" name="org.spice-space.webdav.0"/>
768 +    </channel>
769    </devices>
770  </domain>
771 diff -urN virt-manager-1.0.1/tests/xmlparse-xml/change-chars-out.xml virt-manager/tests/xmlparse-xml/change-chars-out.xml
772 --- virt-manager-1.0.1/tests/xmlparse-xml/change-chars-out.xml  2014-02-27 22:10:39.000000000 +0000
773 +++ virt-manager/tests/xmlparse-xml/change-chars-out.xml        2014-06-12 11:22:21.122891895 +0000
774 @@ -47,5 +47,9 @@
775        <source mode="bind" path="/tmp/foobar"/>
776        <target type="guestfwd" address="5.6.7.8" port="1199"/>
777      </channel>
778 +    <channel type="spiceport">
779 +      <source channel="test.1"/>
780 +      <target type="virtio" name="test.2"/>
781 +    </channel>
782    </devices>
783  </domain>
784 diff -urN virt-manager-1.0.1/tests/xmlparse-xml/change-disk-out.xml virt-manager/tests/xmlparse-xml/change-disk-out.xml
785 --- virt-manager-1.0.1/tests/xmlparse-xml/change-disk-out.xml   2014-02-27 22:10:39.000000000 +0000
786 +++ virt-manager/tests/xmlparse-xml/change-disk-out.xml 2014-06-12 11:22:21.122891895 +0000
787 @@ -50,7 +50,7 @@
788          <total_iops_sec>5</total_iops_sec>
789          <total_bytes_sec>6</total_bytes_sec>
790        </iotune>
791 -      <driver cache="writeback" io="native"/>
792 +      <driver cache="writeback" discard="unmap" io="native"/>
793        <source file="/dev/default-pool/default-vol" startupPolicy="optional"/>
794        <shareable/>
795      </disk>
796 diff -urN virt-manager-1.0.1/tests/xmlparse-xml/change-guest-out.xml virt-manager/tests/xmlparse-xml/change-guest-out.xml
797 --- virt-manager-1.0.1/tests/xmlparse-xml/change-guest-out.xml  2014-03-22 16:16:24.000000000 +0000
798 +++ virt-manager/tests/xmlparse-xml/change-guest-out.xml        2014-06-12 11:22:21.122891895 +0000
799 @@ -10,6 +10,9 @@
800      <init>/sbin/init</init>
801      <bootmenu enable="no"/>
802      <bios useserial="yes"/>
803 +    <initarg>foo</initarg>
804 +    <initarg>bar baz</initarg>
805 +    <initarg>frib</initarg>
806    </os>
807    <features><apic eoi="on"/>
808      <hyperv>
809 @@ -78,17 +81,6 @@
810    </seclabel>
811    <title>Hey title changed!</title>
812    <description>Hey desc changed&amp;</description>
813 -  <memoryBacking>
814 -    <hugepages/>
815 -    <nosharepages/>
816 -    <locked/>
817 -  </memoryBacking>
818 -  <memtune>
819 -    <hard_limit>2048</hard_limit>
820 -    <soft_limit>200</soft_limit>
821 -    <swap_hard_limit>400</swap_hard_limit>
822 -    <min_guarantee>500</min_guarantee>
823 -  </memtune>
824    <blkiotune>
825      <weight>200</weight>
826      <device>
827 @@ -96,9 +88,23 @@
828        <weight>300</weight>
829      </device>
830    </blkiotune>
831 +  <memtune>
832 +    <hard_limit>2048</hard_limit>
833 +    <soft_limit>200</soft_limit>
834 +    <swap_hard_limit>400</swap_hard_limit>
835 +    <min_guarantee>500</min_guarantee>
836 +  </memtune>
837 +  <memoryBacking>
838 +    <hugepages/>
839 +    <nosharepages/>
840 +    <locked/>
841 +  </memoryBacking>
842    <bootloader>pygrub</bootloader>
843    <idmap>
844      <uid start="0" target="1000" count="10"/>
845      <gid start="0" target="1000" count="10"/>
846    </idmap>
847 +  <resource>
848 +    <partition>/virtualmachines/production</partition>
849 +  </resource>
850  </domain>
851 diff -urN virt-manager-1.0.1/tests/xmlparse-xml/change-nics-out.xml virt-manager/tests/xmlparse-xml/change-nics-out.xml
852 --- virt-manager-1.0.1/tests/xmlparse-xml/change-nics-out.xml   2014-02-27 22:10:40.000000000 +0000
853 +++ virt-manager/tests/xmlparse-xml/change-nics-out.xml 2014-06-12 11:22:21.123891895 +0000
854 @@ -40,7 +40,7 @@
855      </interface>
856      <interface type="direct">
857        <mac address="00:11:22:33:44:55"/>
858 -      <source dev="eth0.1" mode="bridge"/>
859 +      <source dev="eth0.1" mode="bridge" portgroup="sales"/>
860        <virtualport type="802.1Qbg">
861          <parameters managerid="11" typeid="1193047" typeidversion="2" instanceid="09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f"/>
862        </virtualport>
863 diff -urN virt-manager-1.0.1/tests/xmlparse-xml/interface-test-bridge-ip-out.xml virt-manager/tests/xmlparse-xml/interface-test-bridge-ip-out.xml
864 --- virt-manager-1.0.1/tests/xmlparse-xml/interface-test-bridge-ip-out.xml      2014-02-27 22:10:40.000000000 +0000
865 +++ virt-manager/tests/xmlparse-xml/interface-test-bridge-ip-out.xml    2014-06-12 11:22:21.123891895 +0000
866 @@ -15,7 +15,7 @@
867    </protocol>
868    <protocol family="ipv6">
869      <ip address="fe99::215:58ff:fe6e:5" prefix="32"/>
870 -    <ip address="foobar" prefix="38"/>
871 +    <ip address="2002::" prefix="38"/>
872      <route gateway="1.2.3.4"/>
873    </protocol>
874  </interface>
875 diff -urN virt-manager-1.0.1/tests/xmlparse-xml/network-multi-in.xml virt-manager/tests/xmlparse-xml/network-multi-in.xml
876 --- virt-manager-1.0.1/tests/xmlparse-xml/network-multi-in.xml  2014-02-17 17:37:52.000000000 +0000
877 +++ virt-manager/tests/xmlparse-xml/network-multi-in.xml        2014-06-12 11:22:21.124891895 +0000
878 @@ -22,4 +22,22 @@
879    </ip>
880    <ip family="ipv4" address="192.168.19.0" netmask="255.255.255.0">
881    </ip>
882 +  <portgroup name='engineering' default='yes'>
883 +    <virtualport type='802.1Qbh'>
884 +      <parameters profileid='test'/>
885 +    </virtualport>
886 +    <bandwidth>
887 +      <inbound average='1000' peak='5000' burst='5120'/>
888 +      <outbound average='1000' peak='5000' burst='5120'/>
889 +    </bandwidth>
890 +  </portgroup>
891 +  <portgroup name='sales'>
892 +    <virtualport type='802.1Qbh'>
893 +      <parameters profileid='salestest'/>
894 +    </virtualport>
895 +    <bandwidth>
896 +      <inbound average='500' peak='2000' burst='2560'/>
897 +      <outbound average='128' peak='256' burst='256'/>
898 +    </bandwidth>
899 +  </portgroup>
900  </network>
901 diff -urN virt-manager-1.0.1/tests/xmlparse-xml/network-multi-out.xml virt-manager/tests/xmlparse-xml/network-multi-out.xml
902 --- virt-manager-1.0.1/tests/xmlparse-xml/network-multi-out.xml 2014-02-27 22:10:40.000000000 +0000
903 +++ virt-manager/tests/xmlparse-xml/network-multi-out.xml       2014-06-12 11:22:21.124891895 +0000
904 @@ -24,6 +24,24 @@
905    </ip>
906    <ip family="ipv4" address="192.168.19.0" netmask="255.255.255.0">
907    </ip>
908 +  <portgroup name="foo" default="no">
909 +    <virtualport type="802.1Qbh">
910 +      <parameters profileid="test"/>
911 +    </virtualport>
912 +    <bandwidth>
913 +      <inbound average="1000" peak="5000" burst="5120"/>
914 +      <outbound average="1000" peak="5000" burst="5120"/>
915 +    </bandwidth>
916 +  </portgroup>
917 +  <portgroup name="sales">
918 +    <virtualport type="802.1Qbh">
919 +      <parameters profileid="salestest"/>
920 +    </virtualport>
921 +    <bandwidth>
922 +      <inbound average="500" peak="2000" burst="2560"/>
923 +      <outbound average="128" peak="256" burst="256"/>
924 +    </bandwidth>
925 +  </portgroup>
926    <mac address="52:54:00:69:eb:FF"/>
927    <route family="ipv4" address="192.168.8.0" prefix="24" gateway="192.168.8.10"/>
928  </network>
929 diff -urN virt-manager-1.0.1/ui/about.ui virt-manager/ui/about.ui
930 --- virt-manager-1.0.1/ui/about.ui      2014-02-17 17:37:52.000000000 +0000
931 +++ virt-manager/ui/about.ui    2014-06-12 11:22:21.124891895 +0000
932 @@ -6,7 +6,7 @@
933      <property name="destroy_with_parent">True</property>
934      <property name="type_hint">dialog</property>
935      <property name="program_name">Virtual Machine Manager</property>
936 -    <property name="copyright" translatable="yes">Copyright (C) 2006-2011 Red Hat Inc.</property>
937 +    <property name="copyright" translatable="yes">Copyright (C) 2006-2014 Red Hat Inc.</property>
938      <property name="comments" translatable="yes">Powered by libvirt</property>
939      <property name="website">http://virt-manager.org/</property>
940      <property name="website_label">http://virt-manager.org/</property>
941 diff -urN virt-manager-1.0.1/ui/addhardware.ui virt-manager/ui/addhardware.ui
942 --- virt-manager-1.0.1/ui/addhardware.ui        2014-03-12 21:17:20.000000000 +0000
943 +++ virt-manager/ui/addhardware.ui      2014-06-12 11:22:21.135891895 +0000
944 @@ -327,6 +327,83 @@
945                            </packing>
946                          </child>
947                          <child>
948 +                          <object class="GtkGrid" id="grid5">
949 +                            <property name="visible">True</property>
950 +                            <property name="can_focus">False</property>
951 +                            <property name="row_spacing">6</property>
952 +                            <property name="column_spacing">6</property>
953 +                            <child>
954 +                              <object class="GtkLabel" id="label29">
955 +                                <property name="visible">True</property>
956 +                                <property name="can_focus">False</property>
957 +                                <property name="xalign">0</property>
958 +                                <property name="label" translatable="yes">_Type:</property>
959 +                                <property name="use_underline">True</property>
960 +                              </object>
961 +                              <packing>
962 +                                <property name="left_attach">0</property>
963 +                                <property name="top_attach">0</property>
964 +                                <property name="width">1</property>
965 +                                <property name="height">1</property>
966 +                              </packing>
967 +                            </child>
968 +                            <child>
969 +                              <object class="GtkLabel" id="controller-model-label">
970 +                                <property name="visible">True</property>
971 +                                <property name="can_focus">False</property>
972 +                                <property name="xalign">0</property>
973 +                                <property name="label" translatable="yes">_Model:</property>
974 +                                <property name="use_underline">True</property>
975 +                              </object>
976 +                              <packing>
977 +                                <property name="left_attach">0</property>
978 +                                <property name="top_attach">1</property>
979 +                                <property name="width">1</property>
980 +                                <property name="height">1</property>
981 +                              </packing>
982 +                            </child>
983 +                            <child>
984 +                              <object class="GtkComboBox" id="controller-type">
985 +                                <property name="visible">True</property>
986 +                                <property name="can_focus">False</property>
987 +                                <signal name="changed" handler="on_controller_type_changed" swapped="no"/>
988 +                              </object>
989 +                              <packing>
990 +                                <property name="left_attach">1</property>
991 +                                <property name="top_attach">0</property>
992 +                                <property name="width">1</property>
993 +                                <property name="height">1</property>
994 +                              </packing>
995 +                            </child>
996 +                            <child>
997 +                              <object class="GtkComboBox" id="controller-model">
998 +                                <property name="visible">True</property>
999 +                                <property name="can_focus">False</property>
1000 +                              </object>
1001 +                              <packing>
1002 +                                <property name="left_attach">1</property>
1003 +                                <property name="top_attach">1</property>
1004 +                                <property name="width">1</property>
1005 +                                <property name="height">1</property>
1006 +                              </packing>
1007 +                            </child>
1008 +                          </object>
1009 +                          <packing>
1010 +                            <property name="position">2</property>
1011 +                          </packing>
1012 +                        </child>
1013 +                        <child type="tab">
1014 +                          <object class="GtkLabel" id="label24">
1015 +                            <property name="visible">True</property>
1016 +                            <property name="can_focus">False</property>
1017 +                            <property name="label" translatable="yes">Controller</property>
1018 +                          </object>
1019 +                          <packing>
1020 +                            <property name="position">2</property>
1021 +                            <property name="tab_fill">False</property>
1022 +                          </packing>
1023 +                        </child>
1024 +                        <child>
1025                            <object class="GtkBox" id="box2">
1026                              <property name="visible">True</property>
1027                              <property name="can_focus">False</property>
1028 @@ -491,7 +568,7 @@
1029                              </child>
1030                            </object>
1031                            <packing>
1032 -                            <property name="position">2</property>
1033 +                            <property name="position">3</property>
1034                            </packing>
1035                          </child>
1036                          <child type="tab">
1037 @@ -501,7 +578,7 @@
1038                              <property name="label">net</property>
1039                            </object>
1040                            <packing>
1041 -                            <property name="position">2</property>
1042 +                            <property name="position">3</property>
1043                              <property name="tab_fill">False</property>
1044                            </packing>
1045                          </child>
1046 @@ -539,7 +616,7 @@
1047                              </child>
1048                            </object>
1049                            <packing>
1050 -                            <property name="position">3</property>
1051 +                            <property name="position">4</property>
1052                            </packing>
1053                          </child>
1054                          <child type="tab">
1055 @@ -549,7 +626,7 @@
1056                              <property name="label">input</property>
1057                            </object>
1058                            <packing>
1059 -                            <property name="position">3</property>
1060 +                            <property name="position">4</property>
1061                              <property name="tab_fill">False</property>
1062                            </packing>
1063                          </child>
1064 @@ -562,7 +639,7 @@
1065                              </child>
1066                            </object>
1067                            <packing>
1068 -                            <property name="position">4</property>
1069 +                            <property name="position">5</property>
1070                            </packing>
1071                          </child>
1072                          <child type="tab">
1073 @@ -572,7 +649,7 @@
1074                              <property name="label">gfx</property>
1075                            </object>
1076                            <packing>
1077 -                            <property name="position">4</property>
1078 +                            <property name="position">5</property>
1079                              <property name="tab_fill">False</property>
1080                            </packing>
1081                          </child>
1082 @@ -611,7 +688,7 @@
1083                              </child>
1084                            </object>
1085                            <packing>
1086 -                            <property name="position">5</property>
1087 +                            <property name="position">6</property>
1088                            </packing>
1089                          </child>
1090                          <child type="tab">
1091 @@ -621,7 +698,7 @@
1092                              <property name="label">sound</property>
1093                            </object>
1094                            <packing>
1095 -                            <property name="position">5</property>
1096 +                            <property name="position">6</property>
1097                              <property name="tab_fill">False</property>
1098                            </packing>
1099                          </child>
1100 @@ -671,7 +748,7 @@
1101                              </child>
1102                            </object>
1103                            <packing>
1104 -                            <property name="position">6</property>
1105 +                            <property name="position">7</property>
1106                            </packing>
1107                          </child>
1108                          <child type="tab">
1109 @@ -681,7 +758,7 @@
1110                              <property name="label">host</property>
1111                            </object>
1112                            <packing>
1113 -                            <property name="position">6</property>
1114 +                            <property name="position">7</property>
1115                              <property name="tab_fill">False</property>
1116                            </packing>
1117                          </child>
1118 @@ -713,7 +790,7 @@
1119                                </object>
1120                                <packing>
1121                                  <property name="left_attach">1</property>
1122 -                                <property name="top_attach">8</property>
1123 +                                <property name="top_attach">9</property>
1124                                  <property name="width">1</property>
1125                                  <property name="height">1</property>
1126                                </packing>
1127 @@ -726,7 +803,7 @@
1128                                </object>
1129                                <packing>
1130                                  <property name="left_attach">1</property>
1131 -                                <property name="top_attach">5</property>
1132 +                                <property name="top_attach">7</property>
1133                                  <property name="width">1</property>
1134                                  <property name="height">1</property>
1135                                </packing>
1136 @@ -828,7 +905,7 @@
1137                                </object>
1138                                <packing>
1139                                  <property name="left_attach">1</property>
1140 -                                <property name="top_attach">7</property>
1141 +                                <property name="top_attach">8</property>
1142                                  <property name="width">1</property>
1143                                  <property name="height">1</property>
1144                                </packing>
1145 @@ -860,7 +937,7 @@
1146                                </object>
1147                                <packing>
1148                                  <property name="left_attach">0</property>
1149 -                                <property name="top_attach">5</property>
1150 +                                <property name="top_attach">8</property>
1151                                  <property name="width">1</property>
1152                                  <property name="height">1</property>
1153                                </packing>
1154 @@ -908,7 +985,7 @@
1155                                </object>
1156                                <packing>
1157                                  <property name="left_attach">0</property>
1158 -                                <property name="top_attach">8</property>
1159 +                                <property name="top_attach">9</property>
1160                                  <property name="width">1</property>
1161                                  <property name="height">1</property>
1162                                </packing>
1163 @@ -1039,9 +1116,36 @@
1164                                  <property name="height">1</property>
1165                                </packing>
1166                              </child>
1167 +                            <child>
1168 +                              <object class="GtkLabel" id="char-channel-label">
1169 +                                <property name="visible">True</property>
1170 +                                <property name="can_focus">False</property>
1171 +                                <property name="xalign">0</property>
1172 +                                <property name="label" translatable="yes">_Channel:</property>
1173 +                                <property name="use_underline">True</property>
1174 +                              </object>
1175 +                              <packing>
1176 +                                <property name="left_attach">0</property>
1177 +                                <property name="top_attach">5</property>
1178 +                                <property name="width">1</property>
1179 +                                <property name="height">1</property>
1180 +                              </packing>
1181 +                            </child>
1182 +                            <child>
1183 +                              <object class="GtkEntry" id="char-channel">
1184 +                                <property name="visible">True</property>
1185 +                                <property name="can_focus">True</property>
1186 +                              </object>
1187 +                              <packing>
1188 +                                <property name="left_attach">1</property>
1189 +                                <property name="top_attach">5</property>
1190 +                                <property name="width">1</property>
1191 +                                <property name="height">1</property>
1192 +                              </packing>
1193 +                            </child>
1194                            </object>
1195                            <packing>
1196 -                            <property name="position">7</property>
1197 +                            <property name="position">8</property>
1198                            </packing>
1199                          </child>
1200                          <child type="tab">
1201 @@ -1051,7 +1155,7 @@
1202                              <property name="label">char</property>
1203                            </object>
1204                            <packing>
1205 -                            <property name="position">7</property>
1206 +                            <property name="position">8</property>
1207                              <property name="tab_fill">False</property>
1208                            </packing>
1209                          </child>
1210 @@ -1090,7 +1194,7 @@
1211                              </child>
1212                            </object>
1213                            <packing>
1214 -                            <property name="position">8</property>
1215 +                            <property name="position">9</property>
1216                            </packing>
1217                          </child>
1218                          <child type="tab">
1219 @@ -1100,7 +1204,7 @@
1220                              <property name="label">vid</property>
1221                            </object>
1222                            <packing>
1223 -                            <property name="position">8</property>
1224 +                            <property name="position">9</property>
1225                              <property name="tab_fill">False</property>
1226                            </packing>
1227                          </child>
1228 @@ -1169,7 +1273,7 @@
1229                              </child>
1230                            </object>
1231                            <packing>
1232 -                            <property name="position">9</property>
1233 +                            <property name="position">10</property>
1234                            </packing>
1235                          </child>
1236                          <child type="tab">
1237 @@ -1179,7 +1283,7 @@
1238                              <property name="label">wdog</property>
1239                            </object>
1240                            <packing>
1241 -                            <property name="position">9</property>
1242 +                            <property name="position">10</property>
1243                              <property name="tab_fill">False</property>
1244                            </packing>
1245                          </child>
1246 @@ -1193,7 +1297,7 @@
1247                              </child>
1248                            </object>
1249                            <packing>
1250 -                            <property name="position">10</property>
1251 +                            <property name="position">11</property>
1252                            </packing>
1253                          </child>
1254                          <child type="tab">
1255 @@ -1203,7 +1307,7 @@
1256                              <property name="label">fs</property>
1257                            </object>
1258                            <packing>
1259 -                            <property name="position">10</property>
1260 +                            <property name="position">11</property>
1261                              <property name="tab_fill">False</property>
1262                            </packing>
1263                          </child>
1264 @@ -1242,7 +1346,7 @@
1265                              </child>
1266                            </object>
1267                            <packing>
1268 -                            <property name="position">11</property>
1269 +                            <property name="position">12</property>
1270                            </packing>
1271                          </child>
1272                          <child type="tab">
1273 @@ -1252,7 +1356,7 @@
1274                              <property name="label">sc</property>
1275                            </object>
1276                            <packing>
1277 -                            <property name="position">11</property>
1278 +                            <property name="position">12</property>
1279                              <property name="tab_fill">False</property>
1280                            </packing>
1281                          </child>
1282 @@ -1362,7 +1466,7 @@
1283                              </child>
1284                            </object>
1285                            <packing>
1286 -                            <property name="position">12</property>
1287 +                            <property name="position">13</property>
1288                            </packing>
1289                          </child>
1290                          <child type="tab">
1291 @@ -1372,7 +1476,7 @@
1292                              <property name="label">usbr</property>
1293                            </object>
1294                            <packing>
1295 -                            <property name="position">12</property>
1296 +                            <property name="position">13</property>
1297                              <property name="tab_fill">False</property>
1298                            </packing>
1299                          </child>
1300 @@ -1441,7 +1545,7 @@
1301                              </child>
1302                            </object>
1303                            <packing>
1304 -                            <property name="position">13</property>
1305 +                            <property name="position">14</property>
1306                            </packing>
1307                          </child>
1308                          <child type="tab">
1309 @@ -1451,7 +1555,7 @@
1310                              <property name="label">tpm</property>
1311                            </object>
1312                            <packing>
1313 -                            <property name="position">13</property>
1314 +                            <property name="position">14</property>
1315                              <property name="tab_fill">False</property>
1316                            </packing>
1317                          </child>
1318 @@ -1709,7 +1813,7 @@
1319                              </child>
1320                            </object>
1321                            <packing>
1322 -                            <property name="position">14</property>
1323 +                            <property name="position">15</property>
1324                            </packing>
1325                          </child>
1326                          <child type="tab">
1327 @@ -1719,7 +1823,7 @@
1328                              <property name="label" translatable="yes">rng</property>
1329                            </object>
1330                            <packing>
1331 -                            <property name="position">14</property>
1332 +                            <property name="position">15</property>
1333                              <property name="tab_fill">False</property>
1334                            </packing>
1335                          </child>
1336 @@ -1786,7 +1890,7 @@
1337                              </child>
1338                            </object>
1339                            <packing>
1340 -                            <property name="position">15</property>
1341 +                            <property name="position">16</property>
1342                            </packing>
1343                          </child>
1344                          <child type="tab">
1345 @@ -1796,7 +1900,7 @@
1346                              <property name="label" translatable="yes">panic</property>
1347                            </object>
1348                            <packing>
1349 -                            <property name="position">15</property>
1350 +                            <property name="position">16</property>
1351                              <property name="tab_fill">False</property>
1352                            </packing>
1353                          </child>
1354 diff -urN virt-manager-1.0.1/ui/connect.ui virt-manager/ui/connect.ui
1355 --- virt-manager-1.0.1/ui/connect.ui    2014-02-17 17:37:52.000000000 +0000
1356 +++ virt-manager/ui/connect.ui  2014-06-12 11:22:21.136891895 +0000
1357 @@ -259,6 +259,7 @@
1358                  <property name="xalign">0</property>
1359                  <property name="label" translatable="yes">H_ostname:</property>
1360                  <property name="use_underline">True</property>
1361 +                <property name="mnemonic_widget">hostname</property>
1362                </object>
1363                <packing>
1364                  <property name="left_attach">0</property>
1365 @@ -295,6 +296,7 @@
1366                  <property name="xalign">0</property>
1367                  <property name="label" translatable="yes">Me_thod:</property>
1368                  <property name="use_underline">True</property>
1369 +                <property name="mnemonic_widget">transport</property>
1370                </object>
1371                <packing>
1372                  <property name="left_attach">0</property>
1373 diff -urN virt-manager-1.0.1/ui/createinterface.ui virt-manager/ui/createinterface.ui
1374 --- virt-manager-1.0.1/ui/createinterface.ui    2014-02-17 17:37:52.000000000 +0000
1375 +++ virt-manager/ui/createinterface.ui  2014-06-12 11:22:21.137891895 +0000
1376 @@ -697,7 +697,9 @@
1377                          <property name="visible">True</property>
1378                          <property name="can_focus">False</property>
1379                          <property name="xalign">0</property>
1380 -                        <property name="label" translatable="yes">Forward delay:</property>
1381 +                        <property name="label" translatable="yes">Forward _delay:</property>
1382 +                        <property name="use_underline">True</property>
1383 +                        <property name="mnemonic_widget">bridge-delay</property>
1384                        </object>
1385                        <packing>
1386                          <property name="x_options">GTK_FILL</property>
1387 @@ -709,7 +711,9 @@
1388                          <property name="visible">True</property>
1389                          <property name="can_focus">False</property>
1390                          <property name="xalign">0</property>
1391 -                        <property name="label" translatable="yes">Enable STP:</property>
1392 +                        <property name="label" translatable="yes">Enable _STP:</property>
1393 +                        <property name="use_underline">True</property>
1394 +                        <property name="mnemonic_widget">bridge-stp</property>
1395                        </object>
1396                        <packing>
1397                          <property name="top_attach">1</property>
1398 @@ -1961,7 +1965,7 @@
1399                              </child>
1400                              <child>
1401                                <object class="GtkButton" id="ip-config-button">
1402 -                                <property name="label" translatable="yes">_Configure</property>
1403 +                                <property name="label" translatable="yes">Config_ure</property>
1404                                  <property name="visible">True</property>
1405                                  <property name="can_focus">True</property>
1406                                  <property name="receives_default">True</property>
1407 diff -urN virt-manager-1.0.1/ui/createnet.ui virt-manager/ui/createnet.ui
1408 --- virt-manager-1.0.1/ui/createnet.ui  2014-02-17 17:37:52.000000000 +0000
1409 +++ virt-manager/ui/createnet.ui        2014-06-12 11:22:21.138891895 +0000
1410 @@ -1,7 +1,7 @@
1411  <?xml version="1.0" encoding="UTF-8"?>
1412 -<!-- Generated with glade 3.15.4 on Fri Sep 27 13:35:57 2013 -->
1413 +<!-- Generated with glade 3.16.1 -->
1414  <interface>
1415 -  <!-- interface-requires gtk+ 3.0 -->
1416 +  <requires lib="gtk+" version="3.0"/>
1417    <object class="GtkImage" id="image2">
1418      <property name="visible">True</property>
1419      <property name="can_focus">False</property>
1420 @@ -152,12 +152,12 @@
1421                                  <property name="width_chars">25</property>
1422                                  <property name="primary_icon_activatable">False</property>
1423                                  <property name="secondary_icon_activatable">False</property>
1424 +                                <signal name="activate" handler="on_net_name_activate" swapped="no"/>
1425                                  <child internal-child="accessible">
1426                                    <object class="AtkObject" id="net-name-atkobject">
1427                                      <property name="AtkObject::accessible-name" translatable="yes">Net Name Field</property>
1428                                    </object>
1429                                  </child>
1430 -                                <signal name="activate" handler="on_net_name_activate" swapped="no"/>
1431                                </object>
1432                                <packing>
1433                                  <property name="left_attach">1</property>
1434 @@ -1251,7 +1251,7 @@
1435                                              <property name="xalign">1</property>
1436                                              <property name="label" translatable="yes">_Destination:</property>
1437                                              <property name="use_underline">True</property>
1438 -                                            <property name="mnemonic_widget">net-forward-dev</property>
1439 +                                            <property name="mnemonic_widget">net-forward</property>
1440                                            </object>
1441                                            <packing>
1442                                              <property name="left_attach">0</property>
1443 @@ -1268,6 +1268,7 @@
1444                                              <property name="xalign">1</property>
1445                                              <property name="label" translatable="yes">_Mode:</property>
1446                                              <property name="use_underline">True</property>
1447 +                                            <property name="mnemonic_widget">net-forward-mode</property>
1448                                            </object>
1449                                            <packing>
1450                                              <property name="left_attach">0</property>
1451 diff -urN virt-manager-1.0.1/ui/createpool.ui virt-manager/ui/createpool.ui
1452 --- virt-manager-1.0.1/ui/createpool.ui 2014-02-17 17:37:52.000000000 +0000
1453 +++ virt-manager/ui/createpool.ui       2014-06-12 11:22:21.138891895 +0000
1454 @@ -216,6 +216,7 @@
1455                              <property name="xalign">1</property>
1456                              <property name="label" translatable="yes">B_uild Pool:</property>
1457                              <property name="use_underline">True</property>
1458 +                            <property name="mnemonic_widget">pool-build</property>
1459                            </object>
1460                            <packing>
1461                              <property name="left_attach">0</property>
1462 @@ -272,6 +273,7 @@
1463                              <property name="xalign">1</property>
1464                              <property name="label" translatable="yes">_Target Path:</property>
1465                              <property name="use_underline">True</property>
1466 +                            <property name="mnemonic_widget">pool-target-path</property>
1467                            </object>
1468                            <packing>
1469                              <property name="left_attach">0</property>
1470 @@ -287,6 +289,7 @@
1471                              <property name="xalign">1</property>
1472                              <property name="label" translatable="yes">F_ormat:</property>
1473                              <property name="use_underline">True</property>
1474 +                            <property name="mnemonic_widget">pool-format</property>
1475                            </object>
1476                            <packing>
1477                              <property name="left_attach">0</property>
1478 @@ -302,6 +305,7 @@
1479                              <property name="xalign">1</property>
1480                              <property name="label" translatable="yes">Host Na_me:</property>
1481                              <property name="use_underline">True</property>
1482 +                            <property name="mnemonic_widget">pool-hostname</property>
1483                            </object>
1484                            <packing>
1485                              <property name="left_attach">0</property>
1486 @@ -315,8 +319,9 @@
1487                              <property name="visible">True</property>
1488                              <property name="can_focus">False</property>
1489                              <property name="xalign">1</property>
1490 -                            <property name="label" translatable="yes">_Source Path:</property>
1491 +                            <property name="label" translatable="yes">sourcep:</property>
1492                              <property name="use_underline">True</property>
1493 +                            <property name="mnemonic_widget">pool-source-path</property>
1494                            </object>
1495                            <packing>
1496                              <property name="left_attach">0</property>
1497 @@ -330,7 +335,7 @@
1498                              <property name="visible">True</property>
1499                              <property name="can_focus">False</property>
1500                              <property name="xalign">1</property>
1501 -                            <property name="label" translatable="yes">_IQN:</property>
1502 +                            <property name="label" translatable="yes">Initiator _IQN:</property>
1503                              <property name="use_underline">True</property>
1504                              <property name="mnemonic_widget">pool-iqn-chk</property>
1505                            </object>
1506 @@ -463,8 +468,9 @@
1507                              <property name="visible">True</property>
1508                              <property name="can_focus">False</property>
1509                              <property name="xalign">1</property>
1510 -                            <property name="label" translatable="yes">_Source Name:</property>
1511 +                            <property name="label" translatable="yes">Source _Name:</property>
1512                              <property name="use_underline">True</property>
1513 +                            <property name="mnemonic_widget">pool-source-name</property>
1514                            </object>
1515                            <packing>
1516                              <property name="left_attach">0</property>
1517 diff -urN virt-manager-1.0.1/ui/create.ui virt-manager/ui/create.ui
1518 --- virt-manager-1.0.1/ui/create.ui     2014-02-17 17:37:52.000000000 +0000
1519 +++ virt-manager/ui/create.ui   2014-06-12 11:22:21.137891895 +0000
1520 @@ -1676,21 +1676,6 @@
1521                                        </packing>
1522                                      </child>
1523                                      <child>
1524 -                                      <object class="GtkComboBox" id="install-os-version">
1525 -                                        <property name="visible">True</property>
1526 -                                        <property name="can_focus">False</property>
1527 -                                        <signal name="changed" handler="on_install_os_version_changed" swapped="no"/>
1528 -                                      </object>
1529 -                                      <packing>
1530 -                                        <property name="left_attach">1</property>
1531 -                                        <property name="right_attach">2</property>
1532 -                                        <property name="top_attach">1</property>
1533 -                                        <property name="bottom_attach">2</property>
1534 -                                        <property name="x_options">GTK_FILL</property>
1535 -                                        <property name="y_options"/>
1536 -                                      </packing>
1537 -                                    </child>
1538 -                                    <child>
1539                                        <object class="GtkComboBox" id="install-os-type">
1540                                          <property name="visible">True</property>
1541                                          <property name="can_focus">False</property>
1542 @@ -1732,6 +1717,27 @@
1543                                          <property name="x_options">GTK_FILL</property>
1544                                          <property name="y_options"/>
1545                                        </packing>
1546 +                                    </child>
1547 +                                    <child>
1548 +                                      <object class="GtkComboBox" id="install-os-version">
1549 +                                        <property name="visible">True</property>
1550 +                                        <property name="can_focus">False</property>
1551 +                                        <property name="has_entry">True</property>
1552 +                                        <signal name="changed" handler="on_install_os_version_changed" swapped="no"/>
1553 +                                        <child internal-child="entry">
1554 +                                          <object class="GtkEntry" id="install-os-version-entry">
1555 +                                            <property name="can_focus">True</property>
1556 +                                          </object>
1557 +                                        </child>
1558 +                                      </object>
1559 +                                      <packing>
1560 +                                        <property name="left_attach">1</property>
1561 +                                        <property name="right_attach">2</property>
1562 +                                        <property name="top_attach">1</property>
1563 +                                        <property name="bottom_attach">2</property>
1564 +                                        <property name="x_options">GTK_FILL</property>
1565 +                                        <property name="y_options"/>
1566 +                                      </packing>
1567                                      </child>
1568                                    </object>
1569                                  </child>
1570 diff -urN virt-manager-1.0.1/ui/createvol.ui virt-manager/ui/createvol.ui
1571 --- virt-manager-1.0.1/ui/createvol.ui  2014-02-17 17:37:52.000000000 +0000
1572 +++ virt-manager/ui/createvol.ui        2014-06-12 11:22:21.138891895 +0000
1573 @@ -1,7 +1,7 @@
1574  <?xml version="1.0" encoding="UTF-8"?>
1575 -<!-- Generated with glade 3.16.0 on Tue Oct  1 14:33:00 2013 -->
1576 +<!-- Generated with glade 3.16.1 -->
1577  <interface>
1578 -  <!-- interface-requires gtk+ 3.0 -->
1579 +  <requires lib="gtk+" version="3.0"/>
1580    <object class="GtkAdjustment" id="adjustment1">
1581      <property name="upper">100000</property>
1582      <property name="value">1</property>
1583 @@ -209,7 +209,7 @@
1584                                  <property name="visible">True</property>
1585                                  <property name="can_focus">False</property>
1586                                  <property name="xalign">0</property>
1587 -                                <property name="label" translatable="yes">_Format:</property>
1588 +                                <property name="label" translatable="yes">F_ormat:</property>
1589                                  <property name="use_underline">True</property>
1590                                  <property name="mnemonic_widget">vol-format</property>
1591                                </object>
1592 diff -urN virt-manager-1.0.1/ui/details.ui virt-manager/ui/details.ui
1593 --- virt-manager-1.0.1/ui/details.ui    2014-03-19 11:57:24.000000000 +0000
1594 +++ virt-manager/ui/details.ui  2014-06-12 11:22:21.146891895 +0000
1595 @@ -1,7 +1,7 @@
1596  <?xml version="1.0" encoding="UTF-8"?>
1597 -<!-- Generated with glade 3.16.0 on Mon Feb 24 22:09:46 2014 -->
1598 +<!-- Generated with glade 3.16.1 -->
1599  <interface>
1600 -  <!-- interface-requires gtk+ 3.0 -->
1601 +  <requires lib="gtk+" version="3.0"/>
1602    <object class="GtkAccelGroup" id="accelgroup1"/>
1603    <object class="GtkAdjustment" id="adjustment1">
1604      <property name="lower">1</property>
1605 @@ -1018,6 +1018,118 @@
1606                                              <property name="height">1</property>
1607                                            </packing>
1608                                          </child>
1609 +                                        <child>
1610 +                                          <object class="GtkLabel" id="overview-chipset-title">
1611 +                                            <property name="visible">True</property>
1612 +                                            <property name="can_focus">False</property>
1613 +                                            <property name="margin_top">2</property>
1614 +                                            <property name="xalign">1</property>
1615 +                                            <property name="yalign">0</property>
1616 +                                            <property name="label" translatable="yes">Chipse_t:</property>
1617 +                                            <property name="use_underline">True</property>
1618 +                                            <property name="ellipsize">middle</property>
1619 +                                          </object>
1620 +                                          <packing>
1621 +                                            <property name="left_attach">0</property>
1622 +                                            <property name="top_attach">4</property>
1623 +                                            <property name="width">1</property>
1624 +                                            <property name="height">1</property>
1625 +                                          </packing>
1626 +                                        </child>
1627 +                                        <child>
1628 +                                          <object class="GtkGrid" id="grid4">
1629 +                                            <property name="visible">True</property>
1630 +                                            <property name="can_focus">False</property>
1631 +                                            <property name="row_spacing">3</property>
1632 +                                            <child>
1633 +                                              <object class="GtkBox" id="overview-chipset-warn-box">
1634 +                                                <property name="can_focus">False</property>
1635 +                                                <property name="spacing">6</property>
1636 +                                                <child>
1637 +                                                  <object class="GtkImage" id="image3">
1638 +                                                    <property name="visible">True</property>
1639 +                                                    <property name="can_focus">False</property>
1640 +                                                    <property name="halign">start</property>
1641 +                                                    <property name="hexpand">False</property>
1642 +                                                    <property name="yalign">0</property>
1643 +                                                    <property name="stock">gtk-dialog-warning</property>
1644 +                                                  </object>
1645 +                                                  <packing>
1646 +                                                    <property name="expand">False</property>
1647 +                                                    <property name="fill">True</property>
1648 +                                                    <property name="position">0</property>
1649 +                                                  </packing>
1650 +                                                </child>
1651 +                                                <child>
1652 +                                                  <object class="GtkLabel" id="overview-chipset-warn">
1653 +                                                    <property name="visible">True</property>
1654 +                                                    <property name="can_focus">False</property>
1655 +                                                    <property name="label" translatable="yes">&lt;small&gt;Q35 is not the default chipset and has received far less testing.
1656 +Once this change is made it is difficult to go back. Only use this
1657 +if you know what you are doing.&lt;/small&gt;</property>
1658 +                                                    <property name="use_markup">True</property>
1659 +                                                  </object>
1660 +                                                  <packing>
1661 +                                                    <property name="expand">False</property>
1662 +                                                    <property name="fill">True</property>
1663 +                                                    <property name="position">1</property>
1664 +                                                  </packing>
1665 +                                                </child>
1666 +                                              </object>
1667 +                                              <packing>
1668 +                                                <property name="left_attach">0</property>
1669 +                                                <property name="top_attach">1</property>
1670 +                                                <property name="width">1</property>
1671 +                                                <property name="height">1</property>
1672 +                                              </packing>
1673 +                                            </child>
1674 +                                            <child>
1675 +                                              <object class="GtkBox" id="overview-chipset-box">
1676 +                                                <property name="visible">True</property>
1677 +                                                <property name="can_focus">False</property>
1678 +                                                <child>
1679 +                                                  <object class="GtkComboBoxText" id="overview-chipset">
1680 +                                                    <property name="visible">True</property>
1681 +                                                    <property name="can_focus">False</property>
1682 +                                                    <property name="halign">start</property>
1683 +                                                    <property name="hexpand">False</property>
1684 +                                                    <signal name="changed" handler="on_overview_chipset_changed" swapped="no"/>
1685 +                                                  </object>
1686 +                                                  <packing>
1687 +                                                    <property name="expand">False</property>
1688 +                                                    <property name="fill">True</property>
1689 +                                                    <property name="position">0</property>
1690 +                                                  </packing>
1691 +                                                </child>
1692 +                                                <child>
1693 +                                                  <object class="GtkLabel" id="overview-chipset-label">
1694 +                                                    <property name="visible">True</property>
1695 +                                                    <property name="can_focus">False</property>
1696 +                                                    <property name="xalign">0</property>
1697 +                                                    <property name="label">label</property>
1698 +                                                  </object>
1699 +                                                  <packing>
1700 +                                                    <property name="expand">False</property>
1701 +                                                    <property name="fill">True</property>
1702 +                                                    <property name="position">1</property>
1703 +                                                  </packing>
1704 +                                                </child>
1705 +                                              </object>
1706 +                                              <packing>
1707 +                                                <property name="left_attach">0</property>
1708 +                                                <property name="top_attach">0</property>
1709 +                                                <property name="width">1</property>
1710 +                                                <property name="height">1</property>
1711 +                                              </packing>
1712 +                                            </child>
1713 +                                          </object>
1714 +                                          <packing>
1715 +                                            <property name="left_attach">1</property>
1716 +                                            <property name="top_attach">4</property>
1717 +                                            <property name="width">1</property>
1718 +                                            <property name="height">1</property>
1719 +                                          </packing>
1720 +                                        </child>
1721                                        </object>
1722                                      </child>
1723                                    </object>
1724 @@ -1919,12 +2031,12 @@
1725                                                  <property name="climb_rate">1</property>
1726                                                  <property name="numeric">True</property>
1727                                                  <property name="update_policy">if-valid</property>
1728 +                                                <signal name="changed" handler="on_config_vcpus_changed" swapped="no"/>
1729                                                  <child internal-child="accessible">
1730                                                    <object class="AtkObject" id="config-vcpus-atkobject">
1731                                                      <property name="AtkObject::accessible-name" translatable="yes">Virtual CPU Select</property>
1732                                                    </object>
1733                                                  </child>
1734 -                                                <signal name="changed" handler="on_config_vcpus_changed" swapped="no"/>
1735                                                </object>
1736                                                <packing>
1737                                                  <property name="left_attach">1</property>
1738 @@ -2319,12 +2431,12 @@
1739                                                      <property name="visible">True</property>
1740                                                      <property name="can_focus">True</property>
1741                                                      <property name="invisible_char">●</property>
1742 +                                                    <signal name="changed" handler="on_config_vcpupin_changed" swapped="no"/>
1743                                                      <child internal-child="accessible">
1744                                                        <object class="AtkObject" id="config-vcpupin-atkobject">
1745                                                          <property name="AtkObject::accessible-name" translatable="yes">Virtual CPU Affinity Select</property>
1746                                                        </object>
1747                                                      </child>
1748 -                                                    <signal name="changed" handler="on_config_vcpupin_changed" swapped="no"/>
1749                                                    </object>
1750                                                    <packing>
1751                                                      <property name="expand">False</property>
1752 @@ -2553,12 +2665,12 @@
1753                                                  <property name="climb_rate">2</property>
1754                                                  <property name="numeric">True</property>
1755                                                  <property name="update_policy">if-valid</property>
1756 +                                                <signal name="changed" handler="on_config_memory_changed" swapped="no"/>
1757                                                  <child internal-child="accessible">
1758                                                    <object class="AtkObject" id="config-memory-atkobject">
1759                                                      <property name="AtkObject::accessible-name" translatable="yes">Memory Select</property>
1760                                                    </object>
1761                                                  </child>
1762 -                                                <signal name="changed" handler="on_config_memory_changed" swapped="no"/>
1763                                                </object>
1764                                                <packing>
1765                                                  <property name="expand">False</property>
1766 @@ -2602,12 +2714,12 @@
1767                                                  <property name="climb_rate">2</property>
1768                                                  <property name="numeric">True</property>
1769                                                  <property name="update_policy">if-valid</property>
1770 +                                                <signal name="changed" handler="on_config_maxmem_changed" swapped="no"/>
1771                                                  <child internal-child="accessible">
1772                                                    <object class="AtkObject" id="config-maxmem-atkobject">
1773                                                      <property name="AtkObject::accessible-name" translatable="yes">Max Memory Select</property>
1774                                                    </object>
1775                                                  </child>
1776 -                                                <signal name="changed" handler="on_config_maxmem_changed" swapped="no"/>
1777                                                </object>
1778                                                <packing>
1779                                                  <property name="expand">False</property>
1780 @@ -2733,34 +2845,68 @@
1781                                      <property name="top_padding">3</property>
1782                                      <property name="left_padding">12</property>
1783                                      <child>
1784 -                                      <object class="GtkHBox" id="boot-init-path-box">
1785 +                                      <object class="GtkGrid" id="grid3">
1786                                          <property name="visible">True</property>
1787                                          <property name="can_focus">False</property>
1788 -                                        <property name="spacing">12</property>
1789 +                                        <property name="row_spacing">6</property>
1790 +                                        <property name="column_spacing">6</property>
1791 +                                        <child>
1792 +                                          <object class="GtkEntry" id="boot-init-path">
1793 +                                            <property name="visible">True</property>
1794 +                                            <property name="can_focus">True</property>
1795 +                                            <property name="invisible_char">●</property>
1796 +                                            <property name="width_chars">25</property>
1797 +                                            <signal name="changed" handler="on_boot_init_path_changed" swapped="no"/>
1798 +                                          </object>
1799 +                                          <packing>
1800 +                                            <property name="left_attach">1</property>
1801 +                                            <property name="top_attach">0</property>
1802 +                                            <property name="width">1</property>
1803 +                                            <property name="height">1</property>
1804 +                                          </packing>
1805 +                                        </child>
1806                                          <child>
1807                                            <object class="GtkLabel" id="label69">
1808                                              <property name="visible">True</property>
1809                                              <property name="can_focus">False</property>
1810 -                                            <property name="label" translatable="yes">Init path:</property>
1811 +                                            <property name="label" translatable="yes">Init _path:</property>
1812 +                                            <property name="use_underline">True</property>
1813 +                                            <property name="mnemonic_widget">boot-init-path</property>
1814                                            </object>
1815                                            <packing>
1816 -                                            <property name="expand">False</property>
1817 -                                            <property name="fill">True</property>
1818 -                                            <property name="position">0</property>
1819 +                                            <property name="left_attach">0</property>
1820 +                                            <property name="top_attach">0</property>
1821 +                                            <property name="width">1</property>
1822 +                                            <property name="height">1</property>
1823                                            </packing>
1824                                          </child>
1825                                          <child>
1826 -                                          <object class="GtkEntry" id="boot-init-path">
1827 +                                          <object class="GtkLabel" id="label64">
1828 +                                            <property name="visible">True</property>
1829 +                                            <property name="can_focus">False</property>
1830 +                                            <property name="label" translatable="yes">Init ar_gs:</property>
1831 +                                            <property name="use_underline">True</property>
1832 +                                            <property name="mnemonic_widget">boot-init-args</property>
1833 +                                          </object>
1834 +                                          <packing>
1835 +                                            <property name="left_attach">0</property>
1836 +                                            <property name="top_attach">1</property>
1837 +                                            <property name="width">1</property>
1838 +                                            <property name="height">1</property>
1839 +                                          </packing>
1840 +                                        </child>
1841 +                                        <child>
1842 +                                          <object class="GtkEntry" id="boot-init-args">
1843                                              <property name="visible">True</property>
1844                                              <property name="can_focus">True</property>
1845 -                                            <property name="invisible_char">●</property>
1846                                              <property name="width_chars">25</property>
1847 -                                            <signal name="changed" handler="on_boot_init_path_changed" swapped="no"/>
1848 +                                            <signal name="changed" handler="on_boot_init_args_changed" swapped="no"/>
1849                                            </object>
1850                                            <packing>
1851 -                                            <property name="expand">False</property>
1852 -                                            <property name="fill">True</property>
1853 -                                            <property name="position">1</property>
1854 +                                            <property name="left_attach">1</property>
1855 +                                            <property name="top_attach">1</property>
1856 +                                            <property name="width">1</property>
1857 +                                            <property name="height">1</property>
1858                                            </packing>
1859                                          </child>
1860                                        </object>
1861 @@ -3517,6 +3663,8 @@
1862                                                          <property name="visible">True</property>
1863                                                          <property name="can_focus">False</property>
1864                                                          <property name="xalign">1</property>
1865 +                                                        <property name="yalign">0</property>
1866 +                                                        <property name="ypad">4</property>
1867                                                          <property name="label" translatable="yes">Storage forma_t:</property>
1868                                                          <property name="use_underline">True</property>
1869                                                        </object>
1870 @@ -3558,25 +3706,6 @@
1871                                                        </packing>
1872                                                      </child>
1873                                                      <child>
1874 -                                                      <object class="GtkComboBox" id="disk-format">
1875 -                                                        <property name="visible">True</property>
1876 -                                                        <property name="can_focus">False</property>
1877 -                                                        <property name="has_entry">True</property>
1878 -                                                        <signal name="changed" handler="on_disk_format_changed" swapped="no"/>
1879 -                                                        <child internal-child="entry">
1880 -                                                          <object class="GtkEntry" id="combobox-entry9">
1881 -                                                            <property name="can_focus">True</property>
1882 -                                                          </object>
1883 -                                                        </child>
1884 -                                                      </object>
1885 -                                                      <packing>
1886 -                                                        <property name="left_attach">1</property>
1887 -                                                        <property name="top_attach">2</property>
1888 -                                                        <property name="width">1</property>
1889 -                                                        <property name="height">1</property>
1890 -                                                      </packing>
1891 -                                                    </child>
1892 -                                                    <child>
1893                                                        <object class="GtkComboBox" id="disk-bus">
1894                                                          <property name="visible">True</property>
1895                                                          <property name="can_focus">False</property>
1896 @@ -3610,6 +3739,77 @@
1897                                                          <property name="height">1</property>
1898                                                        </packing>
1899                                                      </child>
1900 +                                                    <child>
1901 +                                                      <object class="GtkBox" id="box15">
1902 +                                                        <property name="visible">True</property>
1903 +                                                        <property name="can_focus">False</property>
1904 +                                                        <property name="orientation">vertical</property>
1905 +                                                        <property name="spacing">6</property>
1906 +                                                        <child>
1907 +                                                          <object class="GtkComboBox" id="disk-format">
1908 +                                                            <property name="visible">True</property>
1909 +                                                            <property name="can_focus">False</property>
1910 +                                                            <property name="has_entry">True</property>
1911 +                                                            <signal name="changed" handler="on_disk_format_changed" swapped="no"/>
1912 +                                                            <child internal-child="entry">
1913 +                                                            <object class="GtkEntry" id="combobox-entry9">
1914 +                                                            <property name="can_focus">True</property>
1915 +                                                            </object>
1916 +                                                            </child>
1917 +                                                          </object>
1918 +                                                          <packing>
1919 +                                                            <property name="expand">False</property>
1920 +                                                            <property name="fill">True</property>
1921 +                                                            <property name="position">0</property>
1922 +                                                          </packing>
1923 +                                                        </child>
1924 +                                                        <child>
1925 +                                                          <object class="GtkBox" id="disk-format-warn">
1926 +                                                            <property name="visible">True</property>
1927 +                                                            <property name="can_focus">False</property>
1928 +                                                            <property name="spacing">3</property>
1929 +                                                            <child>
1930 +                                                            <object class="GtkImage" id="image2">
1931 +                                                            <property name="visible">True</property>
1932 +                                                            <property name="can_focus">False</property>
1933 +                                                            <property name="stock">gtk-dialog-warning</property>
1934 +                                                            </object>
1935 +                                                            <packing>
1936 +                                                            <property name="expand">False</property>
1937 +                                                            <property name="fill">True</property>
1938 +                                                            <property name="position">0</property>
1939 +                                                            </packing>
1940 +                                                            </child>
1941 +                                                            <child>
1942 +                                                            <object class="GtkLabel" id="label34">
1943 +                                                            <property name="visible">True</property>
1944 +                                                            <property name="can_focus">False</property>
1945 +                                                            <property name="label" translatable="yes">&lt;small&gt;Changing this will not change the disk image format, it only tells libvirt about the existing image format. &lt;/small&gt;</property>
1946 +                                                            <property name="use_markup">True</property>
1947 +                                                            <property name="wrap">True</property>
1948 +                                                            <property name="max_width_chars">30</property>
1949 +                                                            </object>
1950 +                                                            <packing>
1951 +                                                            <property name="expand">False</property>
1952 +                                                            <property name="fill">False</property>
1953 +                                                            <property name="position">1</property>
1954 +                                                            </packing>
1955 +                                                            </child>
1956 +                                                          </object>
1957 +                                                          <packing>
1958 +                                                            <property name="expand">False</property>
1959 +                                                            <property name="fill">True</property>
1960 +                                                            <property name="position">1</property>
1961 +                                                          </packing>
1962 +                                                        </child>
1963 +                                                      </object>
1964 +                                                      <packing>
1965 +                                                        <property name="left_attach">1</property>
1966 +                                                        <property name="top_attach">2</property>
1967 +                                                        <property name="width">1</property>
1968 +                                                        <property name="height">1</property>
1969 +                                                      </packing>
1970 +                                                    </child>
1971                                                    </object>
1972                                                    <packing>
1973                                                      <property name="expand">False</property>
1974 @@ -4208,14 +4408,12 @@
1975                                      <property name="top_padding">3</property>
1976                                      <property name="left_padding">12</property>
1977                                      <child>
1978 -                                      <object class="GtkTable" id="table33">
1979 +                                      <object class="GtkGrid" id="table33">
1980                                          <property name="visible">True</property>
1981                                          <property name="can_focus">False</property>
1982                                          <property name="border_width">3</property>
1983 -                                        <property name="n_rows">2</property>
1984 -                                        <property name="n_columns">2</property>
1985 -                                        <property name="column_spacing">8</property>
1986                                          <property name="row_spacing">4</property>
1987 +                                        <property name="column_spacing">8</property>
1988                                          <child>
1989                                            <object class="GtkLabel" id="label402">
1990                                              <property name="visible">True</property>
1991 @@ -4225,8 +4423,10 @@
1992                                              <property name="use_underline">True</property>
1993                                            </object>
1994                                            <packing>
1995 -                                            <property name="x_options">GTK_FILL</property>
1996 -                                            <property name="y_options"/>
1997 +                                            <property name="left_attach">0</property>
1998 +                                            <property name="top_attach">0</property>
1999 +                                            <property name="width">1</property>
2000 +                                            <property name="height">1</property>
2001                                            </packing>
2002                                          </child>
2003                                          <child>
2004 @@ -4237,10 +4437,10 @@
2005                                              <property name="label" translatable="yes">Mode:</property>
2006                                            </object>
2007                                            <packing>
2008 +                                            <property name="left_attach">0</property>
2009                                              <property name="top_attach">1</property>
2010 -                                            <property name="bottom_attach">2</property>
2011 -                                            <property name="x_options">GTK_FILL</property>
2012 -                                            <property name="y_options"/>
2013 +                                            <property name="width">1</property>
2014 +                                            <property name="height">1</property>
2015                                            </packing>
2016                                          </child>
2017                                          <child>
2018 @@ -4253,11 +4453,9 @@
2019                                            </object>
2020                                            <packing>
2021                                              <property name="left_attach">1</property>
2022 -                                            <property name="right_attach">2</property>
2023                                              <property name="top_attach">1</property>
2024 -                                            <property name="bottom_attach">2</property>
2025 -                                            <property name="x_options">GTK_FILL</property>
2026 -                                            <property name="y_options"/>
2027 +                                            <property name="width">1</property>
2028 +                                            <property name="height">1</property>
2029                                            </packing>
2030                                          </child>
2031                                          <child>
2032 @@ -4270,8 +4468,9 @@
2033                                            </object>
2034                                            <packing>
2035                                              <property name="left_attach">1</property>
2036 -                                            <property name="right_attach">2</property>
2037 -                                            <property name="y_options"/>
2038 +                                            <property name="top_attach">0</property>
2039 +                                            <property name="width">1</property>
2040 +                                            <property name="height">1</property>
2041                                            </packing>
2042                                          </child>
2043                                        </object>
2044 diff -urN virt-manager-1.0.1/ui/netlist.ui virt-manager/ui/netlist.ui
2045 --- virt-manager-1.0.1/ui/netlist.ui    2014-03-10 15:17:58.000000000 +0000
2046 +++ virt-manager/ui/netlist.ui  2014-06-12 11:22:21.149891895 +0000
2047 @@ -96,7 +96,7 @@
2048        </object>
2049        <packing>
2050          <property name="left_attach">0</property>
2051 -        <property name="top_attach">3</property>
2052 +        <property name="top_attach">4</property>
2053          <property name="width">2</property>
2054          <property name="height">1</property>
2055        </packing>
2056 @@ -111,7 +111,7 @@
2057          <signal name="changed" handler="on_net_source_mode_changed" swapped="no"/>
2058          <child internal-child="entry">
2059            <object class="GtkEntry" id="combobox-entry">
2060 -            <property name="can_focus">False</property>
2061 +            <property name="can_focus">True</property>
2062            </object>
2063          </child>
2064        </object>
2065 @@ -161,6 +161,45 @@
2066          <property name="height">1</property>
2067        </packing>
2068      </child>
2069 +    <child>
2070 +      <object class="GtkLabel" id="label3">
2071 +        <property name="visible">True</property>
2072 +        <property name="can_focus">False</property>
2073 +        <property name="halign">start</property>
2074 +        <property name="hexpand">False</property>
2075 +        <property name="xalign">0</property>
2076 +        <property name="label" translatable="yes">_Portgroup:</property>
2077 +        <property name="use_underline">True</property>
2078 +        <property name="mnemonic_widget">net-portgroup</property>
2079 +      </object>
2080 +      <packing>
2081 +        <property name="left_attach">0</property>
2082 +        <property name="top_attach">3</property>
2083 +        <property name="width">1</property>
2084 +        <property name="height">1</property>
2085 +      </packing>
2086 +    </child>
2087 +    <child>
2088 +      <object class="GtkComboBox" id="net-portgroup">
2089 +        <property name="visible">True</property>
2090 +        <property name="can_focus">False</property>
2091 +        <property name="halign">start</property>
2092 +        <property name="hexpand">True</property>
2093 +        <property name="has_entry">True</property>
2094 +        <signal name="changed" handler="on_net_portgroup_changed" swapped="no"/>
2095 +        <child internal-child="entry">
2096 +          <object class="GtkEntry" id="combobox-entry2">
2097 +            <property name="can_focus">True</property>
2098 +          </object>
2099 +        </child>
2100 +      </object>
2101 +      <packing>
2102 +        <property name="left_attach">1</property>
2103 +        <property name="top_attach">3</property>
2104 +        <property name="width">1</property>
2105 +        <property name="height">1</property>
2106 +      </packing>
2107 +    </child>
2108    </object>
2109    <object class="GtkLabel" id="net-source-label">
2110      <property name="visible">True</property>
2111 diff -urN virt-manager-1.0.1/ui/preferences.ui virt-manager/ui/preferences.ui
2112 --- virt-manager-1.0.1/ui/preferences.ui        2014-02-17 17:37:52.000000000 +0000
2113 +++ virt-manager/ui/preferences.ui      2014-06-12 11:22:21.149891895 +0000
2114 @@ -880,6 +880,7 @@
2115                              <property name="xalign">0</property>
2116                              <property name="label" translatable="yes">_Interface start/stop:</property>
2117                              <property name="use_underline">True</property>
2118 +                            <property name="mnemonic_widget">prefs-confirm-interface</property>
2119                            </object>
2120                            <packing>
2121                              <property name="left_attach">0</property>
2122 diff -urN virt-manager-1.0.1/virtcli/cliconfig.py virt-manager/virtcli/cliconfig.py
2123 --- virt-manager-1.0.1/virtcli/cliconfig.py     2014-03-22 22:37:44.000000000 +0000
2124 +++ virt-manager/virtcli/cliconfig.py   2014-06-12 11:22:21.168891895 +0000
2125 @@ -53,9 +53,15 @@
2126      schema and use it directly
2127      """
2128      import subprocess
2129 +    from distutils.spawn import find_executable
2130 +
2131 +    exe = find_executable("glib-compile-schemas")
2132 +    if not exe:
2133 +        raise RuntimeError("You must install glib-compile-schemas to run "
2134 +            "virt-manager from git.")
2135  
2136      os.environ["GSETTINGS_SCHEMA_DIR"] = schemadir
2137 -    ret = subprocess.call(["glib-compile-schemas", "--strict", schemadir])
2138 +    ret = subprocess.call([exe, "--strict", schemadir])
2139      if ret != 0:
2140          raise RuntimeError("Failed to compile local gsettings schemas")
2141  
2142 @@ -88,3 +94,4 @@
2143  askpass_package = _split_list(_get_param("askpass_packages", ""))
2144  libvirt_packages = _split_list(_get_param("libvirt_packages", ""))
2145  default_graphics = _get_param("default_graphics", "spice")
2146 +with_bhyve = bool(int(_get_param("with_bhyve", "0")))
2147 diff -urN virt-manager-1.0.1/virt-clone virt-manager/virt-clone
2148 --- virt-manager-1.0.1/virt-clone       2014-03-22 16:27:02.000000000 +0000
2149 +++ virt-manager/virt-clone     2014-06-12 11:22:21.150891895 +0000
2150 @@ -31,7 +31,7 @@
2151  from virtinst.cli import fail, print_stdout, print_stderr
2152  
2153  
2154 -### General input gathering functions
2155 +# General input gathering functions
2156  def get_clone_name(new_name, auto_clone, design):
2157      if not new_name and auto_clone:
2158          # Generate a name to use
2159 diff -urN virt-manager-1.0.1/virtconv/formats.py virt-manager/virtconv/formats.py
2160 --- virt-manager-1.0.1/virtconv/formats.py      2014-03-06 17:51:59.000000000 +0000
2161 +++ virt-manager/virtconv/formats.py    2014-06-12 11:22:21.168891895 +0000
2162 @@ -174,16 +174,18 @@
2163      """
2164      Public interface for actually performing the conversion
2165      """
2166 -    def __init__(self, conn, input_file, print_cb=None, input_name=None):
2167 +    def __init__(self, conn, input_file, print_cb=-1, input_name=None):
2168          self.conn = conn
2169          self._err_clean = []
2170          self._force_clean = []
2171  
2172 -        if print_cb is None:
2173 +        if print_cb == -1 or print_cb is None:
2174              def cb(msg):
2175 -                print msg
2176 -            print_cb = cb
2177 -        self.print_cb = print_cb
2178 +                if print_cb == -1:
2179 +                    print msg
2180 +            self.print_cb = cb
2181 +        else:
2182 +            self.print_cb = print_cb
2183  
2184          parser = None
2185          if input_name:
2186 @@ -195,7 +197,7 @@
2187          (self._input_file,
2188           self.parser,
2189           self._force_clean) = _find_input(input_file, parser, self.print_cb)
2190 -        self._top_dir = os.path.dirname(self._input_file)
2191 +        self._top_dir = os.path.dirname(os.path.abspath(self._input_file))
2192  
2193          logging.debug("converter not input_file=%s parser=%s",
2194              self._input_file, self.parser)
2195 @@ -270,7 +272,7 @@
2196              disk_format = None
2197  
2198          if destdir is None:
2199 -            destdir = StoragePool.get_default_path(self.conn)
2200 +            destdir = StoragePool.get_default_path(self.conn, build=not dry)
2201  
2202          guest = self.get_guest()
2203          for disk in guest.get_devices("disk"):
2204 diff -urN virt-manager-1.0.1/virtconv/ovf.py virt-manager/virtconv/ovf.py
2205 --- virt-manager-1.0.1/virtconv/ovf.py  2014-02-17 17:37:52.000000000 +0000
2206 +++ virt-manager/virtconv/ovf.py        2014-06-12 11:22:21.168891895 +0000
2207 @@ -285,7 +285,7 @@
2208      ifaces = []
2209      for node in ctx.xpathEval(vhbase % DEVICE_ETHERNET):
2210          iface = virtinst.VirtualNetworkInterface(conn)
2211 -            # XXX: Just ignore 'source' info and choose the default
2212 +        # XXX: Just ignore 'source' info and choose the default
2213          net_model = _get_child_content(node, "ResourceSubType")
2214          if net_model and not net_model.isdigit():
2215              iface.model = net_model.lower()
2216 diff -urN virt-manager-1.0.1/virt-convert virt-manager/virt-convert
2217 --- virt-manager-1.0.1/virt-convert     2014-03-22 16:27:02.000000000 +0000
2218 +++ virt-manager/virt-convert   2014-06-12 11:22:21.150891895 +0000
2219 @@ -97,9 +97,12 @@
2220          options.quiet = True
2221  
2222      conscb = options.autoconsole and cli.show_console_for_guest or None
2223 +    print_cb = print_stdout
2224 +    if options.quiet:
2225 +        print_cb = None
2226  
2227      converter = VirtConverter(conn, options.input,
2228 -        input_name=options.input_format, print_cb=print_stdout)
2229 +        input_name=options.input_format, print_cb=print_cb)
2230      try:
2231          converter.convert_disks(options.disk_format or "none",
2232              destdir=options.destination, dry=options.dry)
2233 diff -urN virt-manager-1.0.1/virt-image virt-manager/virt-image
2234 --- virt-manager-1.0.1/virt-image       2014-03-22 16:27:02.000000000 +0000
2235 +++ virt-manager/virt-image     2014-06-12 11:22:21.150891895 +0000
2236 @@ -33,7 +33,7 @@
2237  from virtinst import virtimage
2238  
2239  
2240 -### Option parsing
2241 +# Option parsing
2242  def parse_args():
2243      parser = cli.setupParser(
2244          "%(prog)s image.xml [OPTIONS]",
2245 diff -urN virt-manager-1.0.1/virtinst/capabilities.py virt-manager/virtinst/capabilities.py
2246 --- virt-manager-1.0.1/virtinst/capabilities.py 2014-03-20 18:04:29.000000000 +0000
2247 +++ virt-manager/virtinst/capabilities.py       2014-06-12 11:22:21.169891895 +0000
2248 @@ -102,16 +102,21 @@
2249      Fallback method to lists cpu models, parsed directly from libvirt's local
2250      cpu_map.xml
2251      """
2252 +    _cpu_filename = "/usr/share/libvirt/cpu_map.xml"
2253 +
2254      def __init__(self):
2255          _CPUAPIValues.__init__(self)
2256          self.archmap = {}
2257 -        cpu_filename = "/usr/share/libvirt/cpu_map.xml"
2258 -        xml = file(cpu_filename).read()
2259 +        xml = file(self._cpu_filename).read()
2260  
2261          util.parse_node_helper(xml, "cpus",
2262                                  self._parseXML,
2263                                  RuntimeError)
2264  
2265 +    @staticmethod
2266 +    def update_cpu_filename(name):
2267 +        _CPUMapFileValues._cpu_filename = name
2268 +
2269      def _parseXML(self, node):
2270          child = node.children
2271          while child:
2272 @@ -221,7 +226,7 @@
2273          self.threads = 1
2274          self.features = CapabilityFeatures()
2275  
2276 -        if not node is None:
2277 +        if node is not None:
2278              self.parseXML(node)
2279  
2280      def parseXML(self, node):
2281 @@ -263,7 +268,7 @@
2282          self.topology = None
2283          self.secmodels = []
2284  
2285 -        if not node is None:
2286 +        if node is not None:
2287              self.parseXML(node)
2288  
2289      def get_secmodel(self):
2290 @@ -296,7 +301,7 @@
2291  
2292          self.features = CapabilityFeatures()
2293  
2294 -        if not node is None:
2295 +        if node is not None:
2296              self.parseXML(node)
2297  
2298      def parseXML(self, node):
2299 @@ -403,7 +408,7 @@
2300      def __init__(self, node=None):
2301          self.cells = []
2302  
2303 -        if not node is None:
2304 +        if node is not None:
2305              self.parseXML(node)
2306  
2307      def parseXML(self, node):
2308 @@ -419,7 +424,7 @@
2309          self.id = None
2310          self.cpus = []
2311  
2312 -        if not node is None:
2313 +        if node is not None:
2314              self.parseXML(node)
2315  
2316      def parseXML(self, node):
2317 @@ -435,7 +440,7 @@
2318      def __init__(self, node=None):
2319          self.id = None
2320  
2321 -        if not node is None:
2322 +        if node is not None:
2323              self.parseXML(node)
2324  
2325      def parseXML(self, node):
2326 @@ -448,7 +453,7 @@
2327          self.doi = None
2328          self.baselabels = {}
2329  
2330 -        if not node is None:
2331 +        if node is not None:
2332              self.parseXML(node)
2333  
2334      def parseXML(self, node):
2335 diff -urN virt-manager-1.0.1/virtinst/cli.py virt-manager/virtinst/cli.py
2336 --- virt-manager-1.0.1/virtinst/cli.py  2014-03-22 16:27:02.000000000 +0000
2337 +++ virt-manager/virtinst/cli.py        2014-06-12 11:22:21.169891895 +0000
2338 @@ -117,7 +117,7 @@
2339      quiet = do_quiet
2340  
2341      vi_dir = None
2342 -    if not "VIRTINST_TEST_SUITE" in os.environ:
2343 +    if "VIRTINST_TEST_SUITE" not in os.environ:
2344          vi_dir = util.get_cache_dir()
2345  
2346      if vi_dir and not os.access(vi_dir, os.W_OK):
2347 @@ -347,7 +347,7 @@
2348          return child
2349  
2350      os.execvp(args[0], args)
2351 -    os._exit(1)  # pylint: disable=W0212
2352 +    os._exit(1)  # pylint: disable=protected-access
2353  
2354  
2355  def _gfx_console(guest):
2356 @@ -787,8 +787,9 @@
2357      geng.add_argument("--blkiotune", action="append",
2358                      help=_("Tune blkio policy for the domain process."))
2359      geng.add_argument("--memorybacking", action="append",
2360 -        help=_("Set memory backing policy for the domain process. Ex:\n"
2361 -               "--memorybacking hugepages=on"))
2362 +                    help=_("Set memory backing policy for "
2363 +                        "the domain process. Ex:\n"
2364 +                        "--memorybacking hugepages=on"))
2365      geng.add_argument("--features",
2366                      help=_("Set domain <features> XML. Ex:\n"
2367                             "--features acpi=off\n"
2368 @@ -797,6 +798,10 @@
2369                      help=_("Set domain <clock> XML. Ex:\n"
2370                             "--clock offset=localtime,rtc_tickpolicy=catchup"))
2371      geng.add_argument("--pm", help=_("Config power management features"))
2372 +    geng.add_argument("--events",
2373 +                    help=_("Config OS lifecycle operation management features"))
2374 +    geng.add_argument("--resource", action="append",
2375 +                    help=_("Config OS resource management features"))
2376  
2377  
2378  def add_boot_options(insg):
2379 @@ -926,7 +931,8 @@
2380          elif self.setter_cb:
2381              self.setter_cb(opts, inst, self.cliname, val)
2382          else:
2383 -            exec("inst." + self.attrname + " = val")  # pylint: disable=W0122
2384 +            exec(  # pylint: disable=exec-used
2385 +                "inst." + self.attrname + " = val")
2386  
2387  
2388  class VirtOptionString(object):
2389 @@ -1135,7 +1141,7 @@
2390          for optstr in optlist:
2391              optinst = inst
2392              if self.devclass and not inst:
2393 -                optinst = self.devclass(guest.conn)  # pylint: disable=E1102
2394 +                optinst = self.devclass(guest.conn)  # pylint: disable=not-callable
2395  
2396              try:
2397                  devs = self._parse_single_optstr(guest, optstr, optinst)
2398 @@ -1224,6 +1230,29 @@
2399          self.set_param("description", "description", can_comma=True)
2400  
2401  
2402 +####################
2403 +# --events parsing #
2404 +####################
2405 +
2406 +class ParserEvents(VirtCLIParser):
2407 +    def _init_params(self):
2408 +        self.set_param("on_poweroff", "on_poweroff")
2409 +        self.set_param("on_reboot", "on_reboot")
2410 +        self.set_param("on_crash", "on_crash")
2411 +
2412 +
2413 +######################
2414 +# --resource parsing #
2415 +######################
2416 +
2417 +class ParserResource(VirtCLIParser):
2418 +    def _init_params(self):
2419 +        self.remove_first = "partition"
2420 +        self.clear_attr = "resource"
2421 +
2422 +        self.set_param("resource.partition", "partition")
2423 +
2424 +
2425  ######################
2426  # --numatune parsing #
2427  ######################
2428 @@ -1410,6 +1439,12 @@
2429          self.set_param("os.os_type", "os_type")
2430          self.set_param("emulator", "emulator")
2431  
2432 +        def set_initargs_cb(opts, inst, cliname, val):
2433 +            ignore = opts
2434 +            ignore = cliname
2435 +            inst.os.set_initargs_string(val)
2436 +        self.set_param("os.initargs", "initargs", setter_cb=set_initargs_cb)
2437 +
2438          # Order matters for boot devices, we handle it specially in parse
2439          def noset_cb(val):
2440              ignore = val
2441 @@ -1420,7 +1455,7 @@
2442          # Build boot order
2443          boot_order = []
2444          for cliname, ignore in opts.orderedopts:
2445 -            if not cliname in inst.os.BOOT_DEVICES:
2446 +            if cliname not in inst.os.BOOT_DEVICES:
2447                  continue
2448  
2449              del(opts.opts[cliname])
2450 @@ -1637,6 +1672,7 @@
2451          self.set_param("bus", "bus")
2452          self.set_param("removable", "removable", is_onoff=True)
2453          self.set_param("driver_cache", "cache")
2454 +        self.set_param("driver_discard", "discard")
2455          self.set_param("driver_name", "driver_name")
2456          self.set_param("driver_type", "driver_type")
2457          self.set_param("driver_io", "io")
2458 @@ -1742,6 +1778,7 @@
2459          self.set_param("type", "type", setter_cb=set_type_cb)
2460          self.set_param("source", "source")
2461          self.set_param("source_mode", "source_mode")
2462 +        self.set_param("portgroup", "portgroup")
2463          self.set_param("target_dev", "target")
2464          self.set_param("model", "model")
2465          self.set_param("macaddr", "mac", setter_cb=set_mac_cb)
2466 @@ -1966,11 +2003,11 @@
2467      def _parse(self, optsobj, inst):
2468          opts = optsobj.opts
2469  
2470 -        # pylint: disable=W0201
2471 +        # pylint: disable=attribute-defined-outside-init
2472          # Defined outside init, but its easier this way
2473          self._cli_backend_mode = "connect"
2474          self._cli_backend_type = "udp"
2475 -        # pylint: enable=W0201
2476 +        # pylint: enable=attribute-defined-outside-init
2477  
2478          if opts.get("type", "").startswith("/"):
2479              # Allow --rng /dev/random
2480 @@ -2210,6 +2247,8 @@
2481          parsermap[parserobj.option_variable_name] = parserobj
2482  
2483      register_parser("metadata", ParserMetadata)
2484 +    register_parser("events", ParserEvents)
2485 +    register_parser("resource", ParserResource)
2486      register_parser("memory", ParserMemory)
2487      register_parser("memtune", ParserMemorytune)
2488      register_parser("vcpus", ParserVCPU)
2489 diff -urN virt-manager-1.0.1/virtinst/connection.py virt-manager/virtinst/connection.py
2490 --- virt-manager-1.0.1/virtinst/connection.py   2014-03-20 18:04:29.000000000 +0000
2491 +++ virt-manager/virtinst/connection.py 2014-06-12 11:22:21.170891895 +0000
2492 @@ -185,7 +185,7 @@
2493          Returns a list of Guest() objects
2494          """
2495          if self.cb_fetch_all_guests:
2496 -            return self.cb_fetch_all_guests()  # pylint: disable=E1102
2497 +            return self.cb_fetch_all_guests()  # pylint: disable=not-callable
2498          return self._fetch_all_guests_cached()
2499  
2500      def _fetch_all_pools_cached(self):
2501 @@ -206,7 +206,7 @@
2502          Returns a list of StoragePool objects
2503          """
2504          if self.cb_fetch_all_pools:
2505 -            return self.cb_fetch_all_pools()  # pylint: disable=E1102
2506 +            return self.cb_fetch_all_pools()  # pylint: disable=not-callable
2507          return self._fetch_all_pools_cached()
2508  
2509      def _fetch_all_vols_cached(self):
2510 @@ -236,12 +236,12 @@
2511          Returns a list of StorageVolume objects
2512          """
2513          if self.cb_fetch_all_vols:
2514 -            return self.cb_fetch_all_vols()  # pylint: disable=E1102
2515 +            return self.cb_fetch_all_vols()  # pylint: disable=not-callable
2516          return self._fetch_all_vols_cached()
2517  
2518      def clear_cache(self, pools=False):
2519          if self.cb_clear_cache:
2520 -            self.cb_clear_cache(pools=pools)  # pylint: disable=E1102
2521 +            self.cb_clear_cache(pools=pools)  # pylint: disable=not-callable
2522              return
2523  
2524          if pools:
2525 diff -urN virt-manager-1.0.1/virtinst/devicechar.py virt-manager/virtinst/devicechar.py
2526 --- virt-manager-1.0.1/virtinst/devicechar.py   2014-02-17 17:37:52.000000000 +0000
2527 +++ virt-manager/virtinst/devicechar.py 2014-06-12 11:22:21.170891895 +0000
2528 @@ -38,10 +38,12 @@
2529      TYPE_UDP      = "udp"
2530      TYPE_UNIX     = "unix"
2531      TYPE_SPICEVMC = "spicevmc"
2532 +    TYPE_SPICEPORT = "spiceport"
2533 +
2534      # We don't list the non-UI friendly types here
2535      _TYPES_FOR_ALL = [TYPE_PTY, TYPE_DEV, TYPE_FILE,
2536                        TYPE_TCP, TYPE_UDP, TYPE_UNIX]
2537 -    _TYPES_FOR_CHANNEL = [TYPE_SPICEVMC]
2538 +    _TYPES_FOR_CHANNEL = [TYPE_SPICEVMC, TYPE_SPICEPORT]
2539      TYPES = _TYPES_FOR_ALL
2540  
2541      MODE_CONNECT = "connect"
2542 @@ -67,9 +69,11 @@
2543      CHANNEL_NAME_SPICE = "com.redhat.spice.0"
2544      CHANNEL_NAME_QEMUGA = "org.qemu.guest_agent.0"
2545      CHANNEL_NAME_LIBGUESTFS = "org.libguestfs.channel.0"
2546 +    CHANNEL_NAME_SPICE_WEBDAV = "org.spice-space.webdav.0"
2547      CHANNEL_NAMES = [CHANNEL_NAME_SPICE,
2548                       CHANNEL_NAME_QEMUGA,
2549 -                     CHANNEL_NAME_LIBGUESTFS]
2550 +                     CHANNEL_NAME_LIBGUESTFS,
2551 +                     CHANNEL_NAME_SPICE_WEBDAV]
2552  
2553      @staticmethod
2554      def pretty_channel_name(val):
2555 @@ -79,6 +83,8 @@
2556              return "qemu-ga"
2557          if val == _VirtualCharDevice.CHANNEL_NAME_LIBGUESTFS:
2558              return "libguestfs"
2559 +        if val == _VirtualCharDevice.CHANNEL_NAME_SPICE_WEBDAV:
2560 +            return "spice-webdav"
2561          return None
2562  
2563      @staticmethod
2564 @@ -110,6 +116,8 @@
2565              desc = _("Unix socket")
2566          elif ctype == _VirtualCharDevice.TYPE_SPICEVMC:
2567              desc = _("Spice agent")
2568 +        elif ctype == _VirtualCharDevice.TYPE_SPICEPORT:
2569 +            desc = _("Spice port")
2570  
2571          return desc
2572  
2573 @@ -137,6 +145,7 @@
2574              "source_mode"   : [self.TYPE_UNIX, self.TYPE_TCP],
2575              "source_host"   : [self.TYPE_TCP, self.TYPE_UDP],
2576              "source_port"   : [self.TYPE_TCP, self.TYPE_UDP],
2577 +            "source_channel": [self.TYPE_SPICEPORT],
2578              "protocol"      : [self.TYPE_TCP],
2579              "bind_host"     : [self.TYPE_UDP],
2580              "bind_port"     : [self.TYPE_UDP],
2581 @@ -170,7 +179,7 @@
2582  
2583      _XML_PROP_ORDER = ["type", "_has_mode_bind", "_has_mode_connect",
2584                         "bind_host", "bind_port",
2585 -                       "source_mode", "_source_path",
2586 +                       "source_mode", "_source_path", "source_channel",
2587                         "source_host", "source_port",
2588                         "target_type", "target_name"]
2589  
2590 @@ -191,6 +200,9 @@
2591          self._source_path = val
2592      source_path = property(_get_source_path, _set_source_path)
2593  
2594 +    source_channel = XMLProperty(xpath="./source/@channel",
2595 +                                 doc=_("Source channel name."))
2596 +
2597      def _get_default_source_mode(self):
2598          if self.type == self.TYPE_UDP:
2599              return self.MODE_CONNECT
2600 diff -urN virt-manager-1.0.1/virtinst/devicedisk.py virt-manager/virtinst/devicedisk.py
2601 --- virt-manager-1.0.1/virtinst/devicedisk.py   2014-03-10 15:17:52.000000000 +0000
2602 +++ virt-manager/virtinst/devicedisk.py 2014-06-12 11:22:21.170891895 +0000
2603 @@ -169,6 +169,10 @@
2604      cache_types = [CACHE_MODE_NONE, CACHE_MODE_WRITETHROUGH,
2605          CACHE_MODE_WRITEBACK, CACHE_MODE_DIRECTSYNC, CACHE_MODE_UNSAFE]
2606  
2607 +    DISCARD_MODE_IGNORE = "ignore"
2608 +    DISCARD_MODE_UNMAP = "unmap"
2609 +    discard_types = [DISCARD_MODE_IGNORE, DISCARD_MODE_UNMAP]
2610 +
2611      DEVICE_DISK = "disk"
2612      DEVICE_LUN = "lun"
2613      DEVICE_CDROM = "cdrom"
2614 @@ -494,7 +498,7 @@
2615      _XML_PROP_ORDER = [
2616          "type", "device",
2617          "driver_name", "driver_type",
2618 -        "driver_cache", "driver_io", "error_policy",
2619 +        "driver_cache", "driver_discard", "driver_io", "error_policy",
2620          "_xmlpath", "target", "bus",
2621      ]
2622  
2623 @@ -607,6 +611,7 @@
2624      read_only = XMLProperty("./readonly", is_bool=True)
2625      shareable = XMLProperty("./shareable", is_bool=True)
2626      driver_cache = XMLProperty("./driver/@cache")
2627 +    driver_discard = XMLProperty("./driver/@discard")
2628      driver_io = XMLProperty("./driver/@io")
2629  
2630      error_policy = XMLProperty("./driver/@error_policy")
2631 diff -urN virt-manager-1.0.1/virtinst/devicefilesystem.py virt-manager/virtinst/devicefilesystem.py
2632 --- virt-manager-1.0.1/virtinst/devicefilesystem.py     2014-02-17 17:37:52.000000000 +0000
2633 +++ virt-manager/virtinst/devicefilesystem.py   2014-06-12 11:22:21.170891895 +0000
2634 @@ -100,7 +100,8 @@
2635          # actually a directory, it is merely a arbitrary string tag
2636          # that is exported to the guest as a hint for where to mount
2637          if (self.conn.is_qemu() and
2638 -            (self.type == self.TYPE_DEFAULT or
2639 +            (self.type is None or
2640 +             self.type == self.TYPE_DEFAULT or
2641               self.type == self.TYPE_MOUNT)):
2642              pass
2643          elif not os.path.isabs(val):
2644 diff -urN virt-manager-1.0.1/virtinst/deviceinterface.py virt-manager/virtinst/deviceinterface.py
2645 --- virt-manager-1.0.1/virtinst/deviceinterface.py      2014-02-17 17:37:52.000000000 +0000
2646 +++ virt-manager/virtinst/deviceinterface.py    2014-06-12 11:22:21.171891895 +0000
2647 @@ -208,7 +208,7 @@
2648      ##################
2649  
2650      _XML_PROP_ORDER = [
2651 -        "_bridge", "_network", "_source_dev", "source_mode",
2652 +        "_bridge", "_network", "_source_dev", "source_mode", "portgroup",
2653          "macaddr", "target_dev", "model", "virtualport",
2654          "filterref"]
2655  
2656 @@ -226,6 +226,7 @@
2657  
2658      source_mode = XMLProperty("./source/@mode",
2659                                default_cb=_default_source_mode)
2660 +    portgroup = XMLProperty("./source/@portgroup")
2661      model = XMLProperty("./model/@type")
2662      target_dev = XMLProperty("./target/@dev")
2663      filterref = XMLProperty("./filterref/@filter")
2664 diff -urN virt-manager-1.0.1/virtinst/diskbackend.py virt-manager/virtinst/diskbackend.py
2665 --- virt-manager-1.0.1/virtinst/diskbackend.py  2014-02-17 17:37:52.000000000 +0000
2666 +++ virt-manager/virtinst/diskbackend.py        2014-06-12 11:22:21.171891895 +0000
2667 @@ -86,9 +86,9 @@
2668      if not vol:
2669          pool = StoragePool.lookup_pool_by_path(conn, os.path.dirname(path))
2670  
2671 -        # Is pool running?
2672 +        # Ensure pool is running
2673          if pool and pool.info()[0] != libvirt.VIR_STORAGE_POOL_RUNNING:
2674 -            pool = None
2675 +            pool.create(0)
2676  
2677      # Attempt to lookup path as a storage volume
2678      if pool and not vol:
2679 @@ -137,13 +137,14 @@
2680          return vol, pool, path_is_pool
2681  
2682      dirname = os.path.dirname(path)
2683 -    poolname = StoragePool.find_free_name(
2684 -        conn, os.path.basename(dirname) or "pool")
2685 +    poolname = os.path.basename(dirname).replace(" ", "_")
2686 +    if not poolname:
2687 +        poolname = "dirpool"
2688 +    poolname = StoragePool.find_free_name(conn, poolname)
2689      logging.debug("Attempting to build pool=%s target=%s", poolname, dirname)
2690  
2691      poolxml = StoragePool(conn)
2692 -    poolxml.name = poolxml.find_free_name(
2693 -        conn, os.path.basename(dirname) or "dirpool")
2694 +    poolxml.name = poolname
2695      poolxml.type = poolxml.TYPE_DIR
2696      poolxml.target_path = dirname
2697      pool = poolxml.install(build=False, create=True, autostart=True)
2698 diff -urN virt-manager-1.0.1/virtinst/distroinstaller.py virt-manager/virtinst/distroinstaller.py
2699 --- virt-manager-1.0.1/virtinst/distroinstaller.py      2014-03-06 17:52:00.000000000 +0000
2700 +++ virt-manager/virtinst/distroinstaller.py    2014-06-12 11:22:21.172891895 +0000
2701 @@ -1,5 +1,5 @@
2702  #
2703 -# Copyright 2006-2009, 2013 Red Hat, Inc.
2704 +# Copyright 2006-2009, 2013, 2014 Red Hat, Inc.
2705  # Daniel P. Berrange <berrange@redhat.com>
2706  #
2707  # This program is free software; you can redistribute it and/or modify
2708 @@ -30,6 +30,7 @@
2709  from virtinst import Installer
2710  from virtinst import VirtualDisk
2711  from virtinst import urlfetcher
2712 +from virtinst import osdict
2713  
2714  
2715  def _is_url(conn, url):
2716 @@ -166,7 +167,7 @@
2717          file_proc = subprocess.Popen(["file", "-z", initrd],
2718                                       stdout=subprocess.PIPE,
2719                                       stderr=subprocess.PIPE)
2720 -        if not "ext2 filesystem" in file_proc.communicate()[0]:
2721 +        if "ext2 filesystem" not in file_proc.communicate()[0]:
2722              return False
2723      except:
2724          logging.exception("Failed to file command for rhel4 initrd detection")
2725 @@ -473,6 +474,15 @@
2726  
2727      def detect_distro(self, guest):
2728          try:
2729 +            if not _is_url(self.conn, self.location):
2730 +                name = osdict.lookup_os_by_media(self.location)
2731 +                if name:
2732 +                    logging.debug("installer.detect_distro returned=%s", name)
2733 +                    return name
2734 +        except:
2735 +            logging.debug("libosinfo detect failed", exc_info=True)
2736 +
2737 +        try:
2738              ret = urlfetcher.detectMediaDistro(guest, self.location)
2739              logging.debug("installer.detect_distro returned=%s", ret)
2740              return ret
2741 diff -urN virt-manager-1.0.1/virtinst/domainresource.py virt-manager/virtinst/domainresource.py
2742 --- virt-manager-1.0.1/virtinst/domainresource.py       1970-01-01 00:00:00.000000000 +0000
2743 +++ virt-manager/virtinst/domainresource.py     2014-06-12 11:22:21.172891895 +0000
2744 @@ -0,0 +1,31 @@
2745 +#
2746 +# Copyright 2014 Fujitsu Limited.
2747 +# Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
2748 +#
2749 +# This program is free software; you can redistribute it and/or modify
2750 +# it under the terms of the GNU General Public License as published by
2751 +# the Free Software Foundation; either version 2 of the License, or
2752 +# (at your option) any later version.
2753 +#
2754 +# This program is distributed in the hope that it will be useful,
2755 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
2756 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2757 +# GNU General Public License for more details.
2758 +#
2759 +# You should have received a copy of the GNU General Public License
2760 +# along with this program; if not, write to the Free Software
2761 +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
2762 +# MA 02110-1301 USA.
2763 +
2764 +from virtinst.xmlbuilder import XMLBuilder, XMLProperty
2765 +
2766 +
2767 +class DomainResource(XMLBuilder):
2768 +    """
2769 +    Class for generating <resource> XML
2770 +    """
2771 +
2772 +    _XML_ROOT_NAME = "resource"
2773 +    _XML_PROP_ORDER = ["partition"]
2774 +
2775 +    partition = XMLProperty("./partition")
2776 diff -urN virt-manager-1.0.1/virtinst/guest.py virt-manager/virtinst/guest.py
2777 --- virt-manager-1.0.1/virtinst/guest.py        2014-03-22 16:25:24.000000000 +0000
2778 +++ virt-manager/virtinst/guest.py      2014-06-12 11:22:21.173891895 +0000
2779 @@ -39,6 +39,7 @@
2780  from virtinst import DomainMemorybacking
2781  from virtinst import DomainBlkiotune
2782  from virtinst import DomainFeatures
2783 +from virtinst import DomainResource
2784  from virtinst import PM
2785  from virtinst import IdMap
2786  from virtinst.xmlbuilder import XMLBuilder, XMLProperty, XMLChildProperty
2787 @@ -93,9 +94,9 @@
2788  
2789      _XML_ROOT_NAME = "domain"
2790      _XML_PROP_ORDER = ["type", "name", "uuid", "title", "description",
2791 -        "maxmemory", "memory", "memoryBacking", "vcpus", "curvcpus", "memtune",
2792 -        "numatune", "blkiotune", "bootloader", "os", "idmap", "features",
2793 -        "cpu", "clock", "on_poweroff", "on_reboot", "on_crash", "pm",
2794 +        "maxmemory", "memory", "blkiotune", "memtune", "memoryBacking",
2795 +        "vcpus", "curvcpus", "numatune", "bootloader", "os", "idmap", "features",
2796 +        "cpu", "clock", "on_poweroff", "on_reboot", "on_crash", "resource", "pm",
2797          "emulator", "_devices", "seclabel"]
2798  
2799      def __init__(self, *args, **kwargs):
2800 @@ -196,6 +197,7 @@
2801      memtune = XMLChildProperty(DomainMemorytune, is_single=True)
2802      memoryBacking = XMLChildProperty(DomainMemorybacking, is_single=True)
2803      idmap = XMLChildProperty(IdMap, is_single=True)
2804 +    resource = XMLChildProperty(DomainResource, is_single=True)
2805  
2806  
2807      ###############################
2808 diff -urN virt-manager-1.0.1/virtinst/__init__.py virt-manager/virtinst/__init__.py
2809 --- virt-manager-1.0.1/virtinst/__init__.py     2014-03-22 16:16:24.000000000 +0000
2810 +++ virt-manager/virtinst/__init__.py   2014-06-12 11:22:21.168891895 +0000
2811 @@ -29,6 +29,7 @@
2812  from virtinst.domainblkiotune import DomainBlkiotune
2813  from virtinst.domainmemorytune import DomainMemorytune
2814  from virtinst.domainmemorybacking import DomainMemorybacking
2815 +from virtinst.domainresource import DomainResource
2816  from virtinst.clock import Clock
2817  from virtinst.cpu import CPU, CPUFeature
2818  from virtinst.seclabel import Seclabel
2819 diff -urN virt-manager-1.0.1/virtinst/interface.py virt-manager/virtinst/interface.py
2820 --- virt-manager-1.0.1/virtinst/interface.py    2014-02-17 17:37:52.000000000 +0000
2821 +++ virt-manager/virtinst/interface.py  2014-06-12 11:22:21.173891895 +0000
2822 @@ -23,6 +23,7 @@
2823  import logging
2824  
2825  import libvirt
2826 +import ipaddr
2827  
2828  from virtinst import util
2829  from virtinst.xmlbuilder import XMLBuilder, XMLChildProperty, XMLProperty
2830 @@ -32,7 +33,15 @@
2831      _XML_PROP_ORDER = ["address", "prefix"]
2832      _XML_ROOT_NAME = "ip"
2833  
2834 -    address = XMLProperty("./@address")
2835 +    ######################
2836 +    # Validation helpers #
2837 +    ######################
2838 +
2839 +    def _validate_ipaddr(self, addr):
2840 +        ipaddr.IPAddress(addr)
2841 +        return addr
2842 +
2843 +    address = XMLProperty("./@address", validate_cb=_validate_ipaddr)
2844      prefix = XMLProperty("./@prefix", is_int=True)
2845  
2846  
2847 diff -urN virt-manager-1.0.1/virtinst/network.py virt-manager/virtinst/network.py
2848 --- virt-manager-1.0.1/virtinst/network.py      2014-02-17 17:37:52.000000000 +0000
2849 +++ virt-manager/virtinst/network.py    2014-06-12 11:22:21.173891895 +0000
2850 @@ -82,6 +82,13 @@
2851          return Network.pretty_forward_desc(self.mode, self.dev)
2852  
2853  
2854 +class _NetworkPortgroup(XMLBuilder):
2855 +    _XML_ROOT_NAME = "portgroup"
2856 +
2857 +    name = XMLProperty("./@name")
2858 +    default = XMLProperty("./@default", is_yesno=True)
2859 +
2860 +
2861  class Network(XMLBuilder):
2862      """
2863      Top level class for <network> object XML
2864 @@ -172,6 +179,7 @@
2865      delay = XMLProperty("./bridge/@delay", is_int=True)
2866      macaddr = XMLProperty("./mac/@address")
2867  
2868 +    portgroups = XMLChildProperty(_NetworkPortgroup)
2869      ips = XMLChildProperty(_NetworkIP)
2870      routes = XMLChildProperty(_NetworkRoute)
2871  
2872 @@ -184,6 +192,7 @@
2873          self._add_child(route)
2874          return route
2875  
2876 +
2877      ##################
2878      # build routines #
2879      ##################
2880 diff -urN virt-manager-1.0.1/virtinst/nodedev.py virt-manager/virtinst/nodedev.py
2881 --- virt-manager-1.0.1/virtinst/nodedev.py      2014-03-22 14:17:11.000000000 +0000
2882 +++ virt-manager/virtinst/nodedev.py    2014-06-12 11:22:21.173891895 +0000
2883 @@ -169,9 +169,10 @@
2884      iommu_group = XMLProperty("./capability/iommuGroup/@number", is_int=True)
2885  
2886      def pretty_name(self):
2887 -        devstr = "%.2X:%.2X:%X" % (int(self.bus),
2888 -                                   int(self.slot),
2889 -                                   int(self.function))
2890 +        devstr = "%.4X:%.2X:%.2X:%X" % (int(self.domain),
2891 +                                        int(self.bus),
2892 +                                        int(self.slot),
2893 +                                        int(self.function))
2894  
2895          return "%s %s %s" % (devstr, self.vendor_name, self.product_name)
2896  
2897 diff -urN virt-manager-1.0.1/virtinst/osdict.py virt-manager/virtinst/osdict.py
2898 --- virt-manager-1.0.1/virtinst/osdict.py       2014-02-17 17:37:52.000000000 +0000
2899 +++ virt-manager/virtinst/osdict.py     2014-06-12 11:22:21.173891895 +0000
2900 @@ -21,13 +21,48 @@
2901  
2902  _SENTINEL = -1234
2903  _allvariants = {}
2904 -
2905 -
2906 -def lookup_os(key):
2907 -    ret = _allvariants.get(key)
2908 -    if ret is None:
2909 -        return ret
2910 -    return ret
2911 +from datetime import datetime
2912 +from gi.repository import Libosinfo as libosinfo
2913 +from inspect import isfunction
2914 +
2915 +_aliases = {
2916 +    "altlinux" : "altlinux1.0",
2917 +    "debianetch" : "debian4",
2918 +    "debianlenny" : "debian5",
2919 +    "debiansqueeze" : "debian6",
2920 +    "debianwheezy" : "debian7",
2921 +    "freebsd10" : "freebsd10.0",
2922 +    "freebsd6" : "freebsd6.0",
2923 +    "freebsd7" : "freebsd7.0",
2924 +    "freebsd8" : "freebsd8.0",
2925 +    "freebsd9" : "freebsd9.0",
2926 +    "mandriva2009" : "mandriva2009.0",
2927 +    "mandriva2010" : "mandriva2010.0",
2928 +    "mbs1" : "mbs1.0",
2929 +    "msdos" : "msdos6.22",
2930 +    "openbsd4" : "openbsd4.2",
2931 +    "opensolaris" : "opensolaris2009.06",
2932 +    "opensuse11" : "opensuse11.4",
2933 +    "opensuse12" : "opensuse12.3",
2934 +    "rhel4" : "rhel4.0",
2935 +    "rhel5" : "rhel5.0",
2936 +    "rhel6" : "rhel6.0",
2937 +    "rhel7" : "rhel7.0",
2938 +    "ubuntuhardy" : "ubuntu8.04",
2939 +    "ubuntuintrepid" : "ubuntu8.10",
2940 +    "ubuntujaunty" : "ubuntu9.04",
2941 +    "ubuntukarmic" : "ubuntu9.10",
2942 +    "ubuntulucid" : "ubuntu10.04",
2943 +    "ubuntumaverick" : "ubuntu10.10",
2944 +    "ubuntunatty" : "ubuntu11.04",
2945 +    "ubuntuoneiric" : "ubuntu11.10",
2946 +    "ubuntuprecise" : "ubuntu12.04",
2947 +    "ubuntuquantal" : "ubuntu12.10",
2948 +    "ubunturaring" : "ubuntu13.04",
2949 +    "ubuntusaucy" : "ubuntu13.10",
2950 +    "vista" : "winvista",
2951 +    "winxp64" : "winxp",
2952 +}
2953  
2954  
2955  def _sort(tosort, sortpref=None):
2956 @@ -40,6 +75,10 @@
2957      # by their 'distro' tag first and foremost
2958      for key, osinfo in tosort.items():
2959          sortby = osinfo.sortby or key
2960 +        # Hack to allow "sortby" duplicates.  Remove when this never happens
2961 +        # with libosinfo
2962 +        while sortby_mappings.get(sortby):
2963 +            sortby = sortby + ".1"
2964          sortby_mappings[sortby] = key
2965  
2966          distro = osinfo.urldistro or "zzzzzzz"
2967 @@ -59,7 +98,7 @@
2968      sorted_distro_list.sort()
2969      sortpref.reverse()
2970      for prefer in sortpref:
2971 -        if not prefer in sorted_distro_list:
2972 +        if prefer not in sorted_distro_list:
2973              continue
2974          sorted_distro_list.remove(prefer)
2975          sorted_distro_list.insert(0, prefer)
2976 @@ -73,38 +112,6 @@
2977      return retlist
2978  
2979  
2980 -def list_os(list_types=False, typename=None,
2981 -            filtervars=None, only_supported=False,
2982 -            **kwargs):
2983 -    sortmap = {}
2984 -    filtervars = filtervars or []
2985 -
2986 -    for key, osinfo in _allvariants.items():
2987 -        if list_types and not osinfo.is_type:
2988 -            continue
2989 -        if not list_types and osinfo.is_type:
2990 -            continue
2991 -        if typename and typename != osinfo.typename:
2992 -            continue
2993 -        if filtervars and osinfo.name not in filtervars:
2994 -            continue
2995 -        if only_supported and not osinfo.supported:
2996 -            continue
2997 -        sortmap[key] = osinfo
2998 -    return _sort(sortmap, **kwargs)
2999 -
3000 -
3001 -def lookup_osdict_key(variant, key, default):
3002 -    val = _SENTINEL
3003 -    if variant is not None:
3004 -        if not hasattr(_allvariants[variant], key):
3005 -            raise ValueError("Unknown osdict property '%s'" % key)
3006 -        val = getattr(_allvariants[variant], key)
3007 -    if val == _SENTINEL:
3008 -        val = default
3009 -    return val
3010 -
3011 -
3012  class _OSVariant(object):
3013      """
3014      Object tracking guest OS specific configuration bits.
3015 @@ -123,8 +130,9 @@
3016          it is still pretty useful, so we fake it here. New types should
3017          not be added often.
3018      @parent: Name of a pre-created variant that we want to extend. So
3019 -        fedoraFOO would have parent fedoraFOO-1. It's used for inheiriting
3020 +        fedoraFOO would have parent fedoraFOO-1. It's used for inheriting
3021          values.
3022 +    @typename: The family of the OS, e.g. "linux", "windows", "unix".
3023      @sortby: A different key to use for sorting the distro list. By default
3024          it's 'name', so this doesn't need to be specified.
3025      @urldistro: This is a distro class. It's wired up in urlfetcher to give
3026 @@ -149,7 +157,7 @@
3027      their usage.
3028      """
3029      def __init__(self, name, label, is_type=False,
3030 -                 sortby=None, parent=_SENTINEL,
3031 +                 sortby=None, parent=_SENTINEL, typename=_SENTINEL,
3032                   urldistro=_SENTINEL, supported=_SENTINEL,
3033                   three_stage_install=_SENTINEL,
3034                   acpi=_SENTINEL, apic=_SENTINEL, clock=_SENTINEL,
3035 @@ -184,7 +192,10 @@
3036          self.sortby = sortby
3037  
3038          self.is_type = bool(is_type)
3039 -        self.typename = _get_default("typename",
3040 +
3041 +        self.typename = typename
3042 +        if typename == _SENTINEL:
3043 +            self.typename = _get_default("typename",
3044                                       self.is_type and self.name or _SENTINEL)
3045  
3046          # 'types' should rarely be altered, this check will make
3047 @@ -219,6 +230,10 @@
3048          self.virtioconsole = _get_default("virtioconsole", virtioconsole)
3049          self.qemu_ga = _get_default("qemu_ga", qemu_ga)
3050  
3051 +    def get_recommended_resources(self, arch):
3052 +        ignore1 = arch
3053 +        return None
3054 +
3055  
3056  def _add_type(*args, **kwargs):
3057      kwargs["is_type"] = True
3058 @@ -231,107 +246,357 @@
3059      _allvariants[v.name] = v
3060  
3061  
3062 -_add_type("linux", "Linux")
3063 -_add_var("rhel2.1", "Red Hat Enterprise Linux 2.1", urldistro="rhel", parent="linux")
3064 -_add_var("rhel3", "Red Hat Enterprise Linux 3", parent="rhel2.1")
3065 -_add_var("rhel4", "Red Hat Enterprise Linux 4", supported=True, parent="rhel3")
3066 -_add_var("rhel5", "Red Hat Enterprise Linux 5", supported=False, parent="rhel4")
3067 -_add_var("rhel5.4", "Red Hat Enterprise Linux 5.4 or later", supported=True, virtiodisk=True, virtionet=True, parent="rhel5")
3068 -_add_var("rhel6", "Red Hat Enterprise Linux 6", inputtype="tablet", inputbus="usb", parent="rhel5.4")
3069 -_add_var("rhel7", "Red Hat Enterprise Linux 7 (or later)", parent="rhel6", qemu_ga=True, virtioconsole=True, virtiommio=True)
3070 -
3071 -_add_var("fedora5", "Fedora Core 5", sortby="fedora05", urldistro="fedora", parent="linux")
3072 -_add_var("fedora6", "Fedora Core 6", sortby="fedora06", parent="fedora5")
3073 -_add_var("fedora7", "Fedora 7", sortby="fedora07", parent="fedora6")
3074 -_add_var("fedora8", "Fedora 8", sortby="fedora08", parent="fedora7")
3075 -# Apparently F9 has selinux errors when installing with virtio:
3076 -# https://bugzilla.redhat.com/show_bug.cgi?id=470386
3077 -_add_var("fedora9", "Fedora 9", sortby="fedora09", virtionet=True, parent="fedora8")
3078 -_add_var("fedora10", "Fedora 10", virtiodisk=True, parent="fedora9")
3079 -_add_var("fedora11", "Fedora 11", inputtype="tablet", inputbus="usb", parent="fedora10")
3080 -_add_var("fedora12", "Fedora 12", parent="fedora11")
3081 -_add_var("fedora13", "Fedora 13", parent="fedora12")
3082 -_add_var("fedora14", "Fedora 14", parent="fedora13")
3083 -_add_var("fedora15", "Fedora 15", parent="fedora14")
3084 -_add_var("fedora16", "Fedora 16", parent="fedora15")
3085 -_add_var("fedora17", "Fedora 17", parent="fedora16")
3086 -_add_var("fedora18", "Fedora 18", supported=True, virtioconsole=True, qemu_ga=True, parent="fedora17")
3087 -_add_var("fedora19", "Fedora 19", virtiommio=True, parent="fedora18")
3088 -_add_var("fedora20", "Fedora 20 (or later)", parent="fedora19")
3089 -
3090 -_add_var("opensuse11", "openSuse 11", urldistro="suse", supported=True, virtiodisk=True, virtionet=True, parent="linux")
3091 -_add_var("opensuse12", "openSuse 12 (or later)", parent="opensuse11")
3092 -
3093 -_add_var("sles10", "Suse Linux Enterprise Server", urldistro="suse", supported=True, parent="linux")
3094 -_add_var("sles11", "Suse Linux Enterprise Server 11 (or later)", supported=True, virtiodisk=True, virtionet=True, parent="sles10")
3095 -
3096 -_add_var("mandriva2009", "Mandriva Linux 2009 and earlier", urldistro="mandriva", parent="linux")
3097 -_add_var("mandriva2010", "Mandriva Linux 2010 (or later)", virtiodisk=True, virtionet=True, parent="mandriva2009")
3098 -
3099 -_add_var("mes5", "Mandriva Enterprise Server 5.0", urldistro="mandriva", parent="linux")
3100 -_add_var("mes5.1", "Mandriva Enterprise Server 5.1 (or later)", supported=True, virtiodisk=True, virtionet=True, parent="mes5")
3101 -_add_var("mbs1", "Mandriva Business Server 1 (or later)", supported=True, virtiodisk=True, virtionet=True, parent="linux")
3102 -
3103 -_add_var("mageia1", "Mageia 1 (or later)", urldistro="mandriva", supported=True, virtiodisk=True, virtionet=True, inputtype="tablet", inputbus="usb", parent="linux")
3104 -
3105 -_add_var("altlinux", "ALT Linux (or later)", urldistro="altlinux", supported=True, virtiodisk=True, virtionet=True, inputtype="tablet", inputbus="usb", parent="linux")
3106 -
3107 -_add_var("debianetch", "Debian Etch", urldistro="debian", sortby="debian4", parent="linux")
3108 -_add_var("debianlenny", "Debian Lenny", sortby="debian5", supported=True, virtiodisk=True, virtionet=True, parent="debianetch")
3109 -_add_var("debiansqueeze", "Debian Squeeze", sortby="debian6", virtiodisk=True, virtionet=True, inputtype="tablet", inputbus="usb", parent="debianlenny")
3110 -_add_var("debianwheezy", "Debian Wheezy (or later)", sortby="debian7", parent="debiansqueeze")
3111 -
3112 -_add_var("ubuntuhardy", "Ubuntu 8.04 LTS (Hardy Heron)", urldistro="ubuntu", virtionet=True, parent="linux")
3113 -_add_var("ubuntuintrepid", "Ubuntu 8.10 (Intrepid Ibex)", parent="ubuntuhardy")
3114 -_add_var("ubuntujaunty", "Ubuntu 9.04 (Jaunty Jackalope)", virtiodisk=True, parent="ubuntuintrepid")
3115 -_add_var("ubuntukarmic", "Ubuntu 9.10 (Karmic Koala)", parent="ubuntujaunty")
3116 -_add_var("ubuntulucid", "Ubuntu 10.04 LTS (Lucid Lynx)", supported=True, parent="ubuntukarmic")
3117 -_add_var("ubuntumaverick", "Ubuntu 10.10 (Maverick Meerkat)", supported=False, parent="ubuntulucid")
3118 -_add_var("ubuntunatty", "Ubuntu 11.04 (Natty Narwhal)", parent="ubuntumaverick")
3119 -_add_var("ubuntuoneiric", "Ubuntu 11.10 (Oneiric Ocelot)", parent="ubuntunatty")
3120 -_add_var("ubuntuprecise", "Ubuntu 12.04 LTS (Precise Pangolin)", supported=True, parent="ubuntuoneiric")
3121 -_add_var("ubuntuquantal", "Ubuntu 12.10 (Quantal Quetzal)", parent="ubuntuprecise")
3122 -_add_var("ubunturaring", "Ubuntu 13.04 (Raring Ringtail)", videomodel="vmvga", parent="ubuntuquantal")
3123 -_add_var("ubuntusaucy", "Ubuntu 13.10 (Saucy Salamander) (or later)", parent="ubunturaring")
3124 -
3125 -_add_var("generic24", "Generic 2.4.x kernel", parent="linux")
3126 -_add_var("generic26", "Generic 2.6.x kernel", parent="generic24")
3127 -_add_var("virtio26", "Generic 2.6.25 or later kernel with virtio", sortby="genericvirtio26", virtiodisk=True, virtionet=True, parent="generic26")
3128 +class _OsVariantOsInfo(_OSVariant):
3129  
3130 +    @staticmethod
3131 +    def is_windows(o):
3132 +        return o.get_family() in ['win9x', 'winnt', 'win16']
3133 +
3134 +    def _is_three_stage_install(self):
3135 +        if _OsVariantOsInfo.is_windows(self._os):
3136 +            return True
3137 +        return _SENTINEL
3138 +
3139 +    def _get_clock(self):
3140 +        if _OsVariantOsInfo.is_windows(self._os) or \
3141 +           self._os.get_family() in ['solaris']:
3142 +            return "localtime"
3143 +        return _SENTINEL
3144 +
3145 +    def _is_acpi(self):
3146 +        if self._os.get_family() in ['msdos']:
3147 +            return False
3148 +        return _SENTINEL
3149 +
3150 +    def _is_apic(self):
3151 +        if self._os.get_family() in ['msdos']:
3152 +            return False
3153 +        return _SENTINEL
3154 +
3155 +    def _get_netmodel(self):
3156 +        if self._os.get_distro() == "fedora":
3157 +            return _SENTINEL
3158 +
3159 +        fltr = libosinfo.Filter()
3160 +        fltr.add_constraint("class", "net")
3161 +        devs = self._os.get_all_devices(fltr)
3162 +        if devs.get_length():
3163 +            return devs.get_nth(0).get_name()
3164 +        return _SENTINEL
3165 +
3166 +    def _get_videomodel(self):
3167 +        if self._os.get_short_id() in {"ubuntu13.10", "ubuntu13.04"}:
3168 +            return "vmvga"
3169 +
3170 +        if _OsVariantOsInfo.is_windows(self._os):
3171 +            return "vga"
3172 +
3173 +        if self._os.get_distro() == "fedora":
3174 +            return _SENTINEL
3175 +
3176 +        fltr = libosinfo.Filter()
3177 +        fltr.add_constraint("class", "video")
3178 +        devs = self._os.get_all_devices(fltr)
3179 +        if devs.get_length():
3180 +            return devs.get_nth(0).get_name()
3181 +        return _SENTINEL
3182 +
3183 +    def _get_inputtype(self):
3184 +        fltr = libosinfo.Filter()
3185 +        fltr.add_constraint("class", "input")
3186 +        devs = self._os.get_all_devices(fltr)
3187 +        if devs.get_length():
3188 +            return devs.get_nth(0).get_name()
3189 +        return _SENTINEL
3190 +
3191 +    def get_inputbus(self):
3192 +        fltr = libosinfo.Filter()
3193 +        fltr.add_constraint("class", "input")
3194 +        devs = self._os.get_all_devices(fltr)
3195 +        if devs.get_length():
3196 +            return devs.get_nth(0).get_bus_type()
3197 +        return _SENTINEL
3198 +
3199 +    def _get_diskbus(self):
3200 +        return _SENTINEL
3201 +
3202 +    @staticmethod
3203 +    def is_os_related_to(o, related_os_list):
3204 +        if o.get_short_id() in related_os_list:
3205 +            return True
3206 +        related = o.get_related(libosinfo.ProductRelationship.DERIVES_FROM)
3207 +        clones = o.get_related(libosinfo.ProductRelationship.CLONES)
3208 +        for r in related.get_elements() + clones.get_elements():
3209 +            if r.get_short_id() in related_os_list or \
3210 +               _OsVariantOsInfo.is_os_related_to(r, related_os_list):
3211 +                return True
3212 +
3213 +        return False
3214 +
3215 +    def _get_xen_disable_acpi(self):
3216 +        if _OsVariantOsInfo.is_os_related_to(self._os, ["winxp", "win2k"]):
3217 +            return True
3218 +        return _SENTINEL
3219 +
3220 +    def _is_virtiodisk(self):
3221 +        if self._os.get_distro() == "fedora":
3222 +            if self._os.get_version() == "unknown":
3223 +                return _SENTINEL
3224 +            return int(self._os.get_version() >= 10) or _SENTINEL
3225 +
3226 +        fltr = libosinfo.Filter()
3227 +        fltr.add_constraint("class", "block")
3228 +        devs = self._os.get_all_devices(fltr)
3229 +        for dev in range(devs.get_length()):
3230 +            d = devs.get_nth(dev)
3231 +            if d.get_name() == "virtio-block":
3232 +                return True
3233 +
3234 +        return _SENTINEL
3235 +
3236 +    def _is_virtionet(self):
3237 +        if self._os.get_distro() == "fedora":
3238 +            if self._os.get_version() == "unknown":
3239 +                return _SENTINEL
3240 +            return int(self._os.get_version() >= 9) or _SENTINEL
3241 +
3242 +        fltr = libosinfo.Filter()
3243 +        fltr.add_constraint("class", "net")
3244 +        devs = self._os.get_all_devices(fltr)
3245 +        for dev in range(devs.get_length()):
3246 +            d = devs.get_nth(dev)
3247 +            if d.get_name() == "virtio-net":
3248 +                return True
3249 +        return _SENTINEL
3250 +
3251 +    def _is_virtioconsole(self):
3252 +        if self._os.get_distro() == "fedora":
3253 +            if self._os.get_version() == "unknown":
3254 +                return _SENTINEL
3255 +            return int(self._os.get_version()) >= 18 or _SENTINEL
3256 +
3257 +        fltr = libosinfo.Filter()
3258 +        fltr.add_constraint("class", "console")
3259 +        devs = self._os.get_all_devices(fltr)
3260 +        for dev in range(devs.get_length()):
3261 +            d = devs.get_nth(dev)
3262 +            if d.get_name() == "virtio-console":
3263 +                return True
3264 +        return _SENTINEL
3265 +
3266 +    def _is_virtiommio(self):
3267 +        if _OsVariantOsInfo.is_os_related_to(self._os, ["fedora19"]):
3268 +            return True
3269 +        return _SENTINEL
3270 +
3271 +    def _is_qemu_ga(self):
3272 +        if self._os.get_distro() == "fedora":
3273 +            if self._os.get_version() == "unknown":
3274 +                return _SENTINEL
3275 +            return int(self._os.get_version()) >= 18 or _SENTINEL
3276 +        return _SENTINEL
3277 +
3278 +    def _get_typename(self):
3279 +        if self._os.get_family() in ['linux']:
3280 +            return "linux"
3281 +
3282 +        if self._os.get_family() in ['win9x', 'winnt', 'win16']:
3283 +            return "windows"
3284 +
3285 +        if self._os.get_family() in ['solaris']:
3286 +            return "solaris"
3287 +
3288 +        if self._os.get_family() in ['openbsd', 'freebsd', 'netbsd']:
3289 +            return "unix"
3290 +
3291 +        return "other"
3292 +
3293 +    def _get_sortby(self):
3294 +        version = self._os.get_version()
3295 +        try:
3296 +            t = version.split(".")
3297 +            t = t[:min(4, len(t))] + [0] * (4 - min(4, len(t)))
3298 +            new_version = ""
3299 +            for n in t:
3300 +                new_version = new_version + ("%.4i" % int(n))
3301 +            version = new_version
3302 +        except:
3303 +            pass
3304 +
3305 +        distro = self._os.get_distro()
3306 +        return "%s-%s" % (distro, version)
3307 +
3308 +    def _get_supported(self):
3309 +        d = self._os.get_eol_date_string()
3310 +        if self._os.get_distro() == "msdos":
3311 +            return False
3312 +        return d is None or datetime.strptime(d, "%Y-%m-%d") > datetime.now()
3313 +
3314 +    def _get_urldistro(self):
3315 +        urldistro = self._os.get_distro()
3316 +        remap = {
3317 +            "opensuse" : "suse",
3318 +            "sles" : "suse",
3319 +            "mes" : "mandriva"
3320 +        }
3321 +
3322 +        if remap.get(urldistro):
3323 +            return remap[urldistro]
3324 +
3325 +        return urldistro
3326 +
3327 +    def _get_name(self):
3328 +        return self._os.get_short_id()
3329 +
3330 +    def get_label(self):
3331 +        return self._os.get_name()
3332 +
3333 +    def __init__(self, o):
3334 +        self._os = o
3335 +        name = self._get_name()
3336 +        label = self.get_label()
3337 +        sortby = self._get_sortby()
3338 +        is_type = False
3339 +        typename = self._get_typename()
3340 +        urldistro = self._get_urldistro()
3341 +        supported = self._get_supported()
3342 +        three_stage_install = self._is_three_stage_install()
3343 +        acpi = self._is_acpi()
3344 +        apic = self._is_apic()
3345 +        clock = self._get_clock()
3346 +        xen_disable_acpi = self._get_xen_disable_acpi()
3347 +        virtiommio = self._is_virtiommio()
3348 +        qemu_ga = self._is_qemu_ga()
3349 +        virtioconsole = lambda: self._is_virtioconsole()
3350 +        netmodel = lambda: self._get_netmodel()
3351 +        videomodel = lambda: self._get_videomodel()
3352 +        diskbus = lambda: self._get_diskbus()
3353 +        inputtype = lambda: self._get_inputtype()
3354 +        inputbus = lambda: self.get_inputbus()
3355 +        virtiodisk = lambda: self._is_virtiodisk()
3356 +        virtionet = lambda: self._is_virtionet()
3357 +        _OSVariant.__init__(self, name=name, label=label, is_type=is_type,
3358 +                typename=typename, sortby=sortby, parent="generic",
3359 +                urldistro=urldistro, supported=supported,
3360 +                three_stage_install=three_stage_install, acpi=acpi, apic=apic,
3361 +                clock=clock, netmodel=netmodel, diskbus=diskbus,
3362 +                inputtype=inputtype, inputbus=inputbus, videomodel=videomodel,
3363 +                virtionet=virtionet, virtiodisk=virtiodisk,
3364 +                virtiommio=virtiommio, virtioconsole=virtioconsole,
3365 +                xen_disable_acpi=xen_disable_acpi, qemu_ga=qemu_ga)
3366 +
3367 +    def get_recommended_resources(self, arch):
3368 +        ret = {}
3369 +        def read_resource(resources, arch):
3370 +            for i in range(resources.get_length()):
3371 +                r = resources.get_nth(i)
3372 +                if r.get_architecture() == arch:
3373 +                    ret["ram"] = r.get_ram()
3374 +                    ret["cpu"] = r.get_cpu()
3375 +                    ret["n-cpus"] = r.get_n_cpus()
3376 +                    ret["storage"] = r.get_storage()
3377 +                    break
3378  
3379 -_add_type("windows", "Windows", clock="localtime", three_stage_install=True, inputtype="tablet", inputbus="usb", videomodel="vga")
3380 -_add_var("win2k", "Microsoft Windows 2000", sortby="mswin4", xen_disable_acpi=True, parent="windows")
3381 -_add_var("winxp", "Microsoft Windows XP", sortby="mswin5", supported=True, xen_disable_acpi=True, parent="windows")
3382 -_add_var("winxp64", "Microsoft Windows XP (x86_64)", supported=True, sortby="mswin564", parent="windows")
3383 -_add_var("win2k3", "Microsoft Windows Server 2003", supported=True, sortby="mswinserv2003", parent="windows")
3384 -_add_var("win2k8", "Microsoft Windows Server 2008 (or later)", supported=True, sortby="mswinserv2008", parent="windows")
3385 -_add_var("vista", "Microsoft Windows Vista", supported=True, sortby="mswin6", parent="windows")
3386 -_add_var("win7", "Microsoft Windows 7 (or later)", supported=True, sortby="mswin7", parent="windows")
3387 +        read_resource(self._os.get_recommended_resources(), "all")
3388 +        read_resource(self._os.get_recommended_resources(), arch)
3389  
3390 +        return ret
3391  
3392 +_add_type("linux", "Linux")
3393 +_add_type("windows", "Windows", clock="localtime", three_stage_install=True, inputtype="tablet", inputbus="usb", videomodel="vga")
3394  _add_type("solaris", "Solaris", clock="localtime")
3395 -_add_var("solaris9", "Sun Solaris 9", parent="solaris")
3396 -_add_var("solaris10", "Sun Solaris 10", inputtype="tablet", inputbus="usb", parent="solaris")
3397 -# https://bugzilla.redhat.com/show_bug.cgi?id=894017 claims tablet doesn't work for solaris 11
3398 -_add_var("solaris11", "Sun Solaris 11 (or later)", inputtype=None, inputbus=None, parent="solaris")
3399 -_add_var("opensolaris", "Sun OpenSolaris (or later)", inputtype="tablet", inputbus="usb", parent="solaris")
3400 -
3401  _add_type("unix", "UNIX")
3402 -# http: //www.nabble.com/Re%3A-Qemu%3A-bridging-on-FreeBSD-7.0-STABLE-p15919603.html
3403 -_add_var("freebsd6", "FreeBSD 6.x", netmodel="ne2k_pci", parent="unix")
3404 -_add_var("freebsd7", "FreeBSD 7.x", parent="freebsd6")
3405 -_add_var("freebsd8", "FreeBSD 8.x", supported=True, netmodel="e1000", parent="freebsd7")
3406 -_add_var("freebsd9", "FreeBSD 9.x", parent="freebsd8")
3407 -_add_var("freebsd10", "FreeBSD 10.x (or later)", supported=False, virtiodisk=True, virtionet=True, parent="freebsd9")
3408 -
3409 -# http: //calamari.reverse-dns.net: 980/cgi-bin/moin.cgi/OpenbsdOnQemu
3410 -# https: //www.redhat.com/archives/et-mgmt-tools/2008-June/msg00018.html
3411 -_add_var("openbsd4", "OpenBSD 4.x (or later)", netmodel="pcnet", parent="unix")
3412 -
3413 -
3414  _add_type("other", "Other")
3415 -_add_var("msdos", "MS-DOS", acpi=False, apic=False, parent="other")
3416 -_add_var("netware4", "Novell Netware 4", parent="other")
3417 -_add_var("netware5", "Novell Netware 5", parent="other")
3418 -_add_var("netware6", "Novell Netware 6 (or later)", parent="other")
3419  _add_var("generic", "Generic", supported=True, parent="other")
3420 +
3421 +
3422 +_os_data_loaded = False
3423 +_os_loader = None
3424 +
3425 +
3426 +def _get_os_loader():
3427 +    global _os_loader
3428 +    if _os_loader:
3429 +        return _os_loader
3430 +    _os_loader = libosinfo.Loader()
3431 +    _os_loader.process_default_path()
3432 +    return _os_loader
3433 +
3434 +
3435 +def _load_os_data():
3436 +    global _os_data_loaded
3437 +    if _os_data_loaded:
3438 +        return
3439 +    loader = _get_os_loader()
3440 +    db = loader.get_db()
3441 +    oslist = db.get_os_list()
3442 +    for os in range(oslist.get_length()):
3443 +        osi = _OsVariantOsInfo(oslist.get_nth(os))
3444 +        _allvariants[osi.name] = osi
3445 +    _os_data_loaded = True
3446 +
3447 +
3448 +def lookup_os(key):
3449 +    _load_os_data()
3450 +    key = _aliases.get(key) or key
3451 +    ret = _allvariants.get(key)
3452 +    if ret is None:
3453 +        return ret
3454 +    return ret
3455 +
3456 +
3457 +def list_os(list_types=False, typename=None,
3458 +            filtervars=None, only_supported=False,
3459 +            **kwargs):
3460 +    _load_os_data()
3461 +    sortmap = {}
3462 +    filtervars = filtervars or []
3463 +
3464 +    for key, osinfo in _allvariants.items():
3465 +        if list_types and not osinfo.is_type:
3466 +            continue
3467 +        if not list_types and osinfo.is_type:
3468 +            continue
3469 +        if typename and typename != osinfo.typename:
3470 +            continue
3471 +        if filtervars:
3472 +            filtervars = [lookup_os(x).name for x in filtervars]
3473 +            if osinfo.name not in filtervars:
3474 +                continue
3475 +        if only_supported and not osinfo.supported:
3476 +            continue
3477 +        sortmap[key] = osinfo
3478 +    return _sort(sortmap, **kwargs)
3479 +
3480 +
3481 +def lookup_osdict_key(variant, key, default):
3482 +    _load_os_data()
3483 +    val = _SENTINEL
3484 +    if variant is not None:
3485 +        os = lookup_os(variant)
3486 +        if not hasattr(os, key):
3487 +            raise ValueError("Unknown osdict property '%s'" % key)
3488 +        val = getattr(os, key)
3489 +        if isfunction(val):
3490 +            val = val()
3491 +    if val == _SENTINEL:
3492 +        val = default
3493 +    return val
3494 +
3495 +
3496 +def get_recommended_resources(variant, arch):
3497 +    _load_os_data()
3498 +    v = _allvariants.get(variant)
3499 +    if v is None:
3500 +        return None
3501 +
3502 +    return v.get_recommended_resources(arch)
3503 +
3504 +
3505 +def lookup_os_by_media(location):
3506 +    loader = _get_os_loader()
3507 +    media = libosinfo.Media.create_from_location(location, None)
3508 +    ret = loader.get_db().guess_os_from_media(media)
3509 +    if ret and len(ret) > 0 and ret[0]:
3510 +        return ret[0].get_short_id()
3511 +    return None
3512 diff -urN virt-manager-1.0.1/virtinst/osxml.py virt-manager/virtinst/osxml.py
3513 --- virt-manager-1.0.1/virtinst/osxml.py        2014-02-17 17:37:52.000000000 +0000
3514 +++ virt-manager/virtinst/osxml.py      2014-06-12 11:22:21.173891895 +0000
3515 @@ -20,6 +20,11 @@
3516  from virtinst.xmlbuilder import XMLBuilder, XMLProperty, XMLChildProperty
3517  
3518  
3519 +class _InitArg(XMLBuilder):
3520 +    _XML_ROOT_NAME = "initarg"
3521 +    val = XMLProperty(".")
3522 +
3523 +
3524  class _BootDevice(XMLBuilder):
3525      _XML_ROOT_NAME = "boot"
3526      dev = XMLProperty("./@dev")
3527 @@ -72,6 +77,18 @@
3528      _bootdevs = XMLChildProperty(_BootDevice)
3529      bootorder = property(_get_bootorder, _set_bootorder)
3530  
3531 +    initargs = XMLChildProperty(_InitArg)
3532 +    def add_initarg(self, val):
3533 +        obj = _InitArg(self.conn)
3534 +        obj.val = val
3535 +        self._add_child(obj)
3536 +    def set_initargs_string(self, argstring):
3537 +        import shlex
3538 +        for obj in self.initargs:
3539 +            self._remove_child(obj)
3540 +        for val in shlex.split(argstring):
3541 +            self.add_initarg(val)
3542 +
3543      enable_bootmenu = XMLProperty("./bootmenu/@enable", is_yesno=True)
3544      useserial = XMLProperty("./bios/@useserial", is_yesno=True)
3545  
3546 diff -urN virt-manager-1.0.1/virtinst/pollhelpers.py virt-manager/virtinst/pollhelpers.py
3547 --- virt-manager-1.0.1/virtinst/pollhelpers.py  2014-02-17 17:37:52.000000000 +0000
3548 +++ virt-manager/virtinst/pollhelpers.py        2014-06-12 11:22:21.174891895 +0000
3549 @@ -19,10 +19,12 @@
3550  
3551  import logging
3552  
3553 -from virtinst import util
3554  
3555 +# Debugging helper to force old style polling
3556 +_force_old_poll = False
3557  
3558 -def _new_poll_helper(origmap, typename, listfunc, keyfunc, buildfunc):
3559 +
3560 +def _new_poll_helper(origmap, typename, listfunc, buildfunc):
3561      """
3562      Helper for new style listAll* APIs
3563      """
3564 @@ -36,16 +38,16 @@
3565          logging.debug("Unable to list all %ss: %s", typename, e)
3566  
3567      for obj in objs:
3568 -        key = getattr(obj, keyfunc)()
3569 +        connkey = obj.name()
3570  
3571 -        if key not in origmap:
3572 +        if connkey not in origmap:
3573              # Object is brand new this period
3574 -            current[key] = buildfunc(obj, key)
3575 -            new[key] = current[key]
3576 +            current[connkey] = buildfunc(obj, connkey)
3577 +            new[connkey] = current[connkey]
3578          else:
3579              # Previously known object
3580 -            current[key] = origmap[key]
3581 -            del origmap[key]
3582 +            current[connkey] = origmap[connkey]
3583 +            del(origmap[connkey])
3584  
3585      return (origmap, new, current)
3586  
3587 @@ -55,7 +57,7 @@
3588                       lookup_func, build_func):
3589      """
3590      Helper routine for old style split API libvirt polling.
3591 -    @origmap: Pre-existing mapping of objects, with key->obj mapping.
3592 +    @origmap: Pre-existing mapping of objects, with connkey->obj mapping.
3593          objects must have an is_active and set_active API
3594      @typename: string describing type of objects we are polling for use
3595          in debug messages.
3596 @@ -63,7 +65,7 @@
3597      @inactive_list: Function that returns the list of inactive objects
3598      @lookup_func: Function to get an object handle for the passed name
3599      @build_func: Function that builds a new object class. It is passed
3600 -        args of (raw libvirt object, key (usually UUID))
3601 +        args of (raw libvirt object, connkey)
3602      """
3603      current = {}
3604      new = {}
3605 @@ -79,22 +81,26 @@
3606      except Exception, e:
3607          logging.debug("Unable to list inactive %ss: %s", typename, e)
3608  
3609 -    def check_obj(key):
3610 -        if key not in origmap:
3611 -            try:
3612 -                obj = lookup_func(key)
3613 -            except Exception, e:
3614 -                logging.debug("Could not fetch %s '%s': %s",
3615 -                              typename, key, e)
3616 -                return
3617 +    def check_obj(name):
3618 +        obj = None
3619 +        connkey = name
3620 +
3621 +        if connkey not in origmap:
3622 +            if connkey not in origmap:
3623 +                try:
3624 +                    obj = lookup_func(name)
3625 +                except Exception, e:
3626 +                    logging.debug("Could not fetch %s '%s': %s",
3627 +                                  typename, connkey, e)
3628 +                    return
3629  
3630              # Object is brand new this period
3631 -            current[key] = build_func(obj, key)
3632 -            new[key] = current[key]
3633 +            current[connkey] = build_func(obj, connkey)
3634 +            new[connkey] = current[connkey]
3635          else:
3636              # Previously known object
3637 -            current[key] = origmap[key]
3638 -            del origmap[key]
3639 +            current[connkey] = origmap[connkey]
3640 +            del(origmap[connkey])
3641  
3642      for name in newActiveNames + newInactiveNames:
3643          try:
3644 @@ -109,10 +115,9 @@
3645      name = "network"
3646  
3647      if backend.check_support(
3648 -            backend.SUPPORT_CONN_LISTALLNETWORKS):
3649 +        backend.SUPPORT_CONN_LISTALLNETWORKS) and not _force_old_poll:
3650          return _new_poll_helper(origmap, name,
3651 -                                backend.listAllNetworks,
3652 -                                "UUIDString", build_func)
3653 +                                backend.listAllNetworks, build_func)
3654      else:
3655          active_list = backend.listNetworks
3656          inactive_list = backend.listDefinedNetworks
3657 @@ -127,10 +132,9 @@
3658      name = "pool"
3659  
3660      if backend.check_support(
3661 -            backend.SUPPORT_CONN_LISTALLSTORAGEPOOLS):
3662 +        backend.SUPPORT_CONN_LISTALLSTORAGEPOOLS) and not _force_old_poll:
3663          return _new_poll_helper(origmap, name,
3664 -                                backend.listAllStoragePools,
3665 -                                "UUIDString", build_func)
3666 +                                backend.listAllStoragePools, build_func)
3667      else:
3668          active_list = backend.listStoragePools
3669          inactive_list = backend.listDefinedStoragePools
3670 @@ -145,10 +149,9 @@
3671      name = "volume"
3672  
3673      if backend.check_support(
3674 -        backend.SUPPORT_POOL_LISTALLVOLUMES, pool):
3675 +        backend.SUPPORT_POOL_LISTALLVOLUMES, pool) and not _force_old_poll:
3676          return _new_poll_helper(origmap, name,
3677 -                                pool.listAllVolumes,
3678 -                                "name", build_func)
3679 +                                pool.listAllVolumes, build_func)
3680      else:
3681          active_list = pool.listVolumes
3682          inactive_list = lambda: []
3683 @@ -162,10 +165,9 @@
3684      name = "interface"
3685  
3686      if backend.check_support(
3687 -            backend.SUPPORT_CONN_LISTALLINTERFACES):
3688 +        backend.SUPPORT_CONN_LISTALLINTERFACES) and not _force_old_poll:
3689          return _new_poll_helper(origmap, name,
3690 -                                backend.listAllInterfaces,
3691 -                                "name", build_func)
3692 +                                backend.listAllInterfaces, build_func)
3693      else:
3694          active_list = backend.listInterfaces
3695          inactive_list = backend.listDefinedInterfaces
3696 @@ -179,10 +181,9 @@
3697  def fetch_nodedevs(backend, origmap, build_func):
3698      name = "nodedev"
3699      if backend.check_support(
3700 -            backend.SUPPORT_CONN_LISTALLDEVICES):
3701 +        backend.SUPPORT_CONN_LISTALLDEVICES) and not _force_old_poll:
3702          return _new_poll_helper(origmap, name,
3703 -                                backend.listAllDevices,
3704 -                                "name", build_func)
3705 +                                backend.listAllDevices, build_func)
3706      else:
3707          active_list = lambda: backend.listDevices(None, 0)
3708          inactive_list = lambda: []
3709 @@ -205,8 +206,7 @@
3710      new = {}
3711  
3712      # Build list of previous vms with proper id/name mappings
3713 -    for uuid in origmap:
3714 -        vm = origmap[uuid]
3715 +    for vm in origmap.values():
3716          if vm.is_active():
3717              oldActiveIDs[vm.get_id()] = vm
3718          else:
3719 @@ -223,20 +223,20 @@
3720          logging.exception("Unable to list inactive domains: %s", e)
3721  
3722      def add_vm(vm):
3723 -        uuid = vm.get_uuid()
3724 +        connkey = vm.get_name()
3725  
3726 -        current[uuid] = vm
3727 -        del(origmap[uuid])
3728 +        current[connkey] = vm
3729 +        del(origmap[connkey])
3730  
3731 -    def check_new(rawvm, uuid):
3732 -        if uuid in origmap:
3733 -            vm = origmap[uuid]
3734 -            del(origmap[uuid])
3735 +    def check_new(rawvm, connkey):
3736 +        if connkey in origmap:
3737 +            vm = origmap[connkey]
3738 +            del(origmap[connkey])
3739          else:
3740 -            vm = build_func(rawvm, uuid)
3741 -            new[uuid] = vm
3742 +            vm = build_func(rawvm, connkey)
3743 +            new[connkey] = vm
3744  
3745 -        current[uuid] = vm
3746 +        current[connkey] = vm
3747  
3748      for _id in newActiveIDs:
3749          if _id in oldActiveIDs:
3750 @@ -247,9 +247,9 @@
3751              # Check if domain is brand new, or old one that changed state
3752              try:
3753                  vm = backend.lookupByID(_id)
3754 -                uuid = util.uuidstr(vm.UUID())
3755 +                connkey = vm.name()
3756  
3757 -                check_new(vm, uuid)
3758 +                check_new(vm, connkey)
3759              except:
3760                  logging.exception("Couldn't fetch domain id '%s'", _id)
3761  
3762 @@ -263,9 +263,9 @@
3763              # Check if domain is brand new, or old one that changed state
3764              try:
3765                  vm = backend.lookupByName(name)
3766 -                uuid = util.uuidstr(vm.UUID())
3767 +                connkey = name
3768  
3769 -                check_new(vm, uuid)
3770 +                check_new(vm, connkey)
3771              except:
3772                  logging.exception("Couldn't fetch domain '%s'", name)
3773  
3774 @@ -275,9 +275,8 @@
3775  def fetch_vms(backend, origmap, build_func):
3776      name = "domain"
3777      if backend.check_support(
3778 -            backend.SUPPORT_CONN_LISTALLDOMAINS):
3779 +        backend.SUPPORT_CONN_LISTALLDOMAINS):
3780          return _new_poll_helper(origmap, name,
3781 -                                backend.listAllDomains,
3782 -                                "UUIDString", build_func)
3783 +                                backend.listAllDomains, build_func)
3784      else:
3785          return _old_fetch_vms(backend, origmap, build_func)
3786 diff -urN virt-manager-1.0.1/virtinst/storage.py virt-manager/virtinst/storage.py
3787 --- virt-manager-1.0.1/virtinst/storage.py      2014-02-17 17:37:52.000000000 +0000
3788 +++ virt-manager/virtinst/storage.py    2014-06-12 11:22:21.174891895 +0000
3789 @@ -213,7 +213,7 @@
3790  
3791  
3792      @staticmethod
3793 -    def get_default_path(conn):
3794 +    def get_default_path(conn, build=True):
3795          """
3796          Return the default storage path. If there's a 'default' pool,
3797          report that. If there's no default pool, return the path we would
3798 @@ -230,7 +230,9 @@
3799          except:
3800              pass
3801  
3802 -        return StoragePool.build_default_pool(conn).target_path
3803 +        if build:
3804 +            return StoragePool.build_default_pool(conn).target_path
3805 +        return _get_default_pool_path(conn)
3806  
3807  
3808      @staticmethod
3809 diff -urN virt-manager-1.0.1/virtinst/support.py virt-manager/virtinst/support.py
3810 --- virt-manager-1.0.1/virtinst/support.py      2014-03-20 18:04:29.000000000 +0000
3811 +++ virt-manager/virtinst/support.py    2014-06-12 11:22:21.174891895 +0000
3812 @@ -293,6 +293,7 @@
3813  SUPPORT_CONN_POOL_GLUSTERFS = _make(version="1.2.0")
3814  SUPPORT_CONN_CPU_MODEL_NAMES = _make(function="virConnect.getCPUModelNames",
3815                                       run_args=("x86_64", 0))
3816 +SUPPORT_CONN_BARE_BACKINGSTORE = _make(version="1.2.4")
3817  
3818  
3819  # Domain checks
3820 diff -urN virt-manager-1.0.1/virtinst/urlfetcher.py virt-manager/virtinst/urlfetcher.py
3821 --- virt-manager-1.0.1/virtinst/urlfetcher.py   2014-03-06 17:52:00.000000000 +0000
3822 +++ virt-manager/virtinst/urlfetcher.py 2014-06-12 11:22:21.175891895 +0000
3823 @@ -151,9 +151,16 @@
3824          self.ftp = None
3825  
3826      def prepareLocation(self):
3827 -        url = urlparse.urlparse(self._make_path(""))
3828 -        self.ftp = ftplib.FTP(url[1])
3829 -        self.ftp.login()
3830 +        try:
3831 +            url = urlparse.urlparse(self._make_path(""))
3832 +            if not url[1]:
3833 +                raise ValueError(_("Invalid install location"))
3834 +            self.ftp = ftplib.FTP(url[1])
3835 +            self.ftp.login()
3836 +        except Exception, e:
3837 +            raise ValueError(_("Opening URL %s failed: %s.") %
3838 +                              (self.location, str(e)))
3839 +
3840  
3841      def hasFile(self, filename):
3842          path = self._make_path(filename)
3843 @@ -658,7 +665,7 @@
3844          """
3845          ret = None
3846          for osinfo in osdict.list_os(typename="linux"):
3847 -            if osinfo.name.startswith("fedora"):
3848 +            if osinfo.name.startswith("fedora") and "unknown" not in osinfo.name:
3849                  # First fedora* occurence should be the newest
3850                  ret = osinfo.name
3851                  break
3852 diff -urN virt-manager-1.0.1/virtinst/util.py virt-manager/virtinst/util.py
3853 --- virt-manager-1.0.1/virtinst/util.py 2014-02-28 18:01:32.000000000 +0000
3854 +++ virt-manager/virtinst/util.py       2014-06-12 11:22:21.175891895 +0000
3855 @@ -434,20 +434,6 @@
3856      return getattr(libvirt, key)
3857  
3858  
3859 -def uuidstr(rawuuid):
3860 -    hx = ['0', '1', '2', '3', '4', '5', '6', '7',
3861 -          '8', '9', 'a', 'b', 'c', 'd', 'e', 'f']
3862 -    uuid = []
3863 -    for i in range(16):
3864 -        uuid.append(hx[((ord(rawuuid[i]) >> 4) & 0xf)])
3865 -        uuid.append(hx[(ord(rawuuid[i]) & 0xf)])
3866 -        if i == 3 or i == 5 or i == 7 or i == 9:
3867 -            uuid.append('-')
3868 -    return "".join(uuid)
3869 -
3870 -
3871 -
3872 -
3873  def get_system_scratchdir(hvtype):
3874      if "VIRTINST_TEST_SUITE" in os.environ:
3875          return os.getcwd()
3876 @@ -495,7 +481,7 @@
3877      ret = ""
3878      try:
3879          # We don't want to depend on glib for virt-install
3880 -        from gi.repository import GLib  # pylint: disable=E0611
3881 +        from gi.repository import GLib
3882          ret = GLib.get_user_cache_dir()
3883      except ImportError:
3884          pass
3885 diff -urN virt-manager-1.0.1/virtinst/virtimage.py virt-manager/virtinst/virtimage.py
3886 --- virt-manager-1.0.1/virtinst/virtimage.py    2014-03-22 12:36:51.000000000 +0000
3887 +++ virt-manager/virtinst/virtimage.py  2014-06-12 11:22:21.175891895 +0000
3888 @@ -53,7 +53,7 @@
3889          self.descr = None
3890          self.version = None
3891          self.release = None
3892 -        if not node is None:
3893 +        if node is not None:
3894              self.parseXML(node)
3895  
3896      def abspath(self, p):
3897 @@ -97,7 +97,7 @@
3898          self.memory = None
3899          self.interface = 0
3900          self.graphics = None
3901 -        if not node is None:
3902 +        if node is not None:
3903              self.parseXML(node)
3904  
3905      def parseXML(self, node):
3906 @@ -151,7 +151,7 @@
3907          self.drives = []
3908          self.arch = None
3909          self.features = ImageFeatures()
3910 -        if not node is None:
3911 +        if node is not None:
3912              self.parseXML(node)
3913  
3914      def parseXML(self, node):
3915 @@ -221,7 +221,7 @@
3916          self.size = None
3917          self.use = None
3918          self.csum = {}
3919 -        if not node is None:
3920 +        if node is not None:
3921              self.parseXML(node)
3922  
3923      def parseXML(self, node):
3924 @@ -260,7 +260,7 @@
3925          if hashlib:
3926              if "sha256" in self.csum:
3927                  csumvalue = self.csum["sha256"]
3928 -                m = hashlib.sha256()  # pylint: disable=E1101
3929 +                m = hashlib.sha256()
3930  
3931              elif "sha1" in self.csum:
3932                  csumvalue = self.csum["sha1"]
3933 diff -urN virt-manager-1.0.1/virtinst/xmlbuilder.py virt-manager/virtinst/xmlbuilder.py
3934 --- virt-manager-1.0.1/virtinst/xmlbuilder.py   2014-03-06 17:52:00.000000000 +0000
3935 +++ virt-manager/virtinst/xmlbuilder.py 2014-06-12 11:22:21.176891895 +0000
3936 @@ -29,7 +29,7 @@
3937  from virtinst import util
3938  
3939  
3940 -# pylint: disable=W0212
3941 +# pylint: disable=protected-access
3942  # This whole file is calling around into non-public functions that we
3943  # don't want regular API users to touch
3944  
3945 diff -urN virt-manager-1.0.1/virt-install virt-manager/virt-install
3946 --- virt-manager-1.0.1/virt-install     2014-03-22 16:27:02.000000000 +0000
3947 +++ virt-manager/virt-install   2014-06-12 11:22:21.151891895 +0000
3948 @@ -36,9 +36,6 @@
3949  ##############################
3950  
3951  install_methods = "--location URL, --cdrom CD/ISO, --pxe, --import, --boot hd|cdrom|..."
3952 -install_missing = (_("An install method must be specified\n(%(methods)s)") %
3953 -                   {"methods" : install_methods})
3954 -disk_missing = _("--disk storage must be specified (override with --nodisks)")
3955  
3956  
3957  def install_specified(location, cdpath, pxe, import_install):
3958 @@ -263,13 +260,17 @@
3959          not storage_specified(options.disk,
3960                                options.nodisks,
3961                                options.filesystem)):
3962 -        msg += "\n" + disk_missing
3963 +        msg += "\n" + (
3964 +            _("--disk storage must be specified (override with --nodisks)"))
3965  
3966      if (not guest.os.is_container() and
3967 +        not (options.xmlonly or options.xmlstep) and
3968          (not install_specified(options.location, options.cdrom,
3969                                 options.pxe, options.import_install)) and
3970          (not cdrom_specified(guest, options.disk))):
3971 -        msg += "\n" + install_missing
3972 +        msg += "\n" + (
3973 +            _("An install method must be specified\n(%(methods)s)") %
3974 +             {"methods" : install_methods})
3975  
3976      if msg:
3977          fail(msg)
3978 @@ -416,6 +417,8 @@
3979              fail(_("A disk device must be specified with --import."))
3980          options.import_install = True
3981          instclass = virtinst.ImportInstaller
3982 +    elif options.xmlstep or options.xmlonly:
3983 +        instclass = virtinst.ImportInstaller
3984      else:
3985          instclass = virtinst.DistroInstaller
3986  
3987 @@ -838,13 +841,6 @@
3988  
3989      check_cdrom_option_error(options)
3990  
3991 -    if options.distro_variant == "list":
3992 -        logging.debug("OS list requested")
3993 -        for t in virtinst.osdict.list_os(list_types=True):
3994 -            for v in virtinst.osdict.list_os(typename=t.name):
3995 -                print "%-20s : %s" % (v.name, v.label)
3996 -        return 0
3997 -
3998      cli.set_force(options.force)
3999      cli.set_prompt(options.prompt)
4000  
4001 diff -urN virt-manager-1.0.1/virt-manager virt-manager/virt-manager
4002 --- virt-manager-1.0.1/virt-manager     2014-03-22 16:27:02.000000000 +0000
4003 +++ virt-manager/virt-manager   2014-06-12 11:22:21.151891895 +0000
4004 @@ -26,10 +26,8 @@
4005  import sys
4006  import traceback
4007  
4008 -# pylint: disable=E0611
4009  from gi.repository import GObject
4010  from gi.repository import LibvirtGLib
4011 -# pylint: enable=E0611
4012  
4013  from virtinst import util as util
4014  from virtinst import cli as virtinstcli
4015 @@ -62,7 +60,7 @@
4016      # tty. This prevents libvirt's SSH tunnels from prompting
4017      # for user input if SSH keys/agent aren't configured.
4018      if os.fork() != 0:
4019 -        os._exit(0)  # pylint: disable=W0212
4020 +        os._exit(0)  # pylint: disable=protected-access
4021  
4022      os.setsid()
4023  
4024 @@ -123,7 +121,7 @@
4025      return parser.parse_known_args()
4026  
4027  
4028 -def launch_specific_window(engine, show, uri, uuid):
4029 +def launch_specific_window(engine, show, uri, clistr):
4030      if not show:
4031          return
4032  
4033 @@ -131,11 +129,11 @@
4034      if show == 'creator':
4035          engine.show_domain_creator(uri)
4036      elif show == 'editor':
4037 -        engine.show_domain_editor(uri, uuid)
4038 +        engine.show_domain_editor(uri, clistr)
4039      elif show == 'performance':
4040 -        engine.show_domain_performance(uri, uuid)
4041 +        engine.show_domain_performance(uri, clistr)
4042      elif show == 'console':
4043 -        engine.show_domain_console(uri, uuid)
4044 +        engine.show_domain_console(uri, clistr)
4045      elif show == 'summary':
4046          engine.show_host_summary(uri)
4047  
4048 @@ -174,7 +172,7 @@
4049      origargv = sys.argv
4050      try:
4051          sys.argv = origargv[:1] + leftovers[:]
4052 -        from gi.repository import Gtk  # pylint: disable=E0611
4053 +        from gi.repository import Gtk
4054          leftovers = sys.argv[1:]
4055  
4056          # This will error if Gtk wasn't correctly initialized
4057 diff -urN virt-manager-1.0.1/virtManager/addhardware.py virt-manager/virtManager/addhardware.py
4058 --- virt-manager-1.0.1/virtManager/addhardware.py       2014-03-22 22:05:09.000000000 +0000
4059 +++ virt-manager/virtManager/addhardware.py     2014-06-12 11:22:21.153891895 +0000
4060 @@ -22,10 +22,8 @@
4061  import traceback
4062  import collections
4063  
4064 -# pylint: disable=E0611
4065  from gi.repository import Gtk
4066  from gi.repository import Gdk
4067 -# pylint: enable=E0611
4068  
4069  import virtinst
4070  from virtinst import (VirtualChannelDevice, VirtualParallelDevice,
4071 @@ -44,22 +42,24 @@
4072  from virtManager.baseclass import vmmGObjectUI
4073  from virtManager.addstorage import vmmAddStorage
4074  
4075 -PAGE_ERROR = 0
4076 -PAGE_DISK = 1
4077 -PAGE_NETWORK = 2
4078 -PAGE_INPUT = 3
4079 -PAGE_GRAPHICS = 4
4080 -PAGE_SOUND = 5
4081 -PAGE_HOSTDEV = 6
4082 -PAGE_CHAR = 7
4083 -PAGE_VIDEO = 8
4084 -PAGE_WATCHDOG = 9
4085 -PAGE_FILESYSTEM = 10
4086 -PAGE_SMARTCARD = 11
4087 -PAGE_USBREDIR = 12
4088 -PAGE_TPM = 13
4089 -PAGE_RNG = 14
4090 -PAGE_PANIC = 15
4091 +(PAGE_ERROR,
4092 +PAGE_DISK,
4093 +PAGE_CONTROLLER,
4094 +PAGE_NETWORK,
4095 +PAGE_INPUT,
4096 +PAGE_GRAPHICS,
4097 +PAGE_SOUND,
4098 +PAGE_HOSTDEV,
4099 +PAGE_CHAR,
4100 +PAGE_VIDEO,
4101 +PAGE_WATCHDOG,
4102 +PAGE_FILESYSTEM,
4103 +PAGE_SMARTCARD,
4104 +PAGE_USBREDIR,
4105 +PAGE_TPM,
4106 +PAGE_RNG,
4107 +PAGE_PANIC,
4108 +) = range(0, 17)
4109  
4110  
4111  class vmmAddHardware(vmmGObjectUI):
4112 @@ -113,6 +113,8 @@
4113              "on_rng_type_changed": self.change_rng,
4114              "on_rng_backend_mode_changed": self.change_rng,
4115              "on_rng_backend_type_changed": self.change_rng,
4116 +
4117 +            "on_controller_type_changed": self.populate_controller_model,
4118          })
4119          self.bind_escape_key_close()
4120  
4121 @@ -314,6 +316,19 @@
4122          combo = self.widget("panic-type")
4123          self.build_panic_address_type(combo)
4124  
4125 +        # Controller widgets
4126 +        combo = self.widget("controller-type")
4127 +        target_model = Gtk.ListStore(str, str)
4128 +        combo.set_model(target_model)
4129 +        uiutil.set_combo_text_column(combo, 1)
4130 +        combo = self.widget("controller-model")
4131 +        target_model = Gtk.ListStore(str, str)
4132 +        combo.set_model(target_model)
4133 +        uiutil.set_combo_text_column(combo, 1)
4134 +        # FIXME: we should deal with controller model
4135 +        combo.set_visible(False)
4136 +        self.widget("controller-model-label").set_visible(False)
4137 +
4138          # Available HW options
4139          is_local = not self.conn.is_remote()
4140          is_storage_capable = self.conn.is_storage_capable()
4141 @@ -333,6 +348,7 @@
4142  
4143          add_hw_option("Storage", "drive-harddisk", PAGE_DISK, have_storage,
4144                        have_storage and storage_tooltip or None)
4145 +        add_hw_option("Controller", "device_pci", PAGE_CONTROLLER, True, None)
4146          add_hw_option("Network", "network-idle", PAGE_NETWORK, True, None)
4147          add_hw_option("Input", "input-mouse", PAGE_INPUT, self.vm.is_hvm(),
4148                        _("Not supported for this guest type."))
4149 @@ -421,6 +437,7 @@
4150          self.widget("char-target-type").set_active(0)
4151          self.widget("char-target-name").set_active(0)
4152          self.widget("char-path").set_text("")
4153 +        self.widget("char-channel").set_text("")
4154          self.widget("char-host").set_text("127.0.0.1")
4155          self.widget("char-port").set_value(4555)
4156          self.widget("char-bind-host").set_text("127.0.0.1")
4157 @@ -455,6 +472,9 @@
4158          # Panic device params
4159          self.widget("panic-iobase").set_text("0x505")
4160  
4161 +        # Controller device params
4162 +        self.populate_controller_type()
4163 +
4164          self.set_hw_selection(0)
4165  
4166  
4167 @@ -719,6 +739,27 @@
4168                      combo.set_active_iter(row.iter)
4169                      break
4170  
4171 +    @staticmethod
4172 +    def populate_controller_model_combo(combo, controller_type, widget_name, add_default=False):
4173 +        model = combo.get_model()
4174 +        model.clear()
4175 +
4176 +        if controller_type == virtinst.VirtualController.TYPE_USB:
4177 +            model.append(["default", "Default"])
4178 +            model.append(["ich9-ehci1", "USB 2"])
4179 +            model.append(["nec-xhci", "USB 3"])
4180 +            if widget_name is not None:
4181 +                widget_name.set_sensitive(False)
4182 +        elif controller_type == virtinst.VirtualController.TYPE_SCSI:
4183 +            model.append(["default", "Default"])
4184 +            model.append(["virtio-scsi", "VirtIO SCSI"])
4185 +        else:
4186 +            if add_default:
4187 +                model.append([None, "Default"])
4188 +                combo.set_sensitive(False)
4189 +            if widget_name is not None:
4190 +                widget_name.set_sensitive(True)
4191 +
4192  
4193      #########################
4194      # UI population methods #
4195 @@ -813,6 +854,30 @@
4196          if not create:
4197              format_list.get_child().set_text("")
4198  
4199 +    def populate_controller_type(self):
4200 +        widget = self.widget("controller-type")
4201 +        model = widget.get_model()
4202 +        model.clear()
4203 +
4204 +        for t in VirtualController.TYPES:
4205 +            if t == VirtualController.TYPE_PCI:
4206 +                continue
4207 +            model.append([t, VirtualController.pretty_type(t)])
4208 +
4209 +        if len(model) > 0:
4210 +            widget.set_active(0)
4211 +
4212 +    def populate_controller_model(self, src):
4213 +        ignore = src
4214 +
4215 +        controller_type = self.get_config_controller_type()
4216 +        modellist = self.widget("controller-model")
4217 +        modellist.set_sensitive(True)
4218 +        self.populate_controller_model_combo(modellist, controller_type, None, True)
4219 +
4220 +        if len(modellist.get_model()) > 0:
4221 +            modellist.set_active(0)
4222 +
4223  
4224      ########################
4225      # get_config_* methods #
4226 @@ -905,12 +970,12 @@
4227  
4228      # Input getters
4229      def get_config_input(self):
4230 -        row = uiutil.get_list_selection(self.widget("input-type"))
4231 +        row = uiutil.get_list_selection(self.widget("input-type"), None)
4232          return row[1], row[2]
4233  
4234      # Network getters
4235      def get_config_net_model(self):
4236 -        return uiutil.get_list_selection(self.widget("net-model"))[0]
4237 +        return uiutil.get_list_selection(self.widget("net-model"), 0)
4238  
4239      def get_config_macaddr(self):
4240          macaddr = None
4241 @@ -933,7 +998,7 @@
4242          return usb_info
4243  
4244      def get_config_host_device_info(self):
4245 -        return uiutil.get_list_selection(self.widget("host-device"))
4246 +        return uiutil.get_list_selection(self.widget("host-device"), None)
4247  
4248      # Video Getters
4249      def get_config_video_model(self):
4250 @@ -1008,6 +1073,13 @@
4251      def get_config_rng_backend_mode(self):
4252          return uiutil.get_list_selection(self.widget("rng-backend-mode"), 0)
4253  
4254 +    # CONTROLLER getters
4255 +    def get_config_controller_type(self):
4256 +        return uiutil.get_list_selection(self.widget("controller-type"), 0)
4257 +
4258 +    def get_config_controller_model(self):
4259 +        return uiutil.get_list_selection(self.widget("controller-model"), 0)
4260 +
4261      ################
4262      # UI listeners #
4263      ################
4264 @@ -1016,7 +1088,7 @@
4265          uiutil.set_list_selection(self.widget("hw-list"), page)
4266  
4267      def get_hw_selection(self):
4268 -        return uiutil.get_list_selection(self.widget("hw-list"))
4269 +        return uiutil.get_list_selection(self.widget("hw-list"), None)
4270  
4271      def update_char_device_type_model(self):
4272          stable_blacklist = ["pipe", "udp"]
4273 @@ -1052,6 +1124,8 @@
4274          sens = row[3]
4275          msg = row[4] or ""
4276  
4277 +        self.widget("create-finish").set_sensitive(sens)
4278 +
4279          if not sens:
4280              page = PAGE_ERROR
4281              self.widget("hardware-info").set_text(msg)
4282 @@ -1113,6 +1187,8 @@
4283              return _("Error")
4284          if page == PAGE_DISK:
4285              return _("Storage")
4286 +        if page == PAGE_CONTROLLER:
4287 +            return _("Controller")
4288          if page == PAGE_NETWORK:
4289              return _("Network")
4290          if page == PAGE_INPUT:
4291 @@ -1184,6 +1260,9 @@
4292          settype = None
4293          if text == VirtualChannelDevice.CHANNEL_NAME_SPICE:
4294              settype = "spicevmc"
4295 +        elif text == VirtualChannelDevice.CHANNEL_NAME_SPICE_WEBDAV:
4296 +            settype = "spiceport"
4297 +            self.widget("char-channel").set_text(text)
4298          elif (text == VirtualChannelDevice.CHANNEL_NAME_QEMUGA or
4299                text == VirtualChannelDevice.CHANNEL_NAME_LIBGUESTFS):
4300              settype = "unix"
4301 @@ -1196,6 +1275,7 @@
4302  
4303          char_widget_mappings = {
4304              "source_path" : "char-path",
4305 +            "source_channel" : "char-channel",
4306              "source_mode" : "char-mode",
4307              "source_host" : "char-host",
4308              "bind_host" : "char-bind-host",
4309 @@ -1366,6 +1446,8 @@
4310              return True
4311          elif page_num == PAGE_DISK:
4312              return self.validate_page_storage()
4313 +        elif page_num == PAGE_CONTROLLER:
4314 +            return self.validate_page_controller()
4315          elif page_num == PAGE_NETWORK:
4316              return self.validate_page_network()
4317          elif page_num == PAGE_INPUT:
4318 @@ -1581,6 +1663,7 @@
4319          devclass.type = devtype
4320  
4321          source_path = self.widget("char-path").get_text()
4322 +        source_channel = self.widget("char-channel").get_text()
4323          source_mode = uiutil.get_list_selection(modebox, 0)
4324          source_host = self.widget("char-host").get_text()
4325          bind_host = self.widget("char-bind-host").get_text()
4326 @@ -1605,6 +1688,7 @@
4327  
4328          value_mappings = {
4329              "source_path" : source_path,
4330 +            "source_channel" : source_channel,
4331              "source_mode" : source_mode,
4332              "source_host" : source_host,
4333              "source_port" : source_port,
4334 @@ -1719,6 +1803,20 @@
4335          except Exception, e:
4336              return self.err.val_err(_("Panic device parameter error"), e)
4337  
4338 +    def validate_page_controller(self):
4339 +        conn = self.conn.get_backend()
4340 +        controller_type = self.get_config_controller_type()
4341 +        self._dev = VirtualController(conn)
4342 +
4343 +        controllers = self.vm.get_controller_devices()
4344 +        controller_num = [x for x in controllers if
4345 +                (x.type == controller_type)]
4346 +        if len(controller_num) > 0:
4347 +            index_new = max([x.index for x in controller_num]) + 1
4348 +            self._dev.index = index_new
4349 +
4350 +        self._dev.type = controller_type
4351 +
4352      def validate_page_rng(self):
4353          conn = virtinst.VirtualRNGDevice.BACKEND_MODE_CONNECT in \
4354                 self.get_config_rng_backend_mode()
4355 diff -urN virt-manager-1.0.1/virtManager/addstorage.py virt-manager/virtManager/addstorage.py
4356 --- virt-manager-1.0.1/virtManager/addstorage.py        2014-03-12 21:21:28.000000000 +0000
4357 +++ virt-manager/virtManager/addstorage.py      2014-06-12 11:22:21.153891895 +0000
4358 @@ -21,10 +21,8 @@
4359  import os
4360  import statvfs
4361  
4362 -# pylint: disable=E0611
4363  from gi.repository import GObject
4364  from gi.repository import Gtk
4365 -# pylint: enable=E0611
4366  
4367  import virtinst
4368  from virtManager import uiutil
4369 @@ -258,7 +256,8 @@
4370          return path
4371  
4372      def is_default_storage(self):
4373 -        return self.widget("config-storage-create").get_active()
4374 +        return self.widget("config-storage-create").is_visible() and \
4375 +               self.widget("config-storage-create").get_active()
4376  
4377      def _check_ideal_path(self, path, vmname, collidelist):
4378          # See if the ideal disk path (/default/pool/vmname.img)
4379 @@ -320,7 +319,7 @@
4380                  if is_default:
4381                      path = self.get_default_path(vmname, collidelist)
4382                  else:
4383 -                    path = self.widget("config-storage-entry").get_text()
4384 +                    path = self.widget("config-storage-entry").get_text().strip()
4385  
4386              if is_default:
4387                  path = self._check_ideal_path(path, vmname, collidelist)
4388 diff -urN virt-manager-1.0.1/virtManager/asyncjob.py virt-manager/virtManager/asyncjob.py
4389 --- virt-manager-1.0.1/virtManager/asyncjob.py  2014-03-22 14:20:45.000000000 +0000
4390 +++ virt-manager/virtManager/asyncjob.py        2014-06-12 11:22:21.153891895 +0000
4391 @@ -22,11 +22,9 @@
4392  import threading
4393  import traceback
4394  
4395 -# pylint: disable=E0611
4396  from gi.repository import Gdk
4397  from gi.repository import GLib
4398  from gi.repository import Gtk
4399 -# pylint: enable=E0611
4400  
4401  import libvirt
4402  import urlgrabber
4403 @@ -191,7 +189,6 @@
4404          self._bg_thread = threading.Thread(target=cb_wrapper,
4405                                             args=[callback, self] + args)
4406          self._bg_thread.daemon = True
4407 -        logging.debug("Creating async job for function cb=%s", callback)
4408  
4409          self.builder.connect_signals({
4410              "on_async_job_delete_event" : self._on_window_delete,
4411 diff -urN virt-manager-1.0.1/virtManager/autodrawer.py virt-manager/virtManager/autodrawer.py
4412 --- virt-manager-1.0.1/virtManager/autodrawer.py        2014-03-22 14:33:09.000000000 +0000
4413 +++ virt-manager/virtManager/autodrawer.py      2014-06-12 11:22:21.153891895 +0000
4414 @@ -22,18 +22,12 @@
4415  # MA 02110-1301 USA.
4416  #
4417  
4418 -# pylint: disable=E0611
4419  from gi.repository import Gdk
4420  from gi.repository import GLib
4421  from gi.repository import Gtk
4422 -# pylint: enable=E0611
4423  
4424  from virtManager import uiutil
4425  
4426 -# pylint: disable=E1101
4427 -# pylint can't detect functions we inheirit from Gtk, ex:
4428 -# OverBox.set_over: Instance of 'OverBox' has no 'remove' member
4429 -
4430  # pylint: disable=arguments-differ
4431  # Newer pylint can detect, but warns that overridden arguments are wrong
4432  
4433 @@ -247,8 +241,8 @@
4434          # There's something weird here with destroying this gdk window,
4435          # then destroying the over/under widgets. Error seems harmless
4436          # but lets shut it up anyways.
4437 -        #self.underWin.destroy()
4438 -        #self.overWin.destroy()
4439 +        # self.underWin.destroy()
4440 +        # self.overWin.destroy()
4441  
4442          self.underWin = None
4443          self.overWin = None
4444 diff -urN virt-manager-1.0.1/virtManager/baseclass.py virt-manager/virtManager/baseclass.py
4445 --- virt-manager-1.0.1/virtManager/baseclass.py 2014-03-22 14:59:03.000000000 +0000
4446 +++ virt-manager/virtManager/baseclass.py       2014-06-12 11:22:21.153891895 +0000
4447 @@ -25,12 +25,10 @@
4448  
4449  from virtManager import config
4450  
4451 -# pylint: disable=E0611
4452  from gi.repository import Gdk
4453  from gi.repository import GLib
4454  from gi.repository import GObject
4455  from gi.repository import Gtk
4456 -# pylint: enable=E0611
4457  
4458  
4459  class vmmGObject(GObject.GObject):
4460 diff -urN virt-manager-1.0.1/virtManager/choosecd.py virt-manager/virtManager/choosecd.py
4461 --- virt-manager-1.0.1/virtManager/choosecd.py  2014-03-20 18:04:29.000000000 +0000
4462 +++ virt-manager/virtManager/choosecd.py        2014-06-12 11:22:21.153891895 +0000
4463 @@ -20,9 +20,7 @@
4464  
4465  import logging
4466  
4467 -# pylint: disable=E0611
4468  from gi.repository import GObject
4469 -# pylint: enable=E0611
4470  
4471  from virtManager.baseclass import vmmGObjectUI
4472  from virtManager.mediadev import MEDIA_FLOPPY
4473 diff -urN virt-manager-1.0.1/virtManager/clone.py virt-manager/virtManager/clone.py
4474 --- virt-manager-1.0.1/virtManager/clone.py     2014-02-17 17:37:52.000000000 +0000
4475 +++ virt-manager/virtManager/clone.py   2014-06-12 11:22:21.154891895 +0000
4476 @@ -21,10 +21,8 @@
4477  import logging
4478  import os
4479  
4480 -# pylint: disable=E0611
4481  from gi.repository import Gtk
4482  from gi.repository import Gdk
4483 -# pylint: enable=E0611
4484  
4485  from virtManager import uiutil
4486  from virtManager.baseclass import vmmGObjectUI
4487 @@ -306,7 +304,11 @@
4488                  label = _("Usermode")
4489  
4490              elif net_type == VirtualNetworkInterface.TYPE_VIRTUAL:
4491 -                net = self.orig_vm.conn.get_net_by_name(net_dev)
4492 +                net = None
4493 +                for netobj in self.orig_vm.conn.list_nets():
4494 +                    if netobj.get_name() == net_dev:
4495 +                        net = netobj
4496 +                        break
4497  
4498                  if net:
4499                      label = ""
4500 diff -urN virt-manager-1.0.1/virtManager/config.py virt-manager/virtManager/config.py
4501 --- virt-manager-1.0.1/virtManager/config.py    2014-03-10 18:54:58.000000000 +0000
4502 +++ virt-manager/virtManager/config.py  2014-06-12 11:22:21.154891895 +0000
4503 @@ -20,11 +20,9 @@
4504  import os
4505  import logging
4506  
4507 -# pylint: disable=E0611
4508  from gi.repository import Gio
4509  from gi.repository import GLib
4510  from gi.repository import Gtk
4511 -# pylint: enable=E0611
4512  
4513  from virtinst import CPU
4514  from virtManager.keyring import vmmKeyring, vmmSecret
4515 @@ -152,7 +150,7 @@
4516          self.conf = SettingsWrapper("org.virt-manager.virt-manager")
4517  
4518          # We don't create it straight away, since we don't want
4519 -        # to block the app pending user authorizaation to access
4520 +        # to block the app pending user authorization to access
4521          # the keyring
4522          self.keyring = None
4523  
4524 @@ -163,6 +161,7 @@
4525          self.libvirt_packages = cliconfig.libvirt_packages
4526          self.askpass_package = cliconfig.askpass_package
4527          self.default_graphics_from_config = cliconfig.default_graphics
4528 +        self.with_bhyve = cliconfig.with_bhyve
4529          self.cli_usbredir = None
4530  
4531          self.default_storage_format_from_config = "qcow2"
4532 @@ -183,7 +182,7 @@
4533      def check_inspection(self):
4534          try:
4535              # Check we can open the Python guestfs module.
4536 -            from guestfs import GuestFS  # pylint: disable=F0401
4537 +            from guestfs import GuestFS  # pylint: disable=import-error
4538              GuestFS(close_on_exit=False)
4539              return True
4540          except:
4541 diff -urN virt-manager-1.0.1/virtManager/connectauth.py virt-manager/virtManager/connectauth.py
4542 --- virt-manager-1.0.1/virtManager/connectauth.py       2014-02-17 17:37:52.000000000 +0000
4543 +++ virt-manager/virtManager/connectauth.py     2014-06-12 11:22:21.154891895 +0000
4544 @@ -18,10 +18,8 @@
4545  # MA 02110-1301 USA.
4546  #
4547  
4548 -# pylint: disable=E0611
4549  from gi.repository import GLib
4550  from gi.repository import Gio
4551 -# pylint: enable=E0611
4552  
4553  import logging
4554  import os
4555 @@ -81,7 +79,7 @@
4556      """
4557      Libvirt openAuth callback for username/password credentials
4558      """
4559 -    from gi.repository import Gtk  # pylint: disable=E0611
4560 +    from gi.repository import Gtk
4561  
4562      dialog = Gtk.Dialog("Authentication required", None, 0,
4563                          (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
4564 diff -urN virt-manager-1.0.1/virtManager/connection.py virt-manager/virtManager/connection.py
4565 --- virt-manager-1.0.1/virtManager/connection.py        2014-03-22 22:13:52.000000000 +0000
4566 +++ virt-manager/virtManager/connection.py      2014-06-12 11:22:21.155891895 +0000
4567 @@ -18,9 +18,7 @@
4568  # MA 02110-1301 USA.
4569  #
4570  
4571 -# pylint: disable=E0611
4572  from gi.repository import GObject
4573 -# pylint: enable=E0611
4574  
4575  import logging
4576  import os
4577 @@ -46,6 +44,10 @@
4578  from virtManager.storagepool import vmmStoragePool
4579  
4580  
4581 +# debugging helper to turn off events
4582 +_disable_libvirt_events = False
4583 +
4584 +
4585  class vmmConnection(vmmGObject):
4586      __gsignals__ = {
4587          "vm-added": (GObject.SignalFlags.RUN_FIRST, None, [str]),
4588 @@ -86,9 +88,10 @@
4589              self._uri = "xen:///"
4590  
4591          self.state = self.STATE_DISCONNECTED
4592 -        self.connectThread = None
4593 -        self.connectError = None
4594 +        self._connectThread = None
4595 +        self._connectError = None
4596          self._backend = virtinst.VirtualConnection(self._uri)
4597 +        self._closing = False
4598  
4599          self._caps = None
4600          self._caps_xml = None
4601 @@ -99,26 +102,26 @@
4602          self._nodedev_capable = None
4603  
4604          self.using_domain_events = False
4605 -        self._domain_cb_id = None
4606 +        self._domain_cb_ids = []
4607          self.using_network_events = False
4608 -        self._network_cb_id = None
4609 +        self._network_cb_ids = []
4610  
4611          self._xml_flags = {}
4612  
4613          # Physical network interfaces: name -> virtinst.NodeDevice
4614 -        self.nodedevs = {}
4615 +        self._nodedevs = {}
4616          # Physical network interfaces: name (eth0) -> vmmNetDevice
4617 -        self.netdevs = {}
4618 +        self._netdevs = {}
4619          # Physical media devices: vmmMediaDevice.key -> vmmMediaDevice
4620 -        self.mediadevs = {}
4621 +        self._mediadevs = {}
4622          # Connection Storage pools: name -> vmmInterface
4623 -        self.interfaces = {}
4624 -        # Connection Storage pools: UUID -> vmmStoragePool
4625 -        self.pools = {}
4626 -        # Virtual networks UUUID -> vmmNetwork object
4627 -        self.nets = {}
4628 -        # Virtual machines. UUID -> vmmDomain object
4629 -        self.vms = {}
4630 +        self._interfaces = {}
4631 +        # Connection Storage pools: name -> vmmStoragePool
4632 +        self._pools = {}
4633 +        # Virtual networks: name -> vmmNetwork object
4634 +        self._nets = {}
4635 +        # Virtual machines: name -> vmmDomain object
4636 +        self._vms = {}
4637          # Resource utilization statistics
4638          self.record = []
4639          self.hostinfo = None
4640 @@ -168,14 +171,14 @@
4641      def _init_virtconn(self):
4642          self._backend.cb_fetch_all_guests = (
4643              lambda: [obj.get_xmlobj(refresh_if_nec=False)
4644 -                     for obj in self.vms.values()])
4645 +                     for obj in self._vms.values()])
4646          self._backend.cb_fetch_all_pools = (
4647              lambda: [obj.get_xmlobj(refresh_if_nec=False)
4648 -                     for obj in self.pools.values()])
4649 +                     for obj in self._pools.values()])
4650  
4651          def fetch_all_vols():
4652              ret = []
4653 -            for pool in self.pools.values():
4654 +            for pool in self._pools.values():
4655                  for vol in pool.get_volumes(refresh=False).values():
4656                      try:
4657                          ret.append(vol.get_xmlobj(refresh_if_nec=False))
4658 @@ -287,14 +290,14 @@
4659          handle_id = vmmGObject.connect(self, name, callback, *args)
4660  
4661          if name == "vm-added":
4662 -            for uuid in self.vms.keys():
4663 -                self.emit("vm-added", uuid)
4664 +            for connkey in self._vms.keys():
4665 +                self.emit("vm-added", connkey)
4666          elif name == "mediadev-added":
4667 -            for dev in self.mediadevs.values():
4668 +            for dev in self._mediadevs.values():
4669                  self.emit("mediadev-added", dev)
4670          elif name == "nodedev-added":
4671 -            for key in self.nodedevs.keys():
4672 -                self.emit("nodedev-added", key)
4673 +            for connkey in self._nodedevs.keys():
4674 +                self.emit("nodedev-added", connkey)
4675  
4676          return handle_id
4677  
4678 @@ -581,6 +584,23 @@
4679  
4680          return self._get_flags_helper(iface, key, check_func)
4681  
4682 +    def get_default_pool(self):
4683 +        for p in self._pools.values():
4684 +            if p.get_name() == "default":
4685 +                return p
4686 +        return None
4687 +
4688 +    def get_vol_by_path(self, path):
4689 +        # path_exists will handle stuff like refreshing a busted pool
4690 +        if not virtinst.VirtualDisk.path_exists(self.get_backend(), path):
4691 +            return None
4692 +
4693 +        for pool in self._pools.values():
4694 +            for vol in pool.get_volumes().values():
4695 +                if vol.get_target_path() == path:
4696 +                    return vol
4697 +        return None
4698 +
4699  
4700      ###################################
4701      # Connection state getter/setters #
4702 @@ -628,6 +648,7 @@
4703      def is_connecting(self):
4704          return self.state == self.STATE_CONNECTING
4705  
4706 +
4707      #################################
4708      # Libvirt object lookup methods #
4709      #################################
4710 @@ -659,7 +680,7 @@
4711                  if mac:
4712                      netdev_list[name].mac = mac
4713  
4714 -        for name, iface in self.interfaces.items():
4715 +        for name, iface in self._interfaces.items():
4716              interface_to_netdev(iface)
4717  
4718          for nodedev in self.get_nodedevs("net"):
4719 @@ -679,21 +700,37 @@
4720          # XXX: How to handle added/removed signals to clients?
4721          return netdev_list
4722  
4723 -    def get_vm(self, uuid):
4724 -        return self.vms[uuid]
4725 -    def get_net(self, uuid):
4726 -        return self.nets[uuid]
4727 -    def get_net_device(self, path):
4728 -        return self.netdevs[path]
4729 -    def get_pool(self, uuid):
4730 -        return self.pools[uuid]
4731 -    def get_interface(self, name):
4732 -        return self.interfaces[name]
4733 -    def get_nodedev(self, name):
4734 -        return self.nodedevs[name]
4735 +    def list_netdevs(self):
4736 +        # Update netdev list
4737 +        if self.netdev_use_libvirt:
4738 +            self._netdevs = self._build_libvirt_netdev_list()
4739 +        return self._netdevs.values()
4740 +
4741 +    def get_vm(self, connkey):
4742 +        return self._vms[connkey]
4743 +    def list_vms(self):
4744 +        return self._vms.values()
4745 +
4746 +    def get_net(self, connkey):
4747 +        return self._nets[connkey]
4748 +    def list_nets(self):
4749 +        return self._nets.values()
4750 +
4751 +    def get_pool(self, connkey):
4752 +        return self._pools[connkey]
4753 +    def list_pools(self):
4754 +        return self._pools.values()
4755 +
4756 +    def get_interface(self, connkey):
4757 +        return self._interfaces[connkey]
4758 +    def list_interfaces(self):
4759 +        return self._interfaces.values()
4760 +
4761 +    def get_nodedev(self, connkey):
4762 +        return self._nodedevs[connkey]
4763      def get_nodedevs(self, devtype=None, devcap=None):
4764          retdevs = []
4765 -        for dev in self.nodedevs.values():
4766 +        for dev in self._nodedevs.values():
4767              xmlobj = dev.get_xmlobj()
4768              if devtype and xmlobj.device_type != devtype:
4769                  continue
4770 @@ -731,46 +768,6 @@
4771  
4772          return count
4773  
4774 -    def get_net_by_name(self, name):
4775 -        for net in self.nets.values():
4776 -            if net.get_name() == name:
4777 -                return net
4778 -
4779 -    def get_pool_by_path(self, path):
4780 -        for pool in self.pools.values():
4781 -            if pool.get_target_path() == path:
4782 -                return pool
4783 -        return None
4784 -
4785 -    def get_pool_by_name(self, name):
4786 -        for p in self.pools.values():
4787 -            if p.get_name() == name:
4788 -                return p
4789 -        return None
4790 -    def get_default_pool(self):
4791 -        return self.get_pool_by_name("default")
4792 -
4793 -    def get_vol_by_path(self, path):
4794 -        for pool in self.pools.values():
4795 -            for vol in pool.get_volumes().values():
4796 -                if vol.get_target_path() == path:
4797 -                    return vol
4798 -        return None
4799 -
4800 -    def list_vm_uuids(self):
4801 -        return self.vms.keys()
4802 -    def list_net_uuids(self):
4803 -        return self.nets.keys()
4804 -    def list_net_device_paths(self):
4805 -        # Update netdev list
4806 -        if self.netdev_use_libvirt:
4807 -            self.netdevs = self._build_libvirt_netdev_list()
4808 -        return self.netdevs.keys()
4809 -    def list_pool_uuids(self):
4810 -        return self.pools.keys()
4811 -    def list_interface_names(self):
4812 -        return self.interfaces.keys()
4813 -
4814  
4815      ###################################
4816      # Libvirt object creation methods #
4817 @@ -840,11 +837,21 @@
4818      # event driven setup is hard, so we end up doing more polling than
4819      # necessary on most events.
4820  
4821 +    def _domain_xml_misc_event(self, conn, domain, *args):
4822 +        # Just trigger a domain XML refresh for hotplug type events
4823 +        ignore = conn
4824 +        ignore = args
4825 +
4826 +        obj = self._vms.get(domain.name(), None)
4827 +        if not obj:
4828 +            return
4829 +        self.idle_add(obj.refresh_xml, True)
4830 +
4831      def _domain_lifecycle_event(self, conn, domain, event, reason, userdata):
4832          ignore = conn
4833          ignore = reason
4834          ignore = userdata
4835 -        obj = self.vms.get(domain.UUIDString(), None)
4836 +        obj = self._vms.get(domain.name(), None)
4837  
4838          if obj:
4839              # If the domain disappeared, this will catch it and trigger
4840 @@ -860,7 +867,7 @@
4841          ignore = conn
4842          ignore = reason
4843          ignore = userdata
4844 -        obj = self.nets.get(network.UUIDString(), None)
4845 +        obj = self._nets.get(network.name(), None)
4846  
4847          if obj:
4848              self.idle_add(obj.force_update_status, True)
4849 @@ -872,19 +879,47 @@
4850  
4851      def _add_conn_events(self):
4852          try:
4853 -            self._domain_cb_id = self.get_backend().domainEventRegisterAny(
4854 +            if _disable_libvirt_events:
4855 +                raise RuntimeError("_disable_libvirt_events = True")
4856 +
4857 +            self._domain_cb_ids.append(
4858 +                self.get_backend().domainEventRegisterAny(
4859                  None, libvirt.VIR_DOMAIN_EVENT_ID_LIFECYCLE,
4860 -                self._domain_lifecycle_event, None)
4861 +                self._domain_lifecycle_event, None))
4862              self.using_domain_events = True
4863              logging.debug("Using domain events")
4864          except Exception, e:
4865              self.using_domain_events = False
4866              logging.debug("Error registering domain events: %s", e)
4867  
4868 +        def _add_domain_xml_event(eventid, typestr):
4869 +            if not self.using_domain_events:
4870 +                return
4871 +            try:
4872 +                self._domain_cb_ids.append(
4873 +                    self.get_backend().domainEventRegisterAny(
4874 +                    None, eventid, self._domain_xml_misc_event, None))
4875 +            except Exception, e:
4876 +                logging.debug("Error registering domain %s event: %s",
4877 +                    typestr, e)
4878 +
4879 +        _add_domain_xml_event(
4880 +            getattr(libvirt, "VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE", 13),
4881 +            "balloon")
4882 +        _add_domain_xml_event(
4883 +            getattr(libvirt, "VIR_DOMAIN_EVENT_ID_TRAY_CHANGE", 10), "tray")
4884 +        _add_domain_xml_event(
4885 +            getattr(libvirt, "VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED", 15),
4886 +            "device removed")
4887 +
4888          try:
4889 +            if _disable_libvirt_events:
4890 +                raise RuntimeError("_disable_libvirt_events = True")
4891 +
4892              eventid = getattr(libvirt, "VIR_NETWORK_EVENT_ID_LIFECYCLE", 0)
4893 -            self._network_cb_id = self.get_backend().networkEventRegisterAny(
4894 -                None, eventid, self._network_lifecycle_event, None)
4895 +            self._network_cb_ids.append(
4896 +                self.get_backend().networkEventRegisterAny(
4897 +                None, eventid, self._network_lifecycle_event, None))
4898              self.using_network_events = True
4899              logging.debug("Using network events")
4900          except Exception, e:
4901 @@ -897,7 +932,7 @@
4902      ####################
4903  
4904      def _nodedev_mediadev_added(self, ignore1, name):
4905 -        if name in self.mediadevs:
4906 +        if name in self._mediadevs:
4907              return
4908  
4909          vobj = self.get_nodedev(name)
4910 @@ -905,15 +940,17 @@
4911          if not mediadev:
4912              return
4913  
4914 -        self.mediadevs[name] = mediadev
4915 +        self._mediadevs[name] = mediadev
4916 +        logging.debug("mediadev=%s added", name)
4917          self.emit("mediadev-added", mediadev)
4918  
4919      def _nodedev_mediadev_removed(self, ignore1, name):
4920 -        if name not in self.mediadevs:
4921 +        if name not in self._mediadevs:
4922              return
4923  
4924 -        self.mediadevs[name].cleanup()
4925 -        del(self.mediadevs[name])
4926 +        self._mediadevs[name].cleanup()
4927 +        del(self._mediadevs[name])
4928 +        logging.debug("mediadev=%s removed", name)
4929          self.emit("mediadev-removed", name)
4930  
4931  
4932 @@ -927,6 +964,10 @@
4933          self.config.set_conn_autoconnect(self.get_uri(), val)
4934  
4935      def close(self):
4936 +        if self.state != self.STATE_DISCONNECTED:
4937 +            logging.debug("conn.close() uri=%s", self.get_uri())
4938 +        self._closing = True
4939 +
4940          def cleanup(devs):
4941              for dev in devs.values():
4942                  try:
4943 @@ -936,54 +977,53 @@
4944  
4945          try:
4946              if not self._backend.is_closed():
4947 -                if self._domain_cb_id is not None:
4948 -                    self._backend.domainEventDeregisterAny(
4949 -                        self._domain_cb_id)
4950 -                self._domain_cb_id = None
4951 -
4952 -                if self._network_cb_id is not None:
4953 -                    self._backend.networkEventDeregisterAny(
4954 -                        self._network_cb_id)
4955 -                self._network_cb_id = None
4956 +                for eid in self._domain_cb_ids:
4957 +                    self._backend.domainEventDeregisterAny(eid)
4958 +                for eid in self._network_cb_ids:
4959 +                    self._backend.networkEventDeregisterAny(eid)
4960          except:
4961              logging.debug("Failed to deregister events in conn cleanup",
4962                  exc_info=True)
4963 +        finally:
4964 +            self._domain_cb_ids = []
4965 +            self._network_cb_ids = []
4966  
4967          self._backend.close()
4968          self.record = []
4969  
4970 -        cleanup(self.nodedevs)
4971 -        self.nodedevs = {}
4972 +        cleanup(self._nodedevs)
4973 +        self._nodedevs = {}
4974  
4975 -        cleanup(self.netdevs)
4976 -        self.netdevs = {}
4977 +        cleanup(self._netdevs)
4978 +        self._netdevs = {}
4979  
4980 -        cleanup(self.mediadevs)
4981 -        self.mediadevs = {}
4982 +        cleanup(self._mediadevs)
4983 +        self._mediadevs = {}
4984  
4985 -        cleanup(self.interfaces)
4986 -        self.interfaces = {}
4987 +        cleanup(self._interfaces)
4988 +        self._interfaces = {}
4989  
4990 -        cleanup(self.pools)
4991 -        self.pools = {}
4992 +        cleanup(self._pools)
4993 +        self._pools = {}
4994  
4995 -        cleanup(self.nets)
4996 -        self.nets = {}
4997 +        cleanup(self._nets)
4998 +        self._nets = {}
4999  
5000 -        cleanup(self.vms)
5001 -        self.vms = {}
5002 +        cleanup(self._vms)
5003 +        self._vms = {}
5004  
5005          self._change_state(self.STATE_DISCONNECTED)
5006 +        self._closing = False
5007  
5008      def _cleanup(self):
5009          self.close()
5010 -        self.connectError = None
5011 +        self._connectError = None
5012  
5013      def open(self, sync=False):
5014          if self.state != self.STATE_DISCONNECTED:
5015              return
5016  
5017 -        self.connectError = None
5018 +        self._connectError = None
5019          self._change_state(self.STATE_CONNECTING)
5020  
5021          if sync:
5022 @@ -993,17 +1033,17 @@
5023          else:
5024              logging.debug("Scheduling background open thread for " +
5025                           self.get_uri())
5026 -            self.connectThread = threading.Thread(target=self._open_thread,
5027 +            self._connectThread = threading.Thread(target=self._open_thread,
5028                                              name="Connect %s" % self.get_uri())
5029 -            self.connectThread.setDaemon(True)
5030 -            self.connectThread.start()
5031 +            self._connectThread.setDaemon(True)
5032 +            self._connectThread.start()
5033  
5034      def _do_creds_password(self, creds):
5035          try:
5036              return connectauth.creds_dialog(creds)
5037          except Exception, e:
5038              # Detailed error message, in English so it can be Googled.
5039 -            self.connectError = (
5040 +            self._connectError = (
5041                  "Failed to get credentials for '%s':\n%s\n%s" %
5042                  (self.get_uri(), str(e), "".join(traceback.format_exc())))
5043              return -1
5044 @@ -1055,14 +1095,14 @@
5045                  if connectauth.acquire_tgt():
5046                      continue
5047  
5048 -            self.connectError = (str(exc), tb, warnconsole)
5049 +            self._connectError = (str(exc), tb, warnconsole)
5050              break
5051  
5052          # We want to kill off this thread asap, so schedule an
5053          # idle event to inform the UI of result
5054          logging.debug("Background open thread complete, scheduling notify")
5055          self.idle_add(self._open_notify)
5056 -        self.connectThread = None
5057 +        self._connectThread = None
5058  
5059      def _open_notify(self):
5060          logging.debug("Notifying open result")
5061 @@ -1085,9 +1125,9 @@
5062                                          force=True)
5063  
5064          if self.state == self.STATE_DISCONNECTED:
5065 -            if self.connectError:
5066 -                self.idle_emit("connect-error", *self.connectError)
5067 -            self.connectError = None
5068 +            if self._connectError:
5069 +                self.idle_emit("connect-error", *self._connectError)
5070 +            self._connectError = None
5071  
5072  
5073      #######################
5074 @@ -1096,33 +1136,33 @@
5075  
5076      def _update_nets(self, dopoll):
5077          if not dopoll or not self.is_network_capable():
5078 -            return {}, {}, self.nets
5079 -        return pollhelpers.fetch_nets(self._backend, self.nets.copy(),
5080 +            return {}, {}, self._nets
5081 +        return pollhelpers.fetch_nets(self._backend, self._nets.copy(),
5082                      (lambda obj, key: vmmNetwork(self, obj, key)))
5083  
5084      def _update_pools(self, dopoll):
5085          if not dopoll or not self.is_storage_capable():
5086 -            return {}, {}, self.pools
5087 -        return pollhelpers.fetch_pools(self._backend, self.pools.copy(),
5088 +            return {}, {}, self._pools
5089 +        return pollhelpers.fetch_pools(self._backend, self._pools.copy(),
5090                      (lambda obj, key: vmmStoragePool(self, obj, key)))
5091  
5092      def _update_interfaces(self, dopoll):
5093          if not dopoll or not self.is_interface_capable():
5094 -            return {}, {}, self.interfaces
5095 +            return {}, {}, self._interfaces
5096          return pollhelpers.fetch_interfaces(self._backend,
5097 -                    self.interfaces.copy(),
5098 +                    self._interfaces.copy(),
5099                      (lambda obj, key: vmmInterface(self, obj, key)))
5100  
5101      def _update_nodedevs(self, dopoll):
5102          if not dopoll or not self.is_nodedev_capable():
5103 -            return {}, {}, self.nodedevs
5104 -        return pollhelpers.fetch_nodedevs(self._backend, self.nodedevs.copy(),
5105 +            return {}, {}, self._nodedevs
5106 +        return pollhelpers.fetch_nodedevs(self._backend, self._nodedevs.copy(),
5107                      (lambda obj, key: vmmNodeDevice(self, obj, key)))
5108  
5109      def _update_vms(self, dopoll):
5110          if not dopoll:
5111 -            return {}, {}, self.vms
5112 -        return pollhelpers.fetch_vms(self._backend, self.vms.copy(),
5113 +            return {}, {}, self._vms
5114 +        return pollhelpers.fetch_vms(self._backend, self._vms.copy(),
5115                      (lambda obj, key: vmmDomain(self, obj, key)))
5116  
5117  
5118 @@ -1136,7 +1176,43 @@
5119              kwargs["stats_update"] = False
5120          self.idle_emit("priority-tick", kwargs)
5121  
5122 -    def tick(self, stats_update,
5123 +    def tick(self, *args, **kwargs):
5124 +        e = None
5125 +        try:
5126 +            self._tick(*args, **kwargs)
5127 +        except KeyboardInterrupt:
5128 +            raise
5129 +        except Exception, e:
5130 +            pass
5131 +
5132 +        if e is None:
5133 +            return
5134 +
5135 +        from_remote = getattr(libvirt, "VIR_FROM_REMOTE", None)
5136 +        from_rpc = getattr(libvirt, "VIR_FROM_RPC", None)
5137 +        sys_error = getattr(libvirt, "VIR_ERR_SYSTEM_ERROR", None)
5138 +
5139 +        dom = -1
5140 +        code = -1
5141 +        if isinstance(e, libvirt.libvirtError):
5142 +            dom = e.get_error_domain()
5143 +            code = e.get_error_code()
5144 +
5145 +        logging.debug("Error polling connection %s",
5146 +            self.get_uri(), exc_info=True)
5147 +
5148 +        if (dom in [from_remote, from_rpc] and
5149 +            code in [sys_error]):
5150 +            e = None
5151 +            logging.debug("Not showing user error since libvirtd "
5152 +                "appears to have stopped.")
5153 +
5154 +        self._closing = True
5155 +        self.idle_add(self.close)
5156 +        if e:
5157 +            raise e  # pylint: disable=raising-bad-type
5158 +
5159 +    def _tick(self, stats_update,
5160               pollvm=False, pollnet=False,
5161               pollpool=False, polliface=False,
5162               pollnodedev=False, pollmedia=False,
5163 @@ -1145,7 +1221,7 @@
5164          main update function: polls for new objects, updates stats, ...
5165          @force: Perform the requested polling even if async events are in use
5166          """
5167 -        if self.state != self.STATE_ACTIVE:
5168 +        if self.state != self.STATE_ACTIVE or self._closing:
5169              return
5170  
5171          if not pollvm:
5172 @@ -1177,15 +1253,15 @@
5173                  return
5174  
5175              if pollvm:
5176 -                self.vms = vms
5177 +                self._vms = vms
5178              if pollnet:
5179 -                self.nets = nets
5180 +                self._nets = nets
5181              if polliface:
5182 -                self.interfaces = interfaces
5183 +                self._interfaces = interfaces
5184              if pollpool:
5185 -                self.pools = pools
5186 +                self._pools = pools
5187              if pollnodedev:
5188 -                self.nodedevs = nodedevs
5189 +                self._nodedevs = nodedevs
5190  
5191              # Make sure device polling is setup
5192              if not self.netdev_initialized:
5193 @@ -1195,40 +1271,48 @@
5194                  self._init_mediadev()
5195  
5196              # Update VM states
5197 -            for uuid, obj in goneVMs.items():
5198 -                self.emit("vm-removed", uuid)
5199 +            for connkey, obj in goneVMs.items():
5200 +                logging.debug("domain=%s removed", obj.get_name())
5201 +                self.emit("vm-removed", connkey)
5202                  obj.cleanup()
5203 -            for uuid, obj in newVMs.items():
5204 -                ignore = obj
5205 -                self.emit("vm-added", uuid)
5206 +            for connkey, obj in newVMs.items():
5207 +                logging.debug("domain=%s status=%s added",
5208 +                    obj.get_name(), obj.run_status())
5209 +                self.emit("vm-added", connkey)
5210  
5211              # Update virtual network states
5212 -            for uuid, obj in goneNets.items():
5213 -                self.emit("net-removed", uuid)
5214 +            for connkey, obj in goneNets.items():
5215 +                logging.debug("network=%s removed", obj.get_name())
5216 +                self.emit("net-removed", connkey)
5217                  obj.cleanup()
5218 -            for uuid, obj in newNets.items():
5219 +            for connkey, obj in newNets.items():
5220 +                logging.debug("network=%s added", obj.get_name())
5221                  obj.connect("started", self._obj_signal_proxy,
5222 -                            "net-started", uuid)
5223 +                            "net-started", connkey)
5224                  obj.connect("stopped", self._obj_signal_proxy,
5225 -                            "net-stopped", uuid)
5226 -                self.emit("net-added", uuid)
5227 +                            "net-stopped", connkey)
5228 +                self.emit("net-added", connkey)
5229  
5230              # Update storage pool states
5231 -            for uuid, obj in gonePools.items():
5232 -                self.emit("pool-removed", uuid)
5233 +            for connkey, obj in gonePools.items():
5234 +                logging.debug("pool=%s removed", obj.get_name())
5235 +                self.emit("pool-removed", connkey)
5236                  obj.cleanup()
5237 -            for uuid, obj in newPools.items():
5238 +            for connkey, obj in newPools.items():
5239 +                logging.debug("pool=%s added", obj.get_name())
5240                  obj.connect("started", self._obj_signal_proxy,
5241 -                            "pool-started", uuid)
5242 +                            "pool-started", connkey)
5243                  obj.connect("stopped", self._obj_signal_proxy,
5244 -                            "pool-stopped", uuid)
5245 -                self.emit("pool-added", uuid)
5246 +                            "pool-stopped", connkey)
5247 +                self.emit("pool-added", connkey)
5248  
5249              # Update interface states
5250              for name, obj in goneInterfaces.items():
5251 +                logging.debug("interface=%s removed", obj.get_name())
5252                  self.emit("interface-removed", name)
5253                  obj.cleanup()
5254              for name, obj in newInterfaces.items():
5255 +                logging.debug("interface=%s added", obj.get_name())
5256                  obj.connect("started", self._obj_signal_proxy,
5257                              "interface-started", name)
5258                  obj.connect("stopped", self._obj_signal_proxy,
5259 @@ -1267,7 +1351,7 @@
5260          if pollnodedev:
5261              add_to_ticklist(nodedevs.values())
5262          if pollmedia:
5263 -            add_to_ticklist(self.mediadevs.values())
5264 +            add_to_ticklist(self._mediadevs.values())
5265  
5266          for obj, args in ticklist:
5267              try:
5268 diff -urN virt-manager-1.0.1/virtManager/connect.py virt-manager/virtManager/connect.py
5269 --- virt-manager-1.0.1/virtManager/connect.py   2014-02-18 22:43:05.000000000 +0000
5270 +++ virt-manager/virtManager/connect.py 2014-06-12 11:22:21.154891895 +0000
5271 @@ -22,11 +22,9 @@
5272  import logging
5273  import socket
5274  
5275 -# pylint: disable=E0611
5276  from gi.repository import Gio
5277  from gi.repository import GObject
5278  from gi.repository import Gtk
5279 -# pylint: enable=E0611
5280  
5281  from virtManager import uiutil
5282  from virtManager.baseclass import vmmGObjectUI
5283 @@ -34,7 +32,8 @@
5284  (HV_QEMU,
5285  HV_XEN,
5286  HV_LXC,
5287 -HV_QEMU_SESSION) = range(4)
5288 +HV_QEMU_SESSION,
5289 +HV_BHYVE) = range(5)
5290  
5291  (CONN_SSH,
5292  CONN_TCP,
5293 @@ -155,6 +154,8 @@
5294          model.append(["Xen"])
5295          model.append(["LXC (Linux Containers)"])
5296          model.append(["QEMU/KVM user session"])
5297 +        if self.config.with_bhyve:
5298 +            model.append(["Bhyve"])
5299          combo.set_model(model)
5300          uiutil.set_combo_text_column(combo, 0)
5301  
5302 @@ -366,6 +367,8 @@
5303              hvstr = "xen"
5304          elif hv == HV_QEMU or hv == HV_QEMU_SESSION:
5305              hvstr = "qemu"
5306 +        elif hv == HV_BHYVE:
5307 +            hvstr = "bhyve"
5308          else:
5309              hvstr = "lxc"
5310  
5311 @@ -387,7 +390,7 @@
5312              hoststr += addrstr + "/"
5313  
5314          uri = hvstr + hoststr
5315 -        if hv == HV_QEMU:
5316 +        if hv in (HV_QEMU, HV_BHYVE):
5317              uri += "system"
5318          elif hv == HV_QEMU_SESSION:
5319              uri += "session"
5320 diff -urN virt-manager-1.0.1/virtManager/console.py virt-manager/virtManager/console.py
5321 --- virt-manager-1.0.1/virtManager/console.py   2014-03-22 14:56:43.000000000 +0000
5322 +++ virt-manager/virtManager/console.py 2014-06-12 11:22:21.155891895 +0000
5323 @@ -20,14 +20,12 @@
5324  # MA 02110-1301 USA.
5325  #
5326  
5327 -# pylint: disable=E0611
5328  from gi.repository import GObject
5329  from gi.repository import Gtk
5330  from gi.repository import Gdk
5331  from gi.repository import GtkVnc
5332  from gi.repository import SpiceClientGtk
5333  from gi.repository import SpiceClientGLib
5334 -# pylint: enable=E0611
5335  
5336  import libvirt
5337  
5338 @@ -282,7 +280,7 @@
5339              os.dup(self._outfds[1].fileno())
5340              os.dup(self._errfds[1].fileno())
5341              os.execlp(*argv)
5342 -            os._exit(1)  # pylint: disable=W0212
5343 +            os._exit(1)  # pylint: disable=protected-access
5344          else:
5345              self._outfds[1].close()
5346              self._errfds[1].close()
5347 @@ -466,7 +464,6 @@
5348  
5349      def set_grab_keyboard(self):
5350          self.display.set_keyboard_grab(self.config.get_grab_keyboard())
5351 -        self.display.force_grab(self.config.get_grab_keyboard())
5352  
5353      def _desktop_resize(self, src_ignore, w, h):
5354          self.desktop_resolution = (w, h)
5355 @@ -1401,7 +1398,7 @@
5356          logging.debug("Viewer connected")
5357          self.activate_viewer_page()
5358  
5359 -        # Had a succesfull connect, so reset counters now
5360 +        # Had a successful connect, so reset counters now
5361          self.viewerRetriesScheduled = 0
5362          self.viewerRetryDelay = 125
5363  
5364 @@ -1549,7 +1546,7 @@
5365  
5366          if not self.force_resize and is_resizeguest:
5367              # With resize guest, we don't want to maintain aspect ratio,
5368 -            # since the guest can resize to arbitray resolutions.
5369 +            # since the guest can resize to arbitrary resolutions.
5370              self.viewer.display.set_size_request(req.width, req.height)
5371              return
5372  
5373 diff -urN virt-manager-1.0.1/virtManager/createinterface.py virt-manager/virtManager/createinterface.py
5374 --- virt-manager-1.0.1/virtManager/createinterface.py   2014-02-17 17:37:52.000000000 +0000
5375 +++ virt-manager/virtManager/createinterface.py 2014-06-12 11:22:21.157891895 +0000
5376 @@ -18,10 +18,8 @@
5377  # MA 02110-1301 USA.
5378  #
5379  
5380 -# pylint: disable=E0611
5381  from gi.repository import Gtk
5382  from gi.repository import Gdk
5383 -# pylint: enable=E0611
5384  
5385  import logging
5386  
5387 @@ -168,8 +166,7 @@
5388      @staticmethod
5389      def iface_in_use_by(conn, name):
5390          use_str = ""
5391 -        for i in conn.list_interface_names():
5392 -            iface = conn.get_interface(i)
5393 +        for iface in conn.list_interfaces():
5394              if name in iface.get_slave_names():
5395                  if use_str:
5396                      use_str += ", "
5397 @@ -511,8 +508,8 @@
5398                                          phys.address]
5399  
5400          row_dict = {}
5401 -        for name in self.conn.list_interface_names():
5402 -            iface = self.conn.get_interface(name)
5403 +        for iface in self.conn.list_interfaces():
5404 +            name = iface.get_name()
5405              key = iface.get_xmlobj()
5406              iface_type = iface.get_type()
5407              active = iface.is_active()
5408 @@ -764,7 +761,7 @@
5409      def build_ip_info(self):
5410          def build_ip(addr_str):
5411              if not addr_str:
5412 -                return None, None
5413 +                raise ValueError(_("Please enter an IP address"))
5414              ret = addr_str.rsplit("/", 1)
5415              address = ret[0]
5416              prefix = None
5417 @@ -775,7 +772,7 @@
5418          is_manual = self.widget("ip-do-manual").get_active()
5419  
5420          copy_row = uiutil.get_list_selection(
5421 -            self.widget("ip-copy-interface-combo"))
5422 +            self.widget("ip-copy-interface-combo"), None)
5423  
5424          v4_mode = self.widget("ipv4-mode").get_active()
5425          v4_addr = self.widget("ipv4-address").get_text()
5426 @@ -818,9 +815,10 @@
5427                  if not ipv6.dhcp:
5428                      if v6_gate:
5429                          ipv6.gateway = v6_gate
5430 -                    addr, prefix = build_ip(v4_addr)
5431 -                    if addr:
5432 -                        ipv6.add_ip(addr, prefix)
5433 +                    for v6_addr in v6_addrlist:
5434 +                        addr, prefix = build_ip(v6_addr)
5435 +                        if addr:
5436 +                            ipv6.add_ip(addr, prefix)
5437  
5438          return [is_manual, copy_name, ipv4, ipv6, proto_xml]
5439  
5440 diff -urN virt-manager-1.0.1/virtManager/createnet.py virt-manager/virtManager/createnet.py
5441 --- virt-manager-1.0.1/virtManager/createnet.py 2014-02-17 17:37:52.000000000 +0000
5442 +++ virt-manager/virtManager/createnet.py       2014-06-12 11:22:21.157891895 +0000
5443 @@ -23,10 +23,8 @@
5444  
5445  import ipaddr
5446  
5447 -# pylint: disable=E0611
5448  from gi.repository import Gtk
5449  from gi.repository import Gdk
5450 -# pylint: enable=E0611
5451  
5452  from virtinst import Network
5453  
5454 @@ -171,10 +169,9 @@
5455          fw_model = self.widget("net-forward").get_model()
5456          fw_model.clear()
5457          fw_model.append([_("Any physical device"), None])
5458 -        for path in self.conn.list_net_device_paths():
5459 -            net = self.conn.get_net_device(path)
5460 -            fw_model.append([_("Physical device %s") % (net.get_name()),
5461 -                             net.get_name()])
5462 +        for netdev in self.conn.list_netdevs():
5463 +            fw_model.append([_("Physical device %s") % (netdev.get_name()),
5464 +                             netdev.get_name()])
5465  
5466          self.widget("net-forward").set_active(0)
5467          self.widget("net-forward-mode").set_active(0)
5468 @@ -268,9 +265,13 @@
5469              return self.err.val_err(_("Invalid Network Address"),
5470                      _("The network must be an IPv4 address"))
5471  
5472 -        if ip.numhosts < 16:
5473 +        if ip.numhosts < 8:
5474              return self.err.val_err(_("Invalid Network Address"),
5475 -                    _("The network must address at least 16 addresses."))
5476 +                    _("The network must address at least 8 addresses."))
5477 +
5478 +        if ip.prefixlen < 15:
5479 +            return self.err.val_err(_("Invalid Network Address"),
5480 +                    _("The network prefix must be >= 15"))
5481  
5482          if not ip.is_private:
5483              res = self.err.yes_no(_("Check Network Address"),
5484 @@ -562,7 +563,7 @@
5485              src.modify_bg(Gtk.StateType.NORMAL, _red)
5486              return
5487  
5488 -        valid_ip = (ip.numhosts >= 16 and ip.is_private)
5489 +        valid_ip = (ip.numhosts >= 8 and ip.is_private)
5490          gateway = (ip.prefixlen != 32 and str(ip.network + 1) or "")
5491          info = (ip.is_private and _("Private") or _("Other/Public"))
5492          start = int(ip.numhosts / 2)
5493 diff -urN virt-manager-1.0.1/virtManager/createpool.py virt-manager/virtManager/createpool.py
5494 --- virt-manager-1.0.1/virtManager/createpool.py        2014-02-17 17:37:52.000000000 +0000
5495 +++ virt-manager/virtManager/createpool.py      2014-06-12 11:22:21.158891895 +0000
5496 @@ -1,5 +1,5 @@
5497  #
5498 -# Copyright (C) 2008, 2013 Red Hat, Inc.
5499 +# Copyright (C) 2008, 2013, 2014 Red Hat, Inc.
5500  # Copyright (C) 2008 Cole Robinson <crobinso@redhat.com>
5501  #
5502  # This program is free software; you can redistribute it and/or modify
5503 @@ -18,10 +18,8 @@
5504  # MA 02110-1301 USA.
5505  #
5506  
5507 -# pylint: disable=E0611
5508  from gi.repository import Gtk
5509  from gi.repository import Gdk
5510 -# pylint: enable=E0611
5511  
5512  import logging
5513  
5514 @@ -263,7 +261,7 @@
5515          iqn = self._pool.supports_property("iqn")
5516          builddef, buildsens = self.get_build_default()
5517  
5518 -        # Source path broswing is meaningless for net pools
5519 +        # Source path browsing is meaningless for net pools
5520          if self._pool.type in [StoragePool.TYPE_NETFS,
5521                                 StoragePool.TYPE_ISCSI,
5522                                 StoragePool.TYPE_SCSI]:
5523 @@ -277,6 +275,11 @@
5524          show_row("pool-iqn", iqn)
5525          show_row("pool-source-name", src_name)
5526  
5527 +        if iqn:
5528 +            self.widget("pool-source-label").set_label(_("_Source IQN:"))
5529 +        else:
5530 +            self.widget("pool-source-label").set_label(_("_Source Path:"))
5531 +
5532          if tgt:
5533              self.widget("pool-target-path").get_child().set_text(
5534                  self._pool.target_path)
5535 diff -urN virt-manager-1.0.1/virtManager/create.py virt-manager/virtManager/create.py
5536 --- virt-manager-1.0.1/virtManager/create.py    2014-03-20 18:04:29.000000000 +0000
5537 +++ virt-manager/virtManager/create.py  2014-06-12 11:22:21.156891895 +0000
5538 @@ -22,11 +22,9 @@
5539  import threading
5540  import time
5541  
5542 -# pylint: disable=E0611
5543  from gi.repository import GObject
5544  from gi.repository import Gtk
5545  from gi.repository import Gdk
5546 -# pylint: enable=E0611
5547  
5548  import virtinst
5549  from virtinst import util
5550 @@ -132,7 +130,7 @@
5551              "on_install_url_box_changed": self.url_box_changed,
5552              "on_install_local_cdrom_toggled": self.toggle_local_cdrom,
5553              "on_install_local_cdrom_combo_changed": self.detect_media_os,
5554 -            "on_install_local_box_changed": self.detect_media_os,
5555 +            "on_install_local_box_changed": self.local_box_changed,
5556              "on_install_local_browse_clicked": self.browse_iso,
5557              "on_install_import_browse_clicked": self.browse_import,
5558              "on_install_app_browse_clicked": self.browse_app,
5559 @@ -297,6 +295,12 @@
5560          uiutil.set_combo_text_column(os_variant_list, 1)
5561          os_variant_list.set_row_separator_func(sep_func, os_variant_list)
5562  
5563 +        entry = self.widget("install-os-version-entry")
5564 +        completion = Gtk.EntryCompletion()
5565 +        entry.set_completion(completion)
5566 +        completion.set_text_column(1)
5567 +        completion.set_inline_completion(True)
5568 +
5569          # Archtecture
5570          # [value, label]
5571          archList = self.widget("config-arch")
5572 @@ -379,13 +383,21 @@
5573          # Install container OS
5574          self.widget("install-oscontainer-fs").set_text("")
5575  
5576 -        # Mem / CPUs
5577 -        self.widget("config-mem").set_value(DEFAULT_MEM)
5578 -        self.widget("config-cpus").set_value(1)
5579 -
5580          # Storage
5581          self.widget("enable-storage").set_active(True)
5582          self.addstorage.reset_state()
5583 +        self.addstorage.widget("config-storage-create").set_active(True)
5584 +        self.addstorage.widget("config-storage-entry").set_text("")
5585 +        self.addstorage.widget("config-storage-nosparse").set_active(True)
5586 +
5587 +        fmt = self.conn.get_default_storage_format()
5588 +        can_alloc = fmt in ["raw"]
5589 +        self.addstorage.widget("config-storage-nosparse").set_active(can_alloc)
5590 +        self.addstorage.widget("config-storage-nosparse").set_sensitive(can_alloc)
5591 +        self.addstorage.widget("config-storage-nosparse").set_tooltip_text(
5592 +            not can_alloc and
5593 +            (_("Disk format '%s' does not support full allocation.") % fmt) or
5594 +            "")
5595  
5596          # Final page
5597          self.widget("summary-customize").set_active(False)
5598 @@ -543,6 +555,11 @@
5599  
5600          self.mediacombo = vmmMediaCombo(self.conn, self.builder, self.topwin,
5601                                          MEDIA_CDROM)
5602 +        def mediacombo_changed(src):
5603 +            ignore = src
5604 +            self.mediaDetected = False
5605 +            self.detect_media_os()
5606 +        self.mediacombo.combo.connect("changed", mediacombo_changed)
5607          self.mediacombo.reset_state()
5608          self.widget("install-local-cdrom-align").add(
5609              self.mediacombo.top_box)
5610 @@ -844,6 +861,9 @@
5611          # Add action option
5612          self._add_os_row(model, label=_("Show all OS options"), action=True)
5613  
5614 +        completion = self.widget("install-os-version-entry").get_completion()
5615 +        completion.set_model(model)
5616 +
5617      def populate_media_model(self, model, urls):
5618          model.clear()
5619          if urls is not None:
5620 @@ -875,7 +895,7 @@
5621          self.set_caps_state()
5622  
5623      def populate_summary(self):
5624 -        distro, version, dlabel, vlabel = self.get_config_os_info()
5625 +        distro, version, ignore1, dlabel, vlabel = self.get_config_os_info()
5626          mem = self.pretty_memory(int(self.guest.memory))
5627          cpu = str(int(self.guest.vcpus))
5628  
5629 @@ -935,8 +955,8 @@
5630          return self.widget("create-vm-name").get_text()
5631  
5632      def get_config_machine(self):
5633 -        return uiutil.get_list_selection(self.widget("config-machine"),
5634 -            rowindex=0, check_visible=True)
5635 +        return uiutil.get_list_selection(self.widget("config-machine"), 0,
5636 +            check_visible=True)
5637  
5638      def is_install_page(self):
5639          notebook = self.widget("create-pages")
5640 @@ -960,12 +980,24 @@
5641                  return INSTALL_PAGE_CONTAINER_OS
5642  
5643      def get_config_os_info(self):
5644 -        drow = uiutil.get_list_selection(self.widget("install-os-type"))
5645 -        vrow = uiutil.get_list_selection(self.widget("install-os-version"))
5646 +        drow = uiutil.get_list_selection(
5647 +            self.widget("install-os-type"), None)
5648 +        vrow = uiutil.get_list_selection(
5649 +            self.widget("install-os-version"), None)
5650          distro = None
5651          dlabel = None
5652          variant = None
5653 -        vlabel = None
5654 +        variant_found = False
5655 +        vlabel = self.widget("install-os-version-entry").get_text()
5656 +
5657 +        for i in self.widget("install-os-version").get_model():
5658 +            if not i[2] and not i[3] and i[1] == vlabel:
5659 +                variant = i[0]
5660 +                variant_found = True
5661 +                break
5662 +
5663 +        if vlabel and not variant_found:
5664 +            return (None, None, False, None, None)
5665  
5666          if drow:
5667              distro = drow[0]
5668 @@ -976,6 +1008,7 @@
5669  
5670          return (distro and str(distro),
5671                  variant and str(variant),
5672 +                True,
5673                  str(dlabel), str(vlabel))
5674  
5675      def get_config_local_media(self, store_media=False):
5676 @@ -1074,7 +1107,7 @@
5677  
5678          if row:
5679              ntype = row[0]
5680 -            key = row[6]
5681 +            connkey = row[6]
5682  
5683              expand = (ntype != "network" and ntype != "bridge")
5684              if (ntype is None or
5685 @@ -1083,7 +1116,7 @@
5686              elif ntype != virtinst.VirtualNetworkInterface.TYPE_VIRTUAL:
5687                  show_pxe_warn = False
5688              else:
5689 -                obj = self.conn.get_net(key)
5690 +                obj = self.conn.get_net(connkey)
5691                  show_pxe_warn = not obj.can_pxe()
5692  
5693          show_warn = (show_pxe_warn and pxe_install)
5694 @@ -1109,16 +1142,22 @@
5695  
5696          self.change_caps(self.capsguest.os_type, arch)
5697  
5698 -    def url_box_changed(self, ignore):
5699 +    def media_box_changed(self, widget):
5700          self.mediaDetected = False
5701  
5702 -        # If the url_entry has focus, don't fire detect_media_os, it means
5703 +        # If the widget has focus, don't fire detect_media_os, it means
5704          # the user is probably typing
5705 -        if self.widget("install-url-box").get_child().has_focus():
5706 +        if self.widget(widget).get_child().has_focus():
5707              return
5708  
5709          self.detect_media_os()
5710  
5711 +    def url_box_changed(self, ignore):
5712 +        self.media_box_changed("install-url-box")
5713 +
5714 +    def local_box_changed(self, ignore):
5715 +        self.media_box_changed("install-local-box")
5716 +
5717      def should_detect_media(self):
5718          return (self.is_detect_active() and not self.mediaDetected)
5719  
5720 @@ -1138,11 +1177,13 @@
5721          self.widget("install-os-version").set_visible(not dodetect)
5722  
5723          if dodetect:
5724 +            self.widget("install-os-version-entry").set_text("")
5725              self.mediaDetected = False
5726              self.detect_media_os()
5727  
5728      def _selected_os_row(self):
5729 -        return uiutil.get_list_selection(self.widget("install-os-type"))
5730 +        return uiutil.get_list_selection(
5731 +            self.widget("install-os-type"), None)
5732  
5733      def change_os_type(self, box):
5734          ignore = box
5735 @@ -1155,8 +1196,8 @@
5736                  self.populate_os_type_model()
5737                  return
5738  
5739 -        variant = self.widget("install-os-version")
5740 -        variant.set_active(0)
5741 +        self.widget("install-os-version-entry").set_text("")
5742 +        self.widget("install-os-version-entry").grab_focus()
5743  
5744      def change_os_version(self, box):
5745          show_all = uiutil.get_list_selection(box, 3)
5746 @@ -1167,6 +1208,7 @@
5747          type_row = self._selected_os_row()
5748          if not type_row:
5749              return
5750 +        old_type = type_row[0]
5751  
5752          self.show_all_os = True
5753          self.populate_os_type_model()
5754 @@ -1174,7 +1216,7 @@
5755          os_type_list = self.widget("install-os-type")
5756          os_type_model = os_type_list.get_model()
5757          for idx in range(len(os_type_model)):
5758 -            if os_type_model[idx][0] == type_row[0]:
5759 +            if os_type_model[idx][0] == old_type:
5760                  os_type_list.set_active(idx)
5761                  break
5762  
5763 @@ -1182,6 +1224,7 @@
5764          is_active = src.get_active()
5765          if is_active and self.mediacombo.get_path():
5766              # Local CDROM was selected with media preset, detect distro
5767 +            self.mediaDetected = False
5768              self.detect_media_os()
5769  
5770          self.widget("install-local-cdrom-align").set_sensitive(is_active)
5771 @@ -1190,6 +1233,8 @@
5772          uselocal = src.get_active()
5773          self.widget("install-local-box").set_sensitive(uselocal)
5774          self.widget("install-local-browse").set_sensitive(uselocal)
5775 +        self.mediaDetected = False
5776 +        self.detect_media_os()
5777  
5778      def detect_visibility_changed(self, src, ignore=None):
5779          is_visible = src.get_visible()
5780 @@ -1241,11 +1286,7 @@
5781                                     INSTALL_PAGE_CONTAINER_OS]
5782          osbox.set_visible(iscontainer)
5783  
5784 -        # Detection only works/ is valid for URL,
5785 -        # FIXME: Also works for CDROM if running as root (since we need to
5786 -        # mount the iso/cdrom), but we should probably make this work for
5787 -        # more distros (like windows) before we enable it
5788 -        if (instpage == INSTALL_PAGE_URL):
5789 +        if instpage in (INSTALL_PAGE_ISO, INSTALL_PAGE_URL):
5790              detectbox.show()
5791          else:
5792              detectbox.hide()
5793 @@ -1295,7 +1336,8 @@
5794          if self.have_startup_error:
5795              return
5796  
5797 -        if curpage == PAGE_INSTALL and self.should_detect_media():
5798 +        if (curpage == PAGE_INSTALL and self.should_detect_media()
5799 +            and self.get_config_detectable_media()):
5800              # Make sure we have detected the OS before validating the page
5801              self.detect_media_os(forward=True)
5802              return
5803 @@ -1325,20 +1367,24 @@
5804          self.widget("header-pagenum").set_markup(page_lbl)
5805  
5806      def page_changed(self, ignore1, ignore2, pagenum):
5807 -        # Update page number
5808 -        self.set_page_num_text(pagenum)
5809 -
5810 -        self.widget("create-back").set_sensitive(pagenum != PAGE_NAME)
5811 -        self.widget("create-forward").set_visible(pagenum != PAGE_FINISH)
5812 -        self.widget("create-finish").set_visible(pagenum == PAGE_FINISH)
5813 -
5814          if pagenum == PAGE_INSTALL:
5815              self.detect_media_os()
5816              self.widget("install-os-distro-box").set_visible(
5817                  not self.container_install())
5818          elif pagenum == PAGE_FINISH:
5819 +            try:
5820 +                self.populate_summary()
5821 +            except Exception, e:
5822 +                self.err.show_err(_("Error populating summary page: %s") %
5823 +                    str(e))
5824 +                return
5825 +
5826              self.widget("create-finish").grab_focus()
5827 -            self.populate_summary()
5828 +
5829 +        self.set_page_num_text(pagenum)
5830 +        self.widget("create-back").set_sensitive(pagenum != PAGE_NAME)
5831 +        self.widget("create-forward").set_visible(pagenum != PAGE_FINISH)
5832 +        self.widget("create-finish").set_visible(pagenum == PAGE_FINISH)
5833  
5834          for nr in range(self.widget("create-pages").get_n_pages()):
5835              page = self.widget("create-pages").get_nth_page(nr)
5836 @@ -1434,7 +1480,7 @@
5837              self.conn.get_backend().lookupByName,
5838              start_num=force_num and 1 or 2, force_num=force_num,
5839              sep=not force_num and "-" or "",
5840 -            collidelist=[vm.get_name() for vm in self.conn.vms.values()])
5841 +            collidelist=[vm.get_name() for vm in self.conn.list_vms()])
5842  
5843      def validate_install_page(self):
5844          instmethod = self.get_config_install_page()
5845 @@ -1446,7 +1492,10 @@
5846          is_import = False
5847          init = None
5848          fs = None
5849 -        distro, variant, ignore1, ignore2 = self.get_config_os_info()
5850 +        distro, variant, valid, ignore1, ignore2 = self.get_config_os_info()
5851 +
5852 +        if not valid:
5853 +            return self.err.val_err(_("Please specify a valid OS variant."))
5854  
5855          if instmethod == INSTALL_PAGE_ISO:
5856              instclass = virtinst.DistroInstaller
5857 @@ -1583,6 +1632,24 @@
5858              self.addstorage.check_path_search(
5859                  self, self.conn, path)
5860  
5861 +        res = virtinst.osdict.get_recommended_resources(variant, self.capsguest.arch)
5862 +
5863 +        # Change the default values suggested to the user.
5864 +        ram_size = DEFAULT_MEM
5865 +        if res and res.get("ram") > 0:
5866 +            ram_size = res["ram"] / (1024 ** 2)
5867 +        self.widget("config-mem").set_value(ram_size)
5868 +
5869 +        n_cpus = 1
5870 +        if res and res.get("n-cpus") > 0:
5871 +            n_cpus = res["n-cpus"]
5872 +        self.widget("config-cpus").set_value(n_cpus)
5873 +
5874 +        storage_size = 8
5875 +        if res and res.get("storage"):
5876 +            storage_size = int(res["storage"]) / (1024 ** 3)
5877 +        self.addstorage.widget("config-storage-size").set_value(storage_size)
5878 +
5879          # Validation passed, store the install path (if there is one) in
5880          # gconf
5881          self.get_config_local_media(store_media=True)
5882 @@ -1762,7 +1829,7 @@
5883          self.close()
5884  
5885          # Launch details dialog for new VM
5886 -        self.emit("action-show-domain", self.conn.get_uri(), self.guest.uuid)
5887 +        self.emit("action-show-domain", self.conn.get_uri(), self.guest.name)
5888  
5889  
5890      def start_install(self, guest):
5891 @@ -1789,11 +1856,20 @@
5892          # Wait for VM to show up
5893          self.conn.schedule_priority_tick(pollvm=True)
5894          count = 0
5895 -        while (guest.uuid not in self.conn.vms) and (count < 100):
5896 +        foundvm = None
5897 +        while count < 100:
5898 +            for vm in self.conn.list_vms():
5899 +                if vm.get_uuid() == guest.uuid:
5900 +                    foundvm = vm
5901 +            if foundvm:
5902 +                break
5903              count += 1
5904              time.sleep(.1)
5905  
5906 -        vm = self.conn.get_vm(guest.uuid)
5907 +        if not foundvm:
5908 +            raise RuntimeError(
5909 +                _("VM '%s' didn't show up after expected time.") % guest.name)
5910 +        vm = foundvm
5911          vm.tick()
5912  
5913          if vm.is_shutoff():
5914 @@ -1866,36 +1942,19 @@
5915          # Helper method to set the OS Type/Variant selections to the passed
5916          # values, or -1 if not present.
5917          model = os_widget.get_model()
5918 -
5919          def set_val():
5920 -            idx = 0
5921 -            for idx in range(0, len(model)):
5922 +            for idx in range(len(model)):
5923                  row = model[idx]
5924                  if value and row[0] == value:
5925 -                    break
5926 -
5927 -                if idx == len(os_widget.get_model()) - 1:
5928 -                    idx = -1
5929 -
5930 -            os_widget.set_active(idx)
5931 -            if idx == -1:
5932 -                os_widget.set_active(0)
5933 -
5934 -            if idx >= 0:
5935 -                return row[1]
5936 -            if self.show_all_os:
5937 -                return None
5938 +                    os_widget.set_active(idx)
5939 +                    return row[1]
5940 +            os_widget.set_active(0)
5941  
5942          ret = set_val()
5943 -        if ret:
5944 -            return ret
5945 -
5946 -        # Trigger the last element in the list, which turns on show_all_os
5947 -        os_widget.set_active(len(model) - 1)
5948 -        ret = set_val()
5949 -        if ret:
5950 -            return ret
5951 -        return _("Unknown")
5952 +        if not ret and not self.show_all_os:
5953 +            os_widget.set_active(len(model) - 1)
5954 +            ret = set_val()
5955 +        return ret or _("Unknown")
5956  
5957      def set_distro_selection(self, variant):
5958          # Wrapper to change OS Type/Variant values, and update the distro
5959 diff -urN virt-manager-1.0.1/virtManager/createvol.py virt-manager/virtManager/createvol.py
5960 --- virt-manager-1.0.1/virtManager/createvol.py 2014-02-17 17:37:52.000000000 +0000
5961 +++ virt-manager/virtManager/createvol.py       2014-06-12 11:22:21.158891895 +0000
5962 @@ -20,11 +20,9 @@
5963  
5964  import logging
5965  
5966 -# pylint: disable=E0611
5967  from gi.repository import GObject
5968  from gi.repository import Gtk
5969  from gi.repository import Gdk
5970 -# pylint: enable=E0611
5971  
5972  from virtManager import uiutil
5973  from virtManager.baseclass import vmmGObjectUI
5974 @@ -283,9 +281,6 @@
5975              self.show_err(_("Uncaught error validating input: %s") % str(e))
5976              return
5977  
5978 -        logging.debug("Creating volume with xml:\n%s",
5979 -                      self.vol.get_xml_config())
5980 -
5981          self.topwin.set_sensitive(False)
5982          self.topwin.get_window().set_cursor(
5983              Gdk.Cursor.new(Gdk.CursorType.WATCH))
5984 diff -urN virt-manager-1.0.1/virtManager/delete.py virt-manager/virtManager/delete.py
5985 --- virt-manager-1.0.1/virtManager/delete.py    2014-03-10 15:17:52.000000000 +0000
5986 +++ virt-manager/virtManager/delete.py  2014-06-12 11:22:21.158891895 +0000
5987 @@ -18,10 +18,8 @@
5988  # MA 02110-1301 USA.
5989  #
5990  
5991 -# pylint: disable=E0611
5992  from gi.repository import Gtk
5993  from gi.repository import Gdk
5994 -# pylint: enable=E0611
5995  
5996  import os
5997  import stat
5998 diff -urN virt-manager-1.0.1/virtManager/details.py virt-manager/virtManager/details.py
5999 --- virt-manager-1.0.1/virtManager/details.py   2014-03-22 21:58:14.000000000 +0000
6000 +++ virt-manager/virtManager/details.py 2014-06-12 11:22:21.162891895 +0000
6001 @@ -21,11 +21,9 @@
6002  import logging
6003  import traceback
6004  
6005 -# pylint: disable=E0611
6006  from gi.repository import GObject
6007  from gi.repository import Gtk
6008  from gi.repository import Gdk
6009 -# pylint: enable=E0611
6010  
6011  import libvirt
6012  
6013 @@ -349,6 +347,8 @@
6014              return _("Tablet")
6015          elif dev.type == "mouse":
6016              return _("Mouse")
6017 +        elif dev.type == "keyboard":
6018 +            return _("Keyboard")
6019          return _("Input")
6020  
6021      if devtype in ["serial", "parallel", "console"]:
6022 @@ -435,6 +435,12 @@
6023      return typemap[devtype]
6024  
6025  
6026 +def _chipset_label_from_machine(machine):
6027 +    if machine and "q35" in machine:
6028 +        return "Q35"
6029 +    return "i440FX"
6030 +
6031 +
6032  class vmmDetails(vmmGObjectUI):
6033      __gsignals__ = {
6034          "action-save-domain": (GObject.SignalFlags.RUN_FIRST, None, [str, str]),
6035 @@ -530,6 +536,7 @@
6036  
6037          self.oldhwkey = None
6038          self.addhwmenu = None
6039 +        self._addhwmenuitems = None
6040          self.keycombo_menu = None
6041          self.init_menus()
6042          self.init_details()
6043 @@ -584,6 +591,7 @@
6044              "on_overview_name_changed": lambda *x: self.enable_apply(x, EDIT_NAME),
6045              "on_overview_title_changed": lambda *x: self.enable_apply(x, EDIT_TITLE),
6046              "on_machine_type_changed": lambda *x: self.enable_apply(x, EDIT_MACHTYPE),
6047 +            "on_overview_chipset_changed": lambda *x: self.enable_apply(x, EDIT_MACHTYPE),
6048              "on_idmap_uid_target_changed": lambda *x: self.enable_apply(x, EDIT_IDMAP),
6049              "on_idmap_uid_count_changed": lambda *x: self.enable_apply(x, EDIT_IDMAP),
6050              "on_idmap_gid_target_changed": lambda *x: self.enable_apply(x, EDIT_IDMAP),
6051 @@ -618,6 +626,7 @@
6052              "on_boot_initrd_browse_clicked": self.browse_initrd,
6053              "on_boot_dtb_browse_clicked": self.browse_dtb,
6054              "on_boot_init_path_changed": lambda *x: self.enable_apply(x, EDIT_INIT),
6055 +            "on_boot_init_args_changed": lambda *x: self.enable_apply(x, EDIT_INIT),
6056  
6057              "on_disk_readonly_changed": lambda *x: self.enable_apply(x, EDIT_DISK_RO),
6058              "on_disk_shareable_changed": lambda *x: self.enable_apply(x, EDIT_DISK_SHARE),
6059 @@ -625,7 +634,7 @@
6060              "on_disk_cache_combo_changed": lambda *x: self.enable_apply(x, EDIT_DISK_CACHE),
6061              "on_disk_io_combo_changed": lambda *x: self.enable_apply(x, EDIT_DISK_IO),
6062              "on_disk_bus_combo_changed": lambda *x: self.enable_apply(x, EDIT_DISK_BUS),
6063 -            "on_disk_format_changed": lambda *x: self.enable_apply(x, EDIT_DISK_FORMAT),
6064 +            "on_disk_format_changed": self.disk_format_changed,
6065              "on_disk_serial_changed": lambda *x: self.enable_apply(x, EDIT_DISK_SERIAL),
6066              "on_disk_iotune_changed": self.iotune_changed,
6067  
6068 @@ -706,6 +715,7 @@
6069          self.vm = None
6070          self.conn = None
6071          self.addhwmenu = None
6072 +        self._addhwmenuitems = None
6073  
6074          self.gfxdetails.cleanup()
6075          self.gfxdetails = None
6076 @@ -778,7 +788,7 @@
6077                                          show_open=False)
6078          for child in submenu.get_children():
6079              submenu.remove(child)
6080 -            newmenu.add(child)  # pylint: disable=E1101
6081 +            newmenu.add(child)
6082          topmenu.set_submenu(newmenu)
6083          topmenu.show_all()
6084  
6085 @@ -801,8 +811,9 @@
6086          rmHW.show()
6087          rmHW.connect("activate", self.remove_xml_dev)
6088  
6089 -        self.addhwmenu.add(addHW)
6090 -        self.addhwmenu.add(rmHW)
6091 +        self._addhwmenuitems = {"add" : addHW, "remove" : rmHW}
6092 +        for i in self._addhwmenuitems.values():
6093 +            self.addhwmenu.add(i)
6094  
6095          # Don't allowing changing network/disks for Dom0
6096          dom0 = self.vm.is_management_domain()
6097 @@ -883,30 +894,56 @@
6098          uiutil.set_combo_text_column(machtype_combo, 0)
6099          machtype_model.set_sort_column_id(0, Gtk.SortType.ASCENDING)
6100  
6101 +        machines = []
6102 +        try:
6103 +            ignore, domain = caps.guest_lookup(
6104 +                os_type=self.vm.get_abi_type(),
6105 +                arch=self.vm.get_arch(),
6106 +                typ=self.vm.get_hv_type(),
6107 +                machine=self.vm.get_machtype())
6108 +
6109 +            machines = domain.machines[:]
6110 +        except:
6111 +            logging.exception("Error determining machine list")
6112 +
6113          show_machine = (arch not in ["i686", "x86_64"] and
6114                          not self.vm.is_management_domain())
6115 -        uiutil.set_grid_row_visible(self.widget("machine-type"),
6116 -                                       show_machine)
6117 +        uiutil.set_grid_row_visible(self.widget("machine-type"), show_machine)
6118  
6119          if show_machine:
6120 -            machines = []
6121 -
6122 -            try:
6123 -                ignore, domain = caps.guest_lookup(
6124 -                    os_type=self.vm.get_abi_type(),
6125 -                    arch=self.vm.get_arch(),
6126 -                    typ=self.vm.get_hv_type(),
6127 -                    machine=self.vm.get_machtype())
6128 -
6129 -                machines = domain.machines[:]
6130 -            except:
6131 -                logging.exception("Error determining machine list")
6132 -
6133              for machine in machines:
6134                  if machine == "none":
6135                      continue
6136                  machtype_model.append([machine])
6137  
6138 +        # Chipset
6139 +        combo = self.widget("overview-chipset")
6140 +        model = Gtk.ListStore(str, str)
6141 +        combo.set_model(model)
6142 +        model.append([_chipset_label_from_machine("pc"), "pc"])
6143 +        if "q35" in machines:
6144 +            model.append([_chipset_label_from_machine("q35"), "q35"])
6145 +        combo.set_active(0)
6146 +
6147 +        def chipset_changed(*args):
6148 +            ignore = args
6149 +            combo = self.widget("overview-chipset")
6150 +            model = combo.get_model()
6151 +            show_warn = (combo.get_active() >= 0 and
6152 +                model[combo.get_active()][1] == "q35")
6153 +            uiutil.set_grid_row_visible(
6154 +                self.widget("overview-chipset-warn-box"), show_warn)
6155 +        combo.connect("changed", chipset_changed)
6156 +
6157 +        self.widget("overview-chipset").set_visible(self.is_customize_dialog)
6158 +        self.widget("overview-chipset-label").set_visible(
6159 +            not self.is_customize_dialog)
6160 +        show_chipset = ((self.conn.is_qemu() or self.conn.is_test_conn()) and
6161 +                        arch in ["i686", "x86_64"] and
6162 +                        not self.vm.is_management_domain())
6163 +        uiutil.set_grid_row_visible(
6164 +            self.widget("overview-chipset-title"), show_chipset)
6165 +
6166          # Inspection page
6167          apps_list = self.widget("inspection-apps")
6168          apps_model = Gtk.ListStore(str, str, str)
6169 @@ -1075,6 +1112,22 @@
6170          if event.button != 3:
6171              return
6172  
6173 +        devobj = self.get_hw_selection(HW_LIST_COL_DEVICE)
6174 +        if not devobj:
6175 +            return
6176 +
6177 +        # force select the list entry before showing popup_menu
6178 +        path_tuple = widget.get_path_at_pos(int(event.x), int(event.y))
6179 +        if path_tuple is None:
6180 +            return False
6181 +        path = path_tuple[0]
6182 +        _iter = widget.get_model().get_iter(path)
6183 +        widget.get_selection().select_iter(_iter)
6184 +
6185 +        rmdev = self._addhwmenuitems["remove"]
6186 +        rmdev.set_visible(self.widget("config-remove").get_visible())
6187 +        rmdev.set_sensitive(self.widget("config-remove").get_sensitive())
6188 +
6189          self.addhwmenu.popup(None, None, None, None, 0, event.time)
6190  
6191      def control_fullscreen(self, src):
6192 @@ -1096,7 +1149,7 @@
6193              self.widget("toolbar-box").hide()
6194  
6195      def get_boot_selection(self):
6196 -        return uiutil.get_list_selection(self.widget("config-boot-list"))
6197 +        return uiutil.get_list_selection(self.widget("config-boot-list"), None)
6198  
6199      def set_hw_selection(self, page, disable_apply=True):
6200          if disable_apply:
6201 @@ -1104,7 +1157,7 @@
6202          uiutil.set_list_selection(self.widget("hw-list"), page)
6203  
6204      def get_hw_row(self):
6205 -        return uiutil.get_list_selection(self.widget("hw-list"))
6206 +        return uiutil.get_list_selection(self.widget("hw-list"), None)
6207  
6208      def get_hw_selection(self, field):
6209          row = self.get_hw_row()
6210 @@ -1433,11 +1486,11 @@
6211          if not self.vm.is_paused():
6212              self.emit("action-suspend-domain",
6213                        self.vm.conn.get_uri(),
6214 -                      self.vm.get_uuid())
6215 +                      self.vm.get_connkey())
6216          else:
6217              self.emit("action-resume-domain",
6218                        self.vm.conn.get_uri(),
6219 -                      self.vm.get_uuid())
6220 +                      self.vm.get_connkey())
6221  
6222      def control_vm_menu(self, src_ignore):
6223          can_usb = bool(self.console.viewer and
6224 @@ -1447,39 +1500,39 @@
6225  
6226      def control_vm_run(self, src_ignore):
6227          self.emit("action-run-domain",
6228 -                  self.vm.conn.get_uri(), self.vm.get_uuid())
6229 +                  self.vm.conn.get_uri(), self.vm.get_connkey())
6230  
6231      def control_vm_shutdown(self, src_ignore):
6232          self.emit("action-shutdown-domain",
6233 -                  self.vm.conn.get_uri(), self.vm.get_uuid())
6234 +                  self.vm.conn.get_uri(), self.vm.get_connkey())
6235  
6236      def control_vm_reboot(self, src_ignore):
6237          self.emit("action-reboot-domain",
6238 -                  self.vm.conn.get_uri(), self.vm.get_uuid())
6239 +                  self.vm.conn.get_uri(), self.vm.get_connkey())
6240  
6241      def control_vm_save(self, src_ignore):
6242          self.emit("action-save-domain",
6243 -                  self.vm.conn.get_uri(), self.vm.get_uuid())
6244 +                  self.vm.conn.get_uri(), self.vm.get_connkey())
6245  
6246      def control_vm_reset(self, src_ignore):
6247          self.emit("action-reset-domain",
6248 -                  self.vm.conn.get_uri(), self.vm.get_uuid())
6249 +                  self.vm.conn.get_uri(), self.vm.get_connkey())
6250  
6251      def control_vm_destroy(self, src_ignore):
6252          self.emit("action-destroy-domain",
6253 -                  self.vm.conn.get_uri(), self.vm.get_uuid())
6254 +                  self.vm.conn.get_uri(), self.vm.get_connkey())
6255  
6256      def control_vm_clone(self, src_ignore):
6257          self.emit("action-clone-domain",
6258 -                  self.vm.conn.get_uri(), self.vm.get_uuid())
6259 +                  self.vm.conn.get_uri(), self.vm.get_connkey())
6260  
6261      def control_vm_migrate(self, src_ignore):
6262          self.emit("action-migrate-domain",
6263 -                  self.vm.conn.get_uri(), self.vm.get_uuid())
6264 +                  self.vm.conn.get_uri(), self.vm.get_connkey())
6265  
6266      def control_vm_delete(self, src_ignore):
6267          self.emit("action-delete-domain",
6268 -                  self.vm.conn.get_uri(), self.vm.get_uuid())
6269 +                  self.vm.conn.get_uri(), self.vm.get_connkey())
6270  
6271      def control_vm_screenshot(self, src):
6272          ignore = src
6273 @@ -1787,6 +1840,10 @@
6274          boot_list.get_selection().emit("changed")
6275          self.enable_apply(EDIT_BOOTORDER)
6276  
6277 +    def disk_format_changed(self, ignore):
6278 +        self.widget("disk-format-warn").show()
6279 +        self.enable_apply(EDIT_DISK_FORMAT)
6280 +
6281      # IO Tuning
6282      def iotune_changed(self, ignore):
6283          iotune_rbs = int(self.get_text("disk-iotune-rbs") or 0)
6284 @@ -1958,8 +2015,12 @@
6285              hotplug_args["title"] = kwargs["title"]
6286  
6287          if self.edited(EDIT_MACHTYPE):
6288 -            kwargs["machine"] = uiutil.get_combo_entry(
6289 -                self.widget("machine-type"))
6290 +            if self.widget("overview-chipset").is_visible():
6291 +                kwargs["machine"] = uiutil.get_list_selection(
6292 +                    self.widget("overview-chipset"), 1)
6293 +            else:
6294 +                kwargs["machine"] = uiutil.get_combo_entry(
6295 +                    self.widget("machine-type"))
6296  
6297          if self.edited(EDIT_DESC):
6298              desc_widget = self.widget("overview-description")
6299 @@ -2068,6 +2129,7 @@
6300  
6301          if self.edited(EDIT_INIT):
6302              kwargs["init"] = self.get_text("boot-init-path")
6303 +            kwargs["initargs"] = self.get_text("boot-init-args") or ""
6304              if not kwargs["init"]:
6305                  return self.err.val_err(_("An init path must be specified"))
6306  
6307 @@ -2169,7 +2231,8 @@
6308              kwargs["addrstr"] = addrstr
6309  
6310          if self.edited(EDIT_NET_SOURCE):
6311 -            kwargs["ntype"], kwargs["source"], kwargs["mode"] = (
6312 +            (kwargs["ntype"], kwargs["source"],
6313 +             kwargs["mode"], kwargs["portgroup"]) = (
6314                  self.netlist.get_network_selection())
6315  
6316          if self.edited(EDIT_NET_VPORT):
6317 @@ -2418,10 +2481,17 @@
6318  
6319          # Machine settings
6320          machtype = self.vm.get_machtype()
6321 -        if not arch in ["i686", "x86_64"]:
6322 +        if arch not in ["i686", "x86_64"]:
6323              if machtype is not None:
6324                  uiutil.set_combo_entry(self.widget("machine-type"), machtype)
6325  
6326 +        chipset = _chipset_label_from_machine(machtype)
6327 +        if self.widget("overview-chipset").is_visible():
6328 +            uiutil.set_combo_entry(
6329 +                self.widget("overview-chipset"), chipset)
6330 +        elif self.widget("overview-chipset-label").is_visible():
6331 +            self.widget("overview-chipset-label").set_text(chipset)
6332 +
6333          # User namespace idmap setting
6334          is_container = self.vm.is_container()
6335          self.widget("config-idmap-expander").set_visible(is_container)
6336 @@ -2533,6 +2603,12 @@
6337                                          self.vm.network_traffic_vector())
6338  
6339      def refresh_config_cpu(self):
6340 +        # This bit needs to come first, since CPU values can be affected
6341 +        # by whether topology is enabled
6342 +        cpu = self.vm.get_cpu_config()
6343 +        show_top = bool(cpu.sockets or cpu.cores or cpu.threads)
6344 +        self.widget("cpu-topology-enable").set_active(show_top)
6345 +
6346          conn = self.vm.conn
6347          host_active_count = conn.host_active_processor_count()
6348          maxvcpus = self.vm.vcpu_max_count()
6349 @@ -2550,13 +2626,10 @@
6350          self.widget("config-vcpus-warn-box").set_visible(warn)
6351  
6352          # CPU model config
6353 -        cpu = self.vm.get_cpu_config()
6354 -        show_top = bool(cpu.sockets or cpu.cores or cpu.threads)
6355          sockets = cpu.sockets or 1
6356          cores = cpu.cores or 1
6357          threads = cpu.threads or 1
6358  
6359 -        self.widget("cpu-topology-enable").set_active(show_top)
6360          self.widget("cpu-sockets").set_value(sockets)
6361          self.widget("cpu-cores").set_value(cores)
6362          self.widget("cpu-threads").set_value(threads)
6363 @@ -2679,6 +2752,7 @@
6364  
6365          self.widget("disk-format").set_sensitive(show_format)
6366          self.widget("disk-format").get_child().set_text(driver_type)
6367 +        self.widget("disk-format-warn").hide()
6368  
6369          no_default = not self.is_customize_dialog
6370  
6371 @@ -2730,19 +2804,24 @@
6372              dev = _("Xen Mouse")
6373          elif ident == "mouse:ps2":
6374              dev = _("PS/2 Mouse")
6375 +        elif ident == "keyboard:ps2":
6376 +            dev = _("PS/2 Keyboard")
6377          else:
6378              dev = inp.bus + " " + inp.type
6379  
6380 +        mode = None
6381          if inp.type == "tablet":
6382              mode = _("Absolute Movement")
6383 -        else:
6384 +        elif inp.type == "mouse":
6385              mode = _("Relative Movement")
6386  
6387          self.widget("input-dev-type").set_text(dev)
6388 -        self.widget("input-dev-mode").set_text(mode)
6389 +        self.widget("input-dev-mode").set_text(mode or "")
6390 +        uiutil.set_grid_row_visible(self.widget("input-dev-mode"), bool(mode))
6391  
6392          # Can't remove primary Xen or PS/2 mice
6393 -        if inp.type == "mouse" and inp.bus in ("xen", "ps2"):
6394 +        if ((inp.type == "mouse" and inp.bus in ("xen", "ps2")) or
6395 +            (inp.type == "keyboard" and inp.bus in ("xen", "ps2"))):
6396              self.widget("config-remove").set_sensitive(False)
6397          else:
6398              self.widget("config-remove").set_sensitive(True)
6399 @@ -3018,21 +3097,11 @@
6400          combo = self.widget("controller-model")
6401          uiutil.set_grid_row_visible(combo, True)
6402  
6403 -        model = combo.get_model()
6404 -        model.clear()
6405 -        if dev.type == virtinst.VirtualController.TYPE_USB:
6406 -            model.append(["default", "Default"])
6407 -            model.append(["ich9-ehci1", "USB 2"])
6408 -            model.append(["nec-xhci", "USB 3"])
6409 -            self.widget("config-remove").set_sensitive(False)
6410 -        if dev.type == virtinst.VirtualController.TYPE_SCSI:
6411 -            model.append(["default", "Default"])
6412 -            model.append(["virtio-scsi", "VirtIO SCSI"])
6413 -        else:
6414 -            self.widget("config-remove").set_sensitive(True)
6415 +        vmmAddHardware.populate_controller_model_combo(combo, dev.type,
6416 +                self.widget("config-remove"), False)
6417  
6418          uiutil.set_combo_entry(self.widget("controller-model"),
6419 -                             dev.model or "default")
6420 +                             dev.model or "Default")
6421  
6422      def refresh_filesystem_page(self):
6423          dev = self.get_hw_selection(HW_LIST_COL_DEVICE)
6424 @@ -3100,8 +3169,9 @@
6425          self.widget("boot-dtb-box").set_visible(show_dtb)
6426  
6427          # <init> populate
6428 -        init = self.vm.get_init()
6429 +        init, initargs = self.vm.get_init()
6430          self.widget("boot-init-path").set_text(init or "")
6431 +        self.widget("boot-init-args").set_text(initargs or "")
6432  
6433          # Boot menu populate
6434          menu = self.vm.get_boot_menu() or False
6435 diff -urN virt-manager-1.0.1/virtManager/domain.py virt-manager/virtManager/domain.py
6436 --- virt-manager-1.0.1/virtManager/domain.py    2014-03-22 22:16:55.000000000 +0000
6437 +++ virt-manager/virtManager/domain.py  2014-06-12 11:22:21.163891895 +0000
6438 @@ -18,9 +18,7 @@
6439  # MA 02110-1301 USA.
6440  #
6441  
6442 -# pylint: disable=E0611
6443  from gi.repository import GObject
6444 -# pylint: enable=E0611
6445  
6446  import logging
6447  import os
6448 @@ -173,8 +171,9 @@
6449  
6450          self.refresh_xml()
6451  
6452 -    def get_name(self):
6453 -        return self.get_xmlobj().name
6454 +    def _backend_get_name(self):
6455 +        return self._backend.getName()
6456 +
6457      def _XMLDesc(self, flags):
6458          return self._backend.getXMLDesc(flags=flags)
6459  
6460 @@ -284,7 +283,6 @@
6461      def __init__(self, conn, backend, key):
6462          vmmLibvirtObject.__init__(self, conn, backend, key, Guest)
6463  
6464 -        self.uuid = key
6465          self.cloning = False
6466  
6467          self.record = []
6468 @@ -299,7 +297,7 @@
6469          self.reboot_listener = None
6470          self._is_management_domain = None
6471          self._id = None
6472 -        self._name = None
6473 +        self._uuid = None
6474          self._snapshot_list = None
6475  
6476          self.lastStatus = libvirt.VIR_DOMAIN_SHUTOFF
6477 @@ -361,7 +359,7 @@
6478          self.toggle_sample_mem_stats()
6479          self.toggle_sample_cpu_stats()
6480  
6481 -        self.force_update_status(from_event=True)
6482 +        self.force_update_status(from_event=True, log=False)
6483  
6484          # Hook up listeners that need to be cleaned up
6485          self.add_gconf_handle(
6486 @@ -414,11 +412,6 @@
6487      def _using_events(self):
6488          return self.conn.using_domain_events
6489  
6490 -    def get_name(self):
6491 -        if self._name is None:
6492 -            self._name = self._backend.name()
6493 -        return self._name
6494 -
6495      def get_id(self):
6496          if self._id is None:
6497              self._id = self._backend.ID()
6498 @@ -645,7 +638,7 @@
6499  
6500      def define_boot(self, boot_order=_SENTINEL, boot_menu=_SENTINEL,
6501          kernel=_SENTINEL, initrd=_SENTINEL, dtb=_SENTINEL,
6502 -        kernel_args=_SENTINEL, init=_SENTINEL):
6503 +        kernel_args=_SENTINEL, init=_SENTINEL, initargs=_SENTINEL):
6504  
6505          def _change_boot_order(guest):
6506              boot_dev_order = []
6507 @@ -681,6 +674,7 @@
6508                  guest.os.enable_bootmenu = bool(boot_menu)
6509              if init != _SENTINEL:
6510                  guest.os.init = init
6511 +                guest.os.set_initargs_string(initargs)
6512  
6513              if kernel != _SENTINEL:
6514                  guest.os.kernel = kernel or None
6515 @@ -768,7 +762,8 @@
6516          ntype=_SENTINEL, source=_SENTINEL,
6517          mode=_SENTINEL, model=_SENTINEL, addrstr=_SENTINEL,
6518          vtype=_SENTINEL, managerid=_SENTINEL, typeid=_SENTINEL,
6519 -        typeidversion=_SENTINEL, instanceid=_SENTINEL):
6520 +        typeidversion=_SENTINEL, instanceid=_SENTINEL,
6521 +        portgroup=_SENTINEL):
6522  
6523          def change(editdev):
6524              if ntype != _SENTINEL:
6525 @@ -777,6 +772,7 @@
6526                  editdev.type = ntype
6527                  editdev.source = source
6528                  editdev.source_mode = mode or None
6529 +                editdev.portgroup = portgroup or None
6530  
6531              if model != _SENTINEL:
6532                  if editdev.model != model:
6533 @@ -1065,7 +1061,9 @@
6534          return self.get_xmlobj().os.is_hvm()
6535  
6536      def get_uuid(self):
6537 -        return self.uuid
6538 +        if self._uuid is None:
6539 +            self._uuid = self._backend.UUIDString()
6540 +        return self._uuid
6541      def get_abi_type(self):
6542          return self.get_xmlobj().os.os_type
6543      def get_hv_type(self):
6544 @@ -1075,7 +1073,12 @@
6545      def get_arch(self):
6546          return self.get_xmlobj().os.arch
6547      def get_init(self):
6548 -        return self.get_xmlobj().os.init
6549 +        import pipes
6550 +        init = self.get_xmlobj().os.init
6551 +        initargs = " ".join(
6552 +            [pipes.quote(i.val) for i in self.get_xmlobj().os.initargs])
6553 +        return init, initargs
6554 +
6555      def get_emulator(self):
6556          return self.get_xmlobj().emulator
6557      def get_machtype(self):
6558 @@ -1675,7 +1678,7 @@
6559              status = libvirt.VIR_DOMAIN_NOSTATE
6560          return vm_status_icons[status]
6561  
6562 -    def force_update_status(self, from_event=False):
6563 +    def force_update_status(self, from_event=False, log=True):
6564          """
6565          Fetch current domain state and clear status cache
6566          """
6567 @@ -1684,12 +1687,16 @@
6568  
6569          try:
6570              info = self._backend.info()
6571 +            if log:
6572 +                logging.debug("domain=%s status changed to %d=%s",
6573 +                    self.get_name(), info[0], self.pretty_run_status(info[0]))
6574 +
6575              self._update_status(info[0])
6576 -        except libvirt.libvirtError:
6577 +        except libvirt.libvirtError, e:
6578              # Transient domain might have disappeared, tell the connection
6579              # to update the domain list
6580 -            logging.debug("force_update_status: Triggering domain "
6581 -                "list refresh")
6582 +            logging.debug("Error setting domain status: %s\nDomain might "
6583 +                "have disappeared, triggering connection tick", e)
6584              self.conn.schedule_priority_tick(pollvm=True, force=True)
6585  
6586      def _update_status(self, status):
6587 @@ -1722,37 +1729,37 @@
6588      ##################
6589  
6590      def on_console_scaling_changed(self, *args, **kwargs):
6591 -        return self.config.listen_pervm(self.uuid, "/scaling",
6592 +        return self.config.listen_pervm(self.get_uuid(), "/scaling",
6593                                          *args, **kwargs)
6594      def set_console_scaling(self, value):
6595 -        self.config.set_pervm(self.uuid, "/scaling", value)
6596 +        self.config.set_pervm(self.get_uuid(), "/scaling", value)
6597      def get_console_scaling(self):
6598 -        ret = self.config.get_pervm(self.uuid, "/scaling")
6599 +        ret = self.config.get_pervm(self.get_uuid(), "/scaling")
6600          if ret == -1:
6601              return self.config.get_console_scaling()
6602          return ret
6603  
6604      def on_console_resizeguest_changed(self, *args, **kwargs):
6605 -        return self.config.listen_pervm(self.uuid, "/resize-guest",
6606 +        return self.config.listen_pervm(self.get_uuid(), "/resize-guest",
6607                                          *args, **kwargs)
6608      def set_console_resizeguest(self, value):
6609 -        self.config.set_pervm(self.uuid, "/resize-guest", value)
6610 +        self.config.set_pervm(self.get_uuid(), "/resize-guest", value)
6611      def get_console_resizeguest(self):
6612 -        ret = self.config.get_pervm(self.uuid, "/resize-guest")
6613 +        ret = self.config.get_pervm(self.get_uuid(), "/resize-guest")
6614          if ret == -1:
6615              return self.config.get_console_resizeguest()
6616          return ret
6617  
6618      def set_details_window_size(self, w, h):
6619 -        self.config.set_pervm(self.uuid, "/vm-window-size", (w, h))
6620 +        self.config.set_pervm(self.get_uuid(), "/vm-window-size", (w, h))
6621      def get_details_window_size(self):
6622 -        ret = self.config.get_pervm(self.uuid, "/vm-window-size")
6623 +        ret = self.config.get_pervm(self.get_uuid(), "/vm-window-size")
6624          return ret
6625  
6626      def get_console_password(self):
6627 -        return self.config.get_pervm(self.uuid, "/console-password")
6628 +        return self.config.get_pervm(self.get_uuid(), "/console-password")
6629      def set_console_password(self, username, keyid):
6630 -        return self.config.set_pervm(self.uuid, "/console-password",
6631 +        return self.config.set_pervm(self.get_uuid(), "/console-password",
6632                                       (username, keyid))
6633  
6634      def get_cache_dir(self):
6635 @@ -1953,6 +1960,8 @@
6636  
6637      def get_name(self):
6638          return self._backend.name
6639 +    def get_uuid(self):
6640 +        return self._backend.uuid
6641      def get_id(self):
6642          return -1
6643      def hasSavedImage(self):
6644 diff -urN virt-manager-1.0.1/virtManager/engine.py virt-manager/virtManager/engine.py
6645 --- virt-manager-1.0.1/virtManager/engine.py    2014-02-28 18:01:44.000000000 +0000
6646 +++ virt-manager/virtManager/engine.py  2014-06-12 11:22:21.163891895 +0000
6647 @@ -18,18 +18,16 @@
6648  # MA 02110-1301 USA.
6649  #
6650  
6651 -# pylint: disable=E0611
6652  from gi.repository import GLib
6653  from gi.repository import GObject
6654  from gi.repository import Gtk
6655 -# pylint: enable=E0611
6656  
6657  import logging
6658  import re
6659  import Queue
6660  import threading
6661 +import traceback
6662  
6663 -import libvirt
6664  from virtinst import util
6665  
6666  from virtManager import packageutils
6667 @@ -276,13 +274,13 @@
6668          thread.start()
6669  
6670  
6671 -    def _do_vm_removed(self, conn, vmuuid):
6672 +    def _do_vm_removed(self, conn, connkey):
6673          hvuri = conn.get_uri()
6674 -        if vmuuid not in self.conns[hvuri]["windowDetails"]:
6675 +        if connkey not in self.conns[hvuri]["windowDetails"]:
6676              return
6677  
6678 -        self.conns[hvuri]["windowDetails"][vmuuid].cleanup()
6679 -        del(self.conns[hvuri]["windowDetails"][vmuuid])
6680 +        self.conns[hvuri]["windowDetails"][connkey].cleanup()
6681 +        del(self.conns[hvuri]["windowDetails"][connkey])
6682  
6683      def _do_conn_changed(self, conn):
6684          if (conn.get_state() == conn.STATE_ACTIVE or
6685 @@ -291,9 +289,9 @@
6686  
6687          hvuri = conn.get_uri()
6688  
6689 -        for vmuuid in self.conns[hvuri]["windowDetails"].keys():
6690 -            self.conns[hvuri]["windowDetails"][vmuuid].cleanup()
6691 -            del(self.conns[hvuri]["windowDetails"][vmuuid])
6692 +        for connkey in self.conns[hvuri]["windowDetails"].keys():
6693 +            self.conns[hvuri]["windowDetails"][connkey].cleanup()
6694 +            del(self.conns[hvuri]["windowDetails"][connkey])
6695  
6696          if (self.windowCreate and
6697              self.windowCreate.conn and
6698 @@ -338,46 +336,19 @@
6699  
6700      def _handle_tick_queue(self):
6701          while True:
6702 -            ignore1, ignore2, obj, kwargs = self._tick_queue.get()
6703 -            self._tick_single_conn(obj, kwargs)
6704 +            ignore1, ignore2, conn, kwargs = self._tick_queue.get()
6705 +            try:
6706 +                conn.tick(**kwargs)
6707 +            except Exception, e:
6708 +                tb = "".join(traceback.format_exc())
6709 +                error_msg = (_("Error polling connection '%s': %s")
6710 +                    % (conn.get_uri(), e))
6711 +                self.idle_add(lambda: self.err.show_err(error_msg,
6712 +                    details=tb))
6713 +
6714              self._tick_queue.task_done()
6715          return 1
6716  
6717 -    def _tick_single_conn(self, conn, kwargs):
6718 -        e = None
6719 -        try:
6720 -            conn.tick(**kwargs)
6721 -        except KeyboardInterrupt:
6722 -            raise
6723 -        except Exception, e:
6724 -            pass
6725 -
6726 -        if e is None:
6727 -            return
6728 -
6729 -        from_remote = getattr(libvirt, "VIR_FROM_REMOTE", None)
6730 -        from_rpc = getattr(libvirt, "VIR_FROM_RPC", None)
6731 -        sys_error = getattr(libvirt, "VIR_ERR_SYSTEM_ERROR", None)
6732 -
6733 -        dom = -1
6734 -        code = -1
6735 -        if isinstance(e, libvirt.libvirtError):
6736 -            dom = e.get_error_domain()
6737 -            code = e.get_error_code()
6738 -
6739 -        if (dom in [from_remote, from_rpc] and
6740 -            code in [sys_error]):
6741 -            logging.exception("Could not refresh connection %s",
6742 -                              conn.get_uri())
6743 -            logging.debug("Closing connection since libvirtd "
6744 -                          "appears to have stopped")
6745 -        else:
6746 -            error_msg = _("Error polling connection '%s': %s") \
6747 -                % (conn.get_uri(), e)
6748 -            self.idle_add(lambda: self.err.show_err(error_msg))
6749 -
6750 -        self.idle_add(conn.close)
6751 -
6752  
6753      def increment_window_counter(self, src):
6754          ignore = src
6755 @@ -700,8 +671,8 @@
6756          if self.conns[uri]["windowHost"]:
6757              return self.conns[uri]["windowHost"]
6758  
6759 -        con = self._lookup_conn(uri)
6760 -        obj = vmmHost(con)
6761 +        conn = self._lookup_conn(uri)
6762 +        obj = vmmHost(conn)
6763  
6764          obj.connect("action-exit-app", self.exit_app)
6765          obj.connect("action-view-manager", self._do_show_manager)
6766 @@ -751,13 +722,13 @@
6767              self.remove_conn(None, connection.get_uri())
6768  
6769  
6770 -    def _get_details_dialog(self, uri, uuid):
6771 -        if uuid in self.conns[uri]["windowDetails"]:
6772 -            return self.conns[uri]["windowDetails"][uuid]
6773 +    def _get_details_dialog(self, uri, connkey):
6774 +        if connkey in self.conns[uri]["windowDetails"]:
6775 +            return self.conns[uri]["windowDetails"][connkey]
6776  
6777 -        con = self._lookup_conn(uri)
6778 +        conn = self._lookup_conn(uri)
6779  
6780 -        obj = vmmDetails(con.get_vm(uuid))
6781 +        obj = vmmDetails(conn.get_vm(connkey))
6782          obj.connect("action-save-domain", self._do_save_domain)
6783          obj.connect("action-destroy-domain", self._do_destroy_domain)
6784          obj.connect("action-reset-domain", self._do_reset_domain)
6785 @@ -774,33 +745,12 @@
6786          obj.connect("details-opened", self.increment_window_counter)
6787          obj.connect("details-closed", self.decrement_window_counter)
6788  
6789 -        self.conns[uri]["windowDetails"][uuid] = obj
6790 -        return self.conns[uri]["windowDetails"][uuid]
6791 +        self.conns[uri]["windowDetails"][connkey] = obj
6792 +        return self.conns[uri]["windowDetails"][connkey]
6793  
6794 -    def _find_vm_by_id(self, uri, domstr):
6795 -        vms = self.conns[uri]["conn"].vms
6796 -        if domstr in vms:
6797 -            return domstr
6798 -        for vm in vms.values():
6799 -            if domstr.isdigit():
6800 -                if int(domstr) == vm.get_id():
6801 -                    return vm.get_uuid()
6802 -            elif domstr == vm.get_name():
6803 -                return vm.get_uuid()
6804 -
6805 -    def _show_vm_helper(self, src, uri, domstr, page=None, forcepage=False):
6806 +    def _show_vm_helper(self, src, uri, vm, page, forcepage):
6807          try:
6808 -            uuid = self._find_vm_by_id(uri, domstr)
6809 -            if not uuid:
6810 -                # This will only happen if --show-* option was used during
6811 -                # virt-manager launch and an invalid UUID is passed.
6812 -                # The error message must be sync otherwise the user will not
6813 -                # know why the application ended.
6814 -                self.err.show_err("%s does not have VM '%s'" %
6815 -                    (uri, domstr), modal=True)
6816 -                return
6817 -
6818 -            details = self._get_details_dialog(uri, uuid)
6819 +            details = self._get_details_dialog(uri, vm.get_connkey())
6820  
6821              if forcepage or not details.is_visible():
6822                  if page == DETAILS_PERF:
6823 @@ -819,8 +769,10 @@
6824              if self._can_exit():
6825                  self.idle_add(self.exit_app, src)
6826  
6827 -    def _do_show_vm(self, src, uri, uuid):
6828 -        self._show_vm_helper(src, uri, uuid)
6829 +    def _do_show_vm(self, src, uri, connkey):
6830 +        conn = self._lookup_conn(uri)
6831 +        vm = conn.get_vm(connkey)
6832 +        self._show_vm_helper(src, uri, vm, None, False)
6833  
6834      def get_manager(self):
6835          if self.windowManager:
6836 @@ -887,10 +839,10 @@
6837          except Exception, e:
6838              src.err.show_err(_("Error launching manager: %s") % str(e))
6839  
6840 -    def _do_show_migrate(self, src, uri, uuid):
6841 +    def _do_show_migrate(self, src, uri, connkey):
6842          try:
6843              conn = self._lookup_conn(uri)
6844 -            vm = conn.get_vm(uuid)
6845 +            vm = conn.get_vm(connkey)
6846  
6847              if not self.windowMigrate:
6848                  self.windowMigrate = vmmMigrateDialog(vm, self)
6849 @@ -900,9 +852,9 @@
6850          except Exception, e:
6851              src.err.show_err(_("Error launching migrate dialog: %s") % str(e))
6852  
6853 -    def _do_show_clone(self, src, uri, uuid):
6854 -        con = self._lookup_conn(uri)
6855 -        orig_vm = con.get_vm(uuid)
6856 +    def _do_show_clone(self, src, uri, connkey):
6857 +        conn = self._lookup_conn(uri)
6858 +        orig_vm = conn.get_vm(connkey)
6859          clone_window = self.conns[uri]["windowClone"]
6860  
6861          try:
6862 @@ -930,26 +882,51 @@
6863          self.show_manager()
6864          self._do_show_create(self.get_manager(), uri)
6865  
6866 -    def show_domain_console(self, uri, uuid):
6867 -        self.idle_add(self._show_vm_helper, self.get_manager(), uri, uuid,
6868 -                      page=DETAILS_CONSOLE, forcepage=True)
6869 -
6870 -    def show_domain_editor(self, uri, uuid):
6871 -        self.idle_add(self._show_vm_helper, self.get_manager(), uri, uuid,
6872 -                      page=DETAILS_CONFIG, forcepage=True)
6873 -
6874 -    def show_domain_performance(self, uri, uuid):
6875 -        self.idle_add(self._show_vm_helper, self.get_manager(), uri, uuid,
6876 -                      page=DETAILS_PERF, forcepage=True)
6877 +
6878 +    def _find_vm_by_cli_str(self, uri, clistr):
6879 +        """
6880 +        Lookup a VM by a string passed in on the CLI. Can be either
6881 +        ID, domain name, or UUID
6882 +        """
6883 +        if clistr.isdigit():
6884 +            clistr = int(clistr)
6885 +
6886 +        for vm in self.conns[uri]["conn"].list_vms():
6887 +            if clistr == vm.get_id():
6888 +                return vm
6889 +            elif clistr == vm.get_name():
6890 +                return vm
6891 +            elif clistr == vm.get_uuid():
6892 +                return vm
6893 +
6894 +    def _cli_show_vm_helper(self, uri, clistr, page):
6895 +        src = self.get_manager()
6896 +
6897 +        vm = self._find_vm_by_cli_str(uri, clistr)
6898 +        if not vm:
6899 +            src.err.show_err("%s does not have VM '%s'" %
6900 +                (uri, clistr), modal=True)
6901 +            return
6902 +
6903 +        self._show_vm_helper(src, uri, vm, page, True)
6904 +
6905 +    def show_domain_console(self, uri, clistr):
6906 +        self.idle_add(self._cli_show_vm_helper, uri, clistr, DETAILS_CONSOLE)
6907 +
6908 +    def show_domain_editor(self, uri, clistr):
6909 +        self.idle_add(self._cli_show_vm_helper, uri, clistr, DETAILS_CONFIG)
6910 +
6911 +    def show_domain_performance(self, uri, clistr):
6912 +        self.idle_add(self._cli_show_vm_helper, uri, clistr, DETAILS_PERF)
6913  
6914  
6915      #######################################
6916      # Domain actions run/destroy/save ... #
6917      #######################################
6918  
6919 -    def _do_save_domain(self, src, uri, uuid):
6920 +    def _do_save_domain(self, src, uri, connkey):
6921          conn = self._lookup_conn(uri)
6922 -        vm = conn.get_vm(uuid)
6923 +        vm = conn.get_vm(connkey)
6924          managed = bool(vm.managedsave_supported)
6925  
6926          if not managed and conn.is_remote():
6927 @@ -1022,9 +999,9 @@
6928          vmmAsyncJob.simple_async_noshow(conn.restore, [path], src,
6929                                          _("Error restoring domain"))
6930  
6931 -    def _do_destroy_domain(self, src, uri, uuid):
6932 +    def _do_destroy_domain(self, src, uri, connkey):
6933          conn = self._lookup_conn(uri)
6934 -        vm = conn.get_vm(uuid)
6935 +        vm = conn.get_vm(connkey)
6936  
6937          if not src.err.chkbox_helper(
6938              self.config.get_confirm_forcepoweroff,
6939 @@ -1039,9 +1016,9 @@
6940          vmmAsyncJob.simple_async_noshow(vm.destroy, [], src,
6941                                          _("Error shutting down domain"))
6942  
6943 -    def _do_suspend_domain(self, src, uri, uuid):
6944 +    def _do_suspend_domain(self, src, uri, connkey):
6945          conn = self._lookup_conn(uri)
6946 -        vm = conn.get_vm(uuid)
6947 +        vm = conn.get_vm(connkey)
6948  
6949          if not src.err.chkbox_helper(self.config.get_confirm_pause,
6950              self.config.set_confirm_pause,
6951 @@ -1053,17 +1030,17 @@
6952          vmmAsyncJob.simple_async_noshow(vm.suspend, [], src,
6953                                          _("Error pausing domain"))
6954  
6955 -    def _do_resume_domain(self, src, uri, uuid):
6956 +    def _do_resume_domain(self, src, uri, connkey):
6957          conn = self._lookup_conn(uri)
6958 -        vm = conn.get_vm(uuid)
6959 +        vm = conn.get_vm(connkey)
6960  
6961          logging.debug("Unpausing vm '%s'", vm.get_name())
6962          vmmAsyncJob.simple_async_noshow(vm.resume, [], src,
6963                                          _("Error unpausing domain"))
6964  
6965 -    def _do_run_domain(self, src, uri, uuid):
6966 +    def _do_run_domain(self, src, uri, connkey):
6967          conn = self._lookup_conn(uri)
6968 -        vm = conn.get_vm(uuid)
6969 +        vm = conn.get_vm(connkey)
6970  
6971          logging.debug("Starting vm '%s'", vm.get_name())
6972  
6973 @@ -1086,7 +1063,7 @@
6974  
6975                  try:
6976                      vm.removeSavedImage()
6977 -                    self._do_run_domain(src, uri, uuid)
6978 +                    self._do_run_domain(src, uri, connkey)
6979                  except Exception, e:
6980                      src.err.show_err(_("Error removing domain state: %s")
6981                                       % str(e))
6982 @@ -1102,9 +1079,9 @@
6983              errorintro  = _("Error starting domain")
6984              vmmAsyncJob.simple_async_noshow(vm.startup, [], src, errorintro)
6985  
6986 -    def _do_shutdown_domain(self, src, uri, uuid):
6987 +    def _do_shutdown_domain(self, src, uri, connkey):
6988          conn = self._lookup_conn(uri)
6989 -        vm = conn.get_vm(uuid)
6990 +        vm = conn.get_vm(connkey)
6991  
6992          if not src.err.chkbox_helper(self.config.get_confirm_poweroff,
6993              self.config.set_confirm_poweroff,
6994 @@ -1116,9 +1093,9 @@
6995          vmmAsyncJob.simple_async_noshow(vm.shutdown, [], src,
6996                                          _("Error shutting down domain"))
6997  
6998 -    def _do_reboot_domain(self, src, uri, uuid):
6999 +    def _do_reboot_domain(self, src, uri, connkey):
7000          conn = self._lookup_conn(uri)
7001 -        vm = conn.get_vm(uuid)
7002 +        vm = conn.get_vm(connkey)
7003  
7004          if not src.err.chkbox_helper(self.config.get_confirm_poweroff,
7005              self.config.set_confirm_poweroff,
7006 @@ -1155,9 +1132,9 @@
7007  
7008          vmmAsyncJob.simple_async_noshow(reboot_cb, [], src, "")
7009  
7010 -    def _do_reset_domain(self, src, uri, uuid):
7011 +    def _do_reset_domain(self, src, uri, connkey):
7012          conn = self._lookup_conn(uri)
7013 -        vm = conn.get_vm(uuid)
7014 +        vm = conn.get_vm(connkey)
7015  
7016          if not src.err.chkbox_helper(
7017              self.config.get_confirm_forcepoweroff,
7018 @@ -1172,10 +1149,13 @@
7019          vmmAsyncJob.simple_async_noshow(vm.reset, [], src,
7020                                          _("Error resetting domain"))
7021  
7022 -    def _do_delete_domain(self, src, uri, uuid):
7023 +    def _do_delete_domain(self, src, uri, connkey):
7024          conn = self._lookup_conn(uri)
7025 -        vm = conn.get_vm(uuid)
7026 +        vm = conn.get_vm(connkey)
7027  
7028 -        if not self.delete_dialog:
7029 -            self.delete_dialog = vmmDeleteDialog()
7030 -        self.delete_dialog.show(vm, src.topwin)
7031 +        try:
7032 +            if not self.delete_dialog:
7033 +                self.delete_dialog = vmmDeleteDialog()
7034 +            self.delete_dialog.show(vm, src.topwin)
7035 +        except Exception, e:
7036 +            src.err.show_err(_("Error launching delete dialog: %s") % str(e))
7037 diff -urN virt-manager-1.0.1/virtManager/error.py virt-manager/virtManager/error.py
7038 --- virt-manager-1.0.1/virtManager/error.py     2014-03-22 14:19:18.000000000 +0000
7039 +++ virt-manager/virtManager/error.py   2014-06-12 11:22:21.163891895 +0000
7040 @@ -17,9 +17,7 @@
7041  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
7042  # MA 02110-1301 USA.
7043  
7044 -# pylint: disable=E0611
7045  from gi.repository import Gtk
7046 -# pylint: enable=E0611
7047  
7048  import logging
7049  import traceback
7050 @@ -75,14 +73,16 @@
7051              if tb != "None":
7052                  details += "\n\n" + tb
7053  
7054 +        if debug:
7055 +            debugmsg = "error dialog message:\nsummary=%s" % summary
7056 +            if details and details != summary:
7057 +                debugmsg += "\ndetails=%s" % details
7058 +            logging.debug(debugmsg)
7059 +
7060          # Make sure we have consistent details for error dialogs
7061 -        if (dialog_type == Gtk.MessageType.ERROR and not summary in details):
7062 +        if (dialog_type == Gtk.MessageType.ERROR and summary not in details):
7063              details = summary + "\n\n" + details
7064  
7065 -        if debug:
7066 -            logging.debug("error dialog message:\nsummary=%s\ndetails=%s",
7067 -                          summary, details)
7068 -
7069          dialog = _errorDialog(parent=self.get_parent(),
7070                                flags=0,
7071                                message_type=dialog_type,
7072 @@ -294,10 +294,6 @@
7073      """
7074      Custom error dialog with optional check boxes or details drop down
7075      """
7076 -    # pylint: disable=E1101
7077 -    # pylint can't detect functions we inheirit from Gtk, ex:
7078 -    # Instance of '_errorDialog' has no 'set_title' member
7079 -
7080      def __init__(self, *args, **kwargs):
7081          Gtk.MessageDialog.__init__(self, *args, **kwargs)
7082  
7083 @@ -324,7 +320,8 @@
7084          self.chk_align.add(self.chk_vbox)
7085  
7086          self.chk_align.show_all()
7087 -        self.vbox.pack_start(self.chk_align, False, False, 0)
7088 +        self.vbox.pack_start(  # pylint: disable=no-member
7089 +            self.chk_align, False, False, 0)
7090  
7091      def init_details(self):
7092          # Init details buffer
7093 @@ -342,7 +339,8 @@
7094          details.set_border_width(6)
7095          sw.add(details)
7096          self.buf_expander.add(sw)
7097 -        self.vbox.pack_start(self.buf_expander, False, False, 0)
7098 +        self.vbox.pack_start(  # pylint: disable=no-member
7099 +            self.buf_expander, False, False, 0)
7100          self.buf_expander.show_all()
7101  
7102      def show_dialog(self, primary_text, secondary_text="",
7103 diff -urN virt-manager-1.0.1/virtManager/fsdetails.py virt-manager/virtManager/fsdetails.py
7104 --- virt-manager-1.0.1/virtManager/fsdetails.py 2014-03-10 15:17:52.000000000 +0000
7105 +++ virt-manager/virtManager/fsdetails.py       2014-06-12 11:22:21.164891895 +0000
7106 @@ -19,10 +19,8 @@
7107  # MA 02110-1301 USA.
7108  #
7109  
7110 -# pylint: disable=E0611
7111  from gi.repository import Gtk
7112  from gi.repository import GObject
7113 -# pylint: enable=E0611
7114  
7115  from virtinst import VirtualFilesystem, StorageVolume
7116  from virtinst import util
7117 @@ -155,16 +153,16 @@
7118          return self._dev
7119  
7120      def get_config_fs_mode(self):
7121 -        return uiutil.get_list_selection(self.widget("fs-mode-combo"),
7122 -                                         rowindex=0, check_visible=True)
7123 +        return uiutil.get_list_selection(self.widget("fs-mode-combo"), 0,
7124 +                                         check_visible=True)
7125  
7126      def get_config_fs_wrpolicy(self):
7127 -        return uiutil.get_list_selection(self.widget("fs-wrpolicy-combo"),
7128 -                                         rowindex=0, check_visible=True)
7129 +        return uiutil.get_list_selection(self.widget("fs-wrpolicy-combo"), 0,
7130 +                                         check_visible=True)
7131  
7132      def get_config_fs_type(self):
7133 -        return uiutil.get_list_selection(self.widget("fs-type-combo"),
7134 -                                         rowindex=0, check_visible=True)
7135 +        return uiutil.get_list_selection(self.widget("fs-type-combo"), 0,
7136 +                                         check_visible=True)
7137  
7138      def get_config_fs_readonly(self):
7139          if not self.widget("fs-readonly").is_visible():
7140 @@ -172,12 +170,12 @@
7141          return self.widget("fs-readonly").get_active()
7142  
7143      def get_config_fs_driver(self):
7144 -        return uiutil.get_list_selection(self.widget("fs-driver-combo"),
7145 -                                         rowindex=0, check_visible=True)
7146 +        return uiutil.get_list_selection(self.widget("fs-driver-combo"), 0,
7147 +                                         check_visible=True)
7148  
7149      def get_config_fs_format(self):
7150 -        return uiutil.get_list_selection(self.widget("fs-format-combo"),
7151 -                                         rowindex=0, check_visible=True)
7152 +        return uiutil.get_list_selection(self.widget("fs-format-combo"), 0,
7153 +                                         check_visible=True)
7154  
7155      # Setters
7156      def set_dev(self, dev):
7157 diff -urN virt-manager-1.0.1/virtManager/gfxdetails.py virt-manager/virtManager/gfxdetails.py
7158 --- virt-manager-1.0.1/virtManager/gfxdetails.py        2014-03-22 22:24:42.000000000 +0000
7159 +++ virt-manager/virtManager/gfxdetails.py      2014-06-12 11:22:21.164891895 +0000
7160 @@ -19,10 +19,8 @@
7161  # MA 02110-1301 USA.
7162  #
7163  
7164 -# pylint: disable=E0611
7165  from gi.repository import Gtk
7166  from gi.repository import GObject
7167 -# pylint: enable=E0611
7168  
7169  import virtinst
7170  from virtManager import uiutil
7171 @@ -134,9 +132,9 @@
7172          self.widget("graphics-password-chk").set_active(False)
7173  
7174      def get_values(self):
7175 -        gtype = uiutil.get_list_selection(self.widget("graphics-type"))
7176 +        gtype = uiutil.get_list_selection(self.widget("graphics-type"), 0)
7177          port, tlsport = self._get_config_graphics_ports()
7178 -        addr = uiutil.get_list_selection(self.widget("graphics-address"))
7179 +        addr = uiutil.get_list_selection(self.widget("graphics-address"), 0)
7180          keymap = uiutil.get_combo_entry(self.widget("graphics-keymap"))
7181          if keymap == "auto":
7182              keymap = None
7183 @@ -154,15 +152,20 @@
7184              auto = self.widget(basename + "-auto")
7185              widget = self.widget(basename)
7186              auto.set_inconsistent(False)
7187 +            label = auto.get_label().split(" (")[0]
7188  
7189              if val == -1 or gfx.autoport:
7190                  auto.set_active(True)
7191 +                if val and val != -1:
7192 +                    label += " (%s %s)" % (_("Port"), val)
7193              elif val is None:
7194                  auto.set_inconsistent(True)
7195              else:
7196                  auto.set_active(False)
7197                  widget.set_value(val)
7198  
7199 +            auto.set_label(label)
7200 +
7201          gtype = gfx.type
7202          is_vnc = (gtype == "vnc")
7203          is_sdl = (gtype == "sdl")
7204 diff -urN virt-manager-1.0.1/virtManager/graphwidgets.py virt-manager/virtManager/graphwidgets.py
7205 --- virt-manager-1.0.1/virtManager/graphwidgets.py      2014-03-22 14:33:02.000000000 +0000
7206 +++ virt-manager/virtManager/graphwidgets.py    2014-06-12 11:22:21.164891895 +0000
7207 @@ -16,14 +16,8 @@
7208  # MA 02110-1301 USA.
7209  #
7210  
7211 -# pylint: disable=E0611
7212  from gi.repository import GObject
7213  from gi.repository import Gtk
7214 -# pylint: enable=E0611
7215 -
7216 -# pylint: disable=E1101
7217 -# pylint can't detect functions we inheirit from Gtk, ex:
7218 -# Instance of 'Sparkline' has no 'get_style_context' member
7219  
7220  # pylint: disable=arguments-differ
7221  # Newer pylint can detect, but warns that overridden arguments are wrong
7222 diff -urN virt-manager-1.0.1/virtManager/host.py virt-manager/virtManager/host.py
7223 --- virt-manager-1.0.1/virtManager/host.py      2014-03-20 00:10:58.000000000 +0000
7224 +++ virt-manager/virtManager/host.py    2014-06-12 11:22:21.164891895 +0000
7225 @@ -20,11 +20,9 @@
7226  
7227  import logging
7228  
7229 -# pylint: disable=E0611
7230  from gi.repository import GObject
7231  from gi.repository import Gtk
7232  from gi.repository import Gdk
7233 -# pylint: enable=E0611
7234  
7235  from virtinst import VirtualDisk
7236  from virtinst import StoragePool
7237 @@ -242,7 +240,7 @@
7238          self.widget("interface-list").append_column(interfaceCol)
7239          interfaceListModel.set_sort_column_id(1, Gtk.SortType.ASCENDING)
7240  
7241 -        # Starmode combo
7242 +        # Startmode combo
7243          vmmCreateInterface.build_interface_startmode_combo(
7244              self.widget("interface-startmode"))
7245  
7246 @@ -507,25 +505,25 @@
7247          self.enable_net_apply(EDIT_NET_AUTOSTART)
7248  
7249      def current_network(self):
7250 -        key = uiutil.get_list_selection(self.widget("net-list"), 0)
7251 +        connkey = uiutil.get_list_selection(self.widget("net-list"), 0)
7252          try:
7253 -            return key and self.conn.get_net(key)
7254 +            return connkey and self.conn.get_net(connkey)
7255          except KeyError:
7256              return None
7257  
7258 -    def refresh_network(self, src_ignore, uuid):
7259 +    def refresh_network(self, src_ignore, connkey):
7260          uilist = self.widget("net-list")
7261          sel = uilist.get_selection()
7262          model, treeiter = sel.get_selected()
7263 -        net = self.conn.get_net(uuid)
7264 +        net = self.conn.get_net(connkey)
7265          net.tick()
7266  
7267          for row in uilist.get_model():
7268 -            if row[0] == uuid:
7269 +            if row[0] == connkey:
7270                  row[4] = net.is_active()
7271  
7272          if treeiter is not None:
7273 -            if model[treeiter][0] == uuid:
7274 +            if model[treeiter][0] == connkey:
7275                  self.net_selected(sel)
7276  
7277      def set_net_error_page(self, msg):
7278 @@ -540,8 +538,10 @@
7279              return
7280  
7281          self.widget("network-pages").set_current_page(0)
7282 +        connkey = model[treeiter][0]
7283 +
7284          try:
7285 -            net = self.conn.get_net(model[treeiter][0])
7286 +            net = self.conn.get_net(connkey)
7287          except KeyError:
7288              self.disable_net_apply()
7289              return
7290 @@ -672,7 +672,9 @@
7291                                      _("Isolated network"))
7292          self.disable_net_apply()
7293  
7294 -    def repopulate_networks(self, src_ignore=None, uuid_ignore=None):
7295 +    def repopulate_networks(self, src=None, connkey=None):
7296 +        ignore = src
7297 +        ignore = connkey
7298          self.populate_networks(self.widget("net-list").get_model())
7299  
7300      def populate_networks(self, model):
7301 @@ -681,14 +683,13 @@
7302          net_list = self.widget("net-list")
7303          net_list.get_selection().unselect_all()
7304          model.clear()
7305 -        for uuid in self.conn.list_net_uuids():
7306 -            net = self.conn.get_net(uuid)
7307 -            model.append([uuid, net.get_name(), "network-idle",
7308 +        for net in self.conn.list_nets():
7309 +            model.append([net.get_connkey(), net.get_name(), "network-idle",
7310                            Gtk.IconSize.LARGE_TOOLBAR,
7311                            bool(net.is_active())])
7312  
7313          uiutil.set_row_selection(net_list,
7314 -                                    curnet and curnet.get_uuid() or None)
7315 +            curnet and curnet.get_connkey() or None)
7316  
7317  
7318      # ------------------------------
7319 @@ -802,12 +803,12 @@
7320          if cp is None:
7321              return
7322          cp.refresh()
7323 -        self.refresh_storage_pool(None, cp.get_uuid())
7324 +        self.refresh_storage_pool(None, cp.get_connkey())
7325  
7326      def current_pool(self):
7327 -        key = uiutil.get_list_selection(self.widget("pool-list"), 0)
7328 +        connkey = uiutil.get_list_selection(self.widget("pool-list"), 0)
7329          try:
7330 -            return key and self.conn.get_pool(key)
7331 +            return connkey and self.conn.get_pool(connkey)
7332          except KeyError:
7333              return None
7334  
7335 @@ -816,9 +817,9 @@
7336          if not pool:
7337              return None
7338  
7339 -        key = uiutil.get_list_selection(self.widget("vol-list"), 0)
7340 +        connkey = uiutil.get_list_selection(self.widget("vol-list"), 0)
7341          try:
7342 -            return key and pool.get_volume(key)
7343 +            return connkey and pool.get_volume(connkey)
7344          except KeyError:
7345              return None
7346  
7347 @@ -869,17 +870,17 @@
7348              return
7349  
7350          self.widget("storage-pages").set_current_page(0)
7351 -        uuid = model[treeiter][0]
7352 +        connkey = model[treeiter][0]
7353  
7354          try:
7355 -            self.populate_pool_state(uuid)
7356 +            self.populate_pool_state(connkey)
7357          except Exception, e:
7358              logging.exception(e)
7359              self.set_storage_error_page(_("Error selecting pool: %s") % e)
7360          self.disable_pool_apply()
7361  
7362 -    def populate_pool_state(self, uuid):
7363 -        pool = self.conn.get_pool(uuid)
7364 +    def populate_pool_state(self, connkey):
7365 +        pool = self.conn.get_pool(connkey)
7366          pool.tick()
7367          auto = pool.get_autostart()
7368          active = pool.is_active()
7369 @@ -921,10 +922,11 @@
7370              self.widget("vol-add").set_tooltip_text(
7371                  _("Pool does not support volume creation"))
7372  
7373 -    def refresh_storage_pool(self, src_ignore, uuid):
7374 -        refresh_pool_in_list(self.widget("pool-list"), self.conn, uuid)
7375 +    def refresh_storage_pool(self, src, connkey):
7376 +        ignore = src
7377 +        refresh_pool_in_list(self.widget("pool-list"), self.conn, connkey)
7378          curpool = self.current_pool()
7379 -        if curpool.get_uuid() != uuid:
7380 +        if curpool.get_connkey() != connkey:
7381              return
7382  
7383          # Currently selected pool changed state: force a 'pool_selected' to
7384 @@ -978,7 +980,9 @@
7385              clipboard.set_text(target_path, -1)
7386  
7387  
7388 -    def repopulate_storage_pools(self, src_ignore=None, uuid_ignore=None):
7389 +    def repopulate_storage_pools(self, src=None, connkey=None):
7390 +        ignore = src
7391 +        ignore = connkey
7392          pool_list = self.widget("pool-list")
7393          populate_storage_pools(pool_list, self.conn, self.current_pool())
7394  
7395 @@ -1055,9 +1059,9 @@
7396          self.refresh_interface(None, cp.get_name())
7397  
7398      def current_interface(self):
7399 -        key = uiutil.get_list_selection(self.widget("interface-list"), 0)
7400 +        connkey = uiutil.get_list_selection(self.widget("interface-list"), 0)
7401          try:
7402 -            return key and self.conn.get_interface(key)
7403 +            return connkey and self.conn.get_interface(connkey)
7404          except KeyError:
7405              return None
7406  
7407 @@ -1096,10 +1100,10 @@
7408              return
7409  
7410          self.widget("interface-pages").set_current_page(INTERFACE_PAGE_INFO)
7411 -        name = model[treeiter][0]
7412 +        connkey = model[treeiter][0]
7413  
7414          try:
7415 -            self.populate_interface_state(name)
7416 +            self.populate_interface_state(connkey)
7417          except Exception, e:
7418              logging.exception(e)
7419              self.set_interface_error_page(_("Error selecting interface: %s") %
7420 @@ -1107,8 +1111,9 @@
7421  
7422          self.widget("interface-apply").set_sensitive(False)
7423  
7424 -    def populate_interface_state(self, name):
7425 -        interface = self.conn.get_interface(name)
7426 +    def populate_interface_state(self, connkey):
7427 +        interface = self.conn.get_interface(connkey)
7428 +        name = interface.get_name()
7429          children = interface.get_slaves()
7430          itype = interface.get_type()
7431          mac = interface.get_mac()
7432 @@ -1191,11 +1196,14 @@
7433          self.widget("interface-child-box").set_visible(show_child)
7434          self.populate_interface_children()
7435  
7436 -    def refresh_interface(self, src_ignore, name):
7437 +    def refresh_interface(self, src, connkey):
7438 +        ignore = src
7439 +
7440          iface_list = self.widget("interface-list")
7441          sel = iface_list.get_selection()
7442          model, treeiter = sel.get_selected()
7443 -        iface = self.conn.get_interface(name)
7444 +        iface = self.conn.get_interface(connkey)
7445 +        name = iface.get_name()
7446          iface.tick()
7447  
7448          for row in iface_list.get_model():
7449 @@ -1213,7 +1221,9 @@
7450          self.widget("interface-start").set_sensitive(False)
7451          self.widget("interface-apply").set_sensitive(False)
7452  
7453 -    def repopulate_interfaces(self, src_ignore=None, name_ignore=None):
7454 +    def repopulate_interfaces(self, src=None, connkey=None):
7455 +        ignore = src
7456 +        ignore = connkey
7457          interface_list = self.widget("interface-list")
7458          self.populate_interfaces(interface_list.get_model())
7459  
7460 @@ -1223,14 +1233,13 @@
7461          iface_list = self.widget("interface-list")
7462          iface_list.get_selection().unselect_all()
7463          model.clear()
7464 -        for name in self.conn.list_interface_names():
7465 -            iface = self.conn.get_interface(name)
7466 -            model.append([name, iface.get_name(), "network-idle",
7467 -                          Gtk.IconSize.LARGE_TOOLBAR,
7468 +        for iface in self.conn.list_interfaces():
7469 +            model.append([iface.get_connkey(), iface.get_name(),
7470 +                          "network-idle", Gtk.IconSize.LARGE_TOOLBAR,
7471                            bool(iface.is_active())])
7472  
7473          uiutil.set_row_selection(iface_list,
7474 -                           curiface and curiface.get_name() or None)
7475 +            curiface and curiface.get_connkey() or None)
7476  
7477      def populate_interface_children(self):
7478          interface = self.current_interface()
7479 @@ -1268,13 +1277,15 @@
7480      poolListModel.set_sort_column_id(1, Gtk.SortType.ASCENDING)
7481  
7482  
7483 -def refresh_pool_in_list(pool_list, conn, uuid):
7484 +def refresh_pool_in_list(pool_list, conn, connkey):
7485      for row in pool_list.get_model():
7486 -        if row[0] == uuid:
7487 -            # Update active sensitivity and percent available for passed uuid
7488 -            row[3] = get_pool_size_percent(conn, uuid)
7489 -            row[2] = conn.get_pool(uuid).is_active()
7490 -            return
7491 +        if row[0] != connkey:
7492 +            continue
7493 +
7494 +        # Update active sensitivity and percent available for passed key
7495 +        row[3] = get_pool_size_percent(conn, connkey)
7496 +        row[2] = conn.get_pool(connkey).is_active()
7497 +        return
7498  
7499  
7500  def populate_storage_pools(pool_list, conn, curpool):
7501 @@ -1283,19 +1294,20 @@
7502      pool_list.set_model(None)
7503      pool_list.get_selection().unselect_all()
7504      model.clear()
7505 -    for uuid in conn.list_pool_uuids():
7506 -        per = get_pool_size_percent(conn, uuid)
7507 -        pool = conn.get_pool(uuid)
7508 +    for pool in conn.list_pools():
7509 +        connkey = pool.get_connkey()
7510 +        per = get_pool_size_percent(conn, connkey)
7511 +        pool = conn.get_pool(connkey)
7512  
7513          name = pool.get_name()
7514          typ = StoragePool.get_pool_type_desc(pool.get_type())
7515          label = "%s\n<span size='small'>%s</span>" % (name, typ)
7516  
7517 -        model.append([uuid, label, pool.is_active(), per])
7518 +        model.append([connkey, label, pool.is_active(), per])
7519  
7520      pool_list.set_model(model)
7521      uiutil.set_row_selection(pool_list,
7522 -                                curpool and curpool.get_uuid() or None)
7523 +        curpool and curpool.get_connkey() or None)
7524  
7525  
7526  def populate_storage_volumes(list_widget, pool, sensitive_cb):
7527 @@ -1335,8 +1347,8 @@
7528          model.append(row)
7529  
7530  
7531 -def get_pool_size_percent(conn, uuid):
7532 -    pool = conn.get_pool(uuid)
7533 +def get_pool_size_percent(conn, connkey):
7534 +    pool = conn.get_pool(connkey)
7535      cap = pool.get_capacity()
7536      alloc = pool.get_allocation()
7537      if not cap or alloc is None:
7538 diff -urN virt-manager-1.0.1/virtManager/inspection.py virt-manager/virtManager/inspection.py
7539 --- virt-manager-1.0.1/virtManager/inspection.py        2014-02-17 17:37:52.000000000 +0000
7540 +++ virt-manager/virtManager/inspection.py      2014-06-12 11:22:21.164891895 +0000
7541 @@ -23,7 +23,7 @@
7542  import os
7543  import re
7544  
7545 -from guestfs import GuestFS  # pylint: disable=F0401
7546 +from guestfs import GuestFS  # pylint: disable=import-error
7547  
7548  from virtManager.baseclass import vmmGObject
7549  from virtManager.domain import vmmInspectionData
7550 @@ -64,9 +64,9 @@
7551          self._q.put(obj)
7552  
7553      # Called by the main thread whenever a VM is added to vmlist.
7554 -    def vm_added(self, conn, uuid):
7555 +    def vm_added(self, conn, connkey):
7556          ignore = conn
7557 -        ignore = uuid
7558 +        ignore = connkey
7559          obj = ("vm_added")
7560          self._q.put(obj)
7561  
7562 @@ -118,7 +118,7 @@
7563      # Any VMs we've not seen yet?  If so, process them.
7564      def _process_vms(self):
7565          for conn in self._conns.itervalues():
7566 -            for vmuuid in conn.list_vm_uuids():
7567 +            for vm in conn.list_vms():
7568                  if not conn.is_active():
7569                      break
7570  
7571 @@ -127,9 +127,9 @@
7572                      data.error = True
7573                      self._set_vm_inspection_data(vm, data)
7574  
7575 +                vmuuid = vm.get_uuid()
7576                  prettyvm = vmuuid
7577                  try:
7578 -                    vm = conn.get_vm(vmuuid)
7579                      prettyvm = conn.get_uri() + ":" + vm.get_name()
7580  
7581                      if vmuuid in self._vmseen:
7582 diff -urN virt-manager-1.0.1/virtManager/interface.py virt-manager/virtManager/interface.py
7583 --- virt-manager-1.0.1/virtManager/interface.py 2014-02-17 17:37:52.000000000 +0000
7584 +++ virt-manager/virtManager/interface.py       2014-06-12 11:22:21.165891895 +0000
7585 @@ -27,7 +27,6 @@
7586      def __init__(self, conn, backend, key):
7587          vmmLibvirtObject.__init__(self, conn, backend, key, Interface)
7588  
7589 -        self._name = key
7590          self._active = True
7591  
7592          (self._inactive_xml_flags,
7593 @@ -68,9 +67,6 @@
7594      def is_active(self):
7595          return self._active
7596  
7597 -    def get_name(self):
7598 -        return self._name
7599 -
7600      def get_mac(self):
7601          return self.get_xmlobj().macaddr
7602  
7603 diff -urN virt-manager-1.0.1/virtManager/keyring.py virt-manager/virtManager/keyring.py
7604 --- virt-manager-1.0.1/virtManager/keyring.py   2014-02-17 17:37:52.000000000 +0000
7605 +++ virt-manager/virtManager/keyring.py 2014-06-12 11:22:21.165891895 +0000
7606 @@ -20,10 +20,8 @@
7607  
7608  import logging
7609  
7610 -# pylint: disable=E0611
7611  from gi.repository import Gio
7612  from gi.repository import GLib
7613 -# pylint: enable=E0611
7614  
7615  
7616  class vmmSecret(object):
7617 diff -urN virt-manager-1.0.1/virtManager/libvirtobject.py virt-manager/virtManager/libvirtobject.py
7618 --- virt-manager-1.0.1/virtManager/libvirtobject.py     2014-02-18 21:54:02.000000000 +0000
7619 +++ virt-manager/virtManager/libvirtobject.py   2014-06-12 11:22:21.165891895 +0000
7620 @@ -18,9 +18,7 @@
7621  # MA 02110-1301 USA.
7622  #
7623  
7624 -# pylint: disable=E0611
7625  from gi.repository import GObject
7626 -# pylint: enable=E0611
7627  
7628  import logging
7629  
7630 @@ -51,6 +49,10 @@
7631          self._inactive_xml_flags = 0
7632          self._active_xml_flags = 0
7633  
7634 +        # Cache object name
7635 +        self._name = None
7636 +        self.get_name()
7637 +
7638          self.connect("config-changed", self._reparse_xml)
7639  
7640      @staticmethod
7641 @@ -77,7 +79,7 @@
7642  
7643      def get_backend(self):
7644          return self._backend
7645 -    def get_key(self):
7646 +    def get_connkey(self):
7647          return self._key
7648  
7649      def change_name_backend(self, newbackend):
7650 @@ -109,8 +111,6 @@
7651      # Functions that should probably be overridden in sub class #
7652      #############################################################
7653  
7654 -    def get_name(self):
7655 -        raise NotImplementedError()
7656      def _XMLDesc(self, flags):
7657          raise NotImplementedError()
7658      def _using_events(self):
7659 @@ -123,8 +123,17 @@
7660      def delete(self, force=True):
7661          ignore = force
7662  
7663 -    def force_update_status(self, from_event=False):
7664 +    def force_update_status(self, from_event=False, log=True):
7665          ignore = from_event
7666 +        ignore = log
7667 +
7668 +    def get_name(self):
7669 +        if self._name is None:
7670 +            self._name = self._backend_get_name()
7671 +        return self._name
7672 +
7673 +    def _backend_get_name(self):
7674 +        return self._backend.name()
7675  
7676  
7677      ##################
7678 diff -urN virt-manager-1.0.1/virtManager/manager.py virt-manager/virtManager/manager.py
7679 --- virt-manager-1.0.1/virtManager/manager.py   2014-02-25 20:39:29.000000000 +0000
7680 +++ virt-manager/virtManager/manager.py 2014-06-12 11:22:21.166891895 +0000
7681 @@ -20,12 +20,10 @@
7682  
7683  import logging
7684  
7685 -# pylint: disable=E0611
7686  from gi.repository import GObject
7687  from gi.repository import Gtk
7688  from gi.repository import Gdk
7689  from gi.repository import GdkPixbuf
7690 -# pylint: enable=E0611
7691  
7692  from virtinst import util
7693  
7694 @@ -118,7 +116,7 @@
7695  
7696          self.ignore_pause = False
7697  
7698 -        # Mapping of VM UUID -> tree model rows to
7699 +        # Mapping of rowkey -> tree model rows to
7700          # allow O(1) access instead of O(n)
7701          self.rows = {}
7702  
7703 @@ -241,7 +239,7 @@
7704          self.hostcpucol = None
7705          self.netcol = None
7706  
7707 -        self.vmmenu.destroy()  # pylint: disable=E1101
7708 +        self.vmmenu.destroy()
7709          self.vmmenu = None
7710          self.connmenu.destroy()
7711          self.connmenu = None
7712 @@ -427,7 +425,7 @@
7713      ##################
7714  
7715      def current_row(self):
7716 -        return uiutil.get_list_selection(self.widget("vm-list"))
7717 +        return uiutil.get_list_selection(self.widget("vm-list"), None)
7718  
7719      def current_vm(self):
7720          row = self.current_row()
7721 @@ -447,12 +445,6 @@
7722          else:
7723              return handle.conn
7724  
7725 -    def current_vmuuid(self):
7726 -        vm = self.current_vm()
7727 -        if vm is None:
7728 -            return None
7729 -        return vm.get_uuid()
7730 -
7731      def current_conn_uri(self, default_selection=False):
7732          vmlist = self.widget("vm-list")
7733          model = vmlist.get_model()
7734 @@ -506,7 +498,7 @@
7735              return
7736  
7737          if vm:
7738 -            self.emit("action-show-domain", conn.get_uri(), vm.get_uuid())
7739 +            self.emit("action-show-domain", conn.get_uri(), vm.get_connkey())
7740          else:
7741              if not self.open_conn():
7742                  self.emit("action-show-host", conn.get_uri())
7743 @@ -517,7 +509,7 @@
7744          if vm is None:
7745              self._do_delete_conn(conn)
7746          else:
7747 -            self.emit("action-delete-domain", conn.get_uri(), vm.get_uuid())
7748 +            self.emit("action-delete-domain", conn.get_uri(), vm.get_connkey())
7749  
7750      def _do_delete_conn(self, conn):
7751          if conn is None:
7752 @@ -555,27 +547,28 @@
7753  
7754      def start_vm(self, ignore):
7755          vm = self.current_vm()
7756 -        if vm is not None:
7757 -            self.emit("action-run-domain",
7758 -                      vm.conn.get_uri(), vm.get_uuid())
7759 +        if vm is None:
7760 +            return
7761 +        self.emit("action-run-domain", vm.conn.get_uri(), vm.get_connkey())
7762  
7763      def poweroff_vm(self, ignore):
7764          vm = self.current_vm()
7765 -        if vm is not None:
7766 -            self.emit("action-shutdown-domain",
7767 -                      vm.conn.get_uri(), vm.get_uuid())
7768 +        if vm is None:
7769 +            return
7770 +        self.emit("action-shutdown-domain",
7771 +            vm.conn.get_uri(), vm.get_connkey())
7772  
7773      def pause_vm(self, ignore):
7774          vm = self.current_vm()
7775 -        if vm is not None:
7776 -            self.emit("action-suspend-domain",
7777 -                      vm.conn.get_uri(), vm.get_uuid())
7778 +        if vm is None:
7779 +            return
7780 +        self.emit("action-suspend-domain", vm.conn.get_uri(), vm.get_connkey())
7781  
7782      def resume_vm(self, ignore):
7783          vm = self.current_vm()
7784 -        if vm is not None:
7785 -            self.emit("action-resume-domain",
7786 -                      vm.conn.get_uri(), vm.get_uuid())
7787 +        if vm is None:
7788 +            return
7789 +        self.emit("action-resume-domain", vm.conn.get_uri(), vm.get_connkey())
7790  
7791      def close_conn(self, ignore):
7792          conn = self.current_conn()
7793 @@ -596,8 +589,8 @@
7794      def vm_row_key(self, vm):
7795          return vm.get_uuid() + ":" + vm.conn.get_uri()
7796  
7797 -    def vm_added(self, conn, vmuuid):
7798 -        vm = conn.get_vm(vmuuid)
7799 +    def vm_added(self, conn, connkey):
7800 +        vm = conn.get_vm(connkey)
7801          if self.vm_row_key(vm) in self.rows:
7802              return
7803  
7804 @@ -611,14 +604,14 @@
7805  
7806          self._append_vm(model, vm, conn)
7807  
7808 -    def vm_removed(self, conn, vmuuid):
7809 +    def vm_removed(self, conn, connkey):
7810          vmlist = self.widget("vm-list")
7811          model = vmlist.get_model()
7812  
7813          parent = self.rows[conn.get_uri()].iter
7814          for row in range(model.iter_n_children(parent)):
7815              vm = model[model.iter_nth_child(parent, row)][ROW_HANDLE]
7816 -            if vm.get_uuid() == vmuuid:
7817 +            if vm.get_connkey() == connkey:
7818                  model.remove(model.iter_nth_child(parent, row))
7819                  del self.rows[self.vm_row_key(vm)]
7820                  break
7821 @@ -930,8 +923,7 @@
7822              # Popup the vm menu
7823              vm = model[_iter][ROW_HANDLE]
7824              self.vmmenu.update_widget_states(vm)
7825 -            self.vmmenu.popup(  # pylint: disable=E1101
7826 -                None, None, None, None, 0, event.time)
7827 +            self.vmmenu.popup(None, None, None, None, 0, event.time)
7828          else:
7829              # Pop up connection menu
7830              conn = model[_iter][ROW_HANDLE]
7831 diff -urN virt-manager-1.0.1/virtManager/mediacombo.py virt-manager/virtManager/mediacombo.py
7832 --- virt-manager-1.0.1/virtManager/mediacombo.py        2014-02-17 17:37:52.000000000 +0000
7833 +++ virt-manager/virtManager/mediacombo.py      2014-06-12 11:22:21.166891895 +0000
7834 @@ -17,9 +17,7 @@
7835  # MA 02110-1301 USA.
7836  #
7837  
7838 -# pylint: disable=E0611
7839  from gi.repository import Gtk
7840 -# pylint: enable=E0611
7841  
7842  from virtManager import uiutil
7843  from virtManager.baseclass import vmmGObjectUI
7844 diff -urN virt-manager-1.0.1/virtManager/mediadev.py virt-manager/virtManager/mediadev.py
7845 --- virt-manager-1.0.1/virtManager/mediadev.py  2014-02-17 17:37:52.000000000 +0000
7846 +++ virt-manager/virtManager/mediadev.py        2014-06-12 11:22:21.166891895 +0000
7847 @@ -18,9 +18,7 @@
7848  # MA 02110-1301 USA.
7849  #
7850  
7851 -# pylint: disable=E0611
7852  from gi.repository import GObject
7853 -# pylint: enable=E0611
7854  
7855  import logging
7856  
7857 diff -urN virt-manager-1.0.1/virtManager/migrate.py virt-manager/virtManager/migrate.py
7858 --- virt-manager-1.0.1/virtManager/migrate.py   2014-02-17 17:37:52.000000000 +0000
7859 +++ virt-manager/virtManager/migrate.py 2014-06-12 11:22:21.166891895 +0000
7860 @@ -22,11 +22,9 @@
7861  import logging
7862  import threading
7863  
7864 -# pylint: disable=E0611
7865  from gi.repository import Gdk
7866  from gi.repository import GLib
7867  from gi.repository import Gtk
7868 -# pylint: enable=E0611
7869  
7870  import libvirt
7871  from virtinst import util
7872 @@ -184,7 +182,7 @@
7873          self.reset_state()
7874  
7875      def destconn_changed(self, src):
7876 -        row = uiutil.get_list_selection(src)
7877 +        row = uiutil.get_list_selection(src, None)
7878          tooltip = ""
7879          if row:
7880              tooltip = _("A valid destination connection must be selected.")
7881 @@ -212,7 +210,7 @@
7882          self.widget("migrate-port").set_sensitive(enable)
7883  
7884      def get_config_destconn(self):
7885 -        row = uiutil.get_list_selection(self.widget("migrate-dest"))
7886 +        row = uiutil.get_list_selection(self.widget("migrate-dest"), None)
7887          if not row or not row[2]:
7888              return None
7889          return row[1]
7890 diff -urN virt-manager-1.0.1/virtManager/netlist.py virt-manager/virtManager/netlist.py
7891 --- virt-manager-1.0.1/virtManager/netlist.py   2014-02-17 17:37:52.000000000 +0000
7892 +++ virt-manager/virtManager/netlist.py 2014-06-12 11:22:21.166891895 +0000
7893 @@ -19,10 +19,8 @@
7894  
7895  import logging
7896  
7897 -# pylint: disable=E0611
7898  from gi.repository import Gtk
7899  from gi.repository import GObject
7900 -# pylint: enable=E0611
7901  
7902  import virtinst
7903  from virtManager import uiutil
7904 @@ -43,6 +41,7 @@
7905          self.builder.connect_signals({
7906              "on_net_source_changed": self._on_net_source_changed,
7907              "on_net_source_mode_changed": self._emit_changed,
7908 +            "on_net_portgroup_changed": self._emit_changed,
7909              "on_net_bridge_name_changed": self._emit_changed,
7910  
7911              "on_vport_type_changed": self._emit_vport_changed,
7912 @@ -95,9 +94,14 @@
7913          model.append(["vepa", "VEPA"])
7914          model.append(["private", "Private"])
7915          model.append(["passthrough", "Passthrough"])
7916 -
7917          combo.set_active(0)
7918  
7919 +        combo = self.widget("net-portgroup")
7920 +        # [xml value, label]
7921 +        model = Gtk.ListStore(str, str)
7922 +        combo.set_model(model)
7923 +        uiutil.set_combo_text_column(combo, 1)
7924 +
7925          self.conn.connect("net-added", self._repopulate_network_list)
7926          self.conn.connect("net-removed", self._repopulate_network_list)
7927          self.conn.connect("interface-added", self._repopulate_network_list)
7928 @@ -136,8 +140,7 @@
7929          hasNet = False
7930          netIdxLabel = None
7931  
7932 -        for uuid in self.conn.list_net_uuids():
7933 -            net = self.conn.get_net(uuid)
7934 +        for net in self.conn.list_nets():
7935              nettype = virtinst.VirtualNetworkInterface.TYPE_VIRTUAL
7936  
7937              label = self._pretty_network_desc(nettype, net.get_name(), net)
7938 @@ -152,7 +155,7 @@
7939  
7940              vnet_dict[label] = self._build_source_row(
7941                  nettype, net.get_name(), label, True,
7942 -                net.is_active(), key=net.get_uuid())
7943 +                net.is_active(), key=net.get_connkey())
7944  
7945              # Build a list of vnet bridges, so we know not to list them
7946              # in the physical interface list
7947 @@ -169,7 +172,7 @@
7948  
7949      def _find_physical_devices(self, vnet_bridges):
7950          vnet_taps = []
7951 -        for vm in self.conn.vms.values():
7952 +        for vm in self.conn.list_vms():
7953              for nic in vm.get_network_devices(refresh_if_nec=False):
7954                  if nic.target_dev and nic.target_dev not in vnet_taps:
7955                      vnet_taps.append(nic.target_dev)
7956 @@ -180,8 +183,8 @@
7957          brIdxLabel = None
7958          skip_ifaces = ["lo"]
7959  
7960 -        for name in self.conn.list_net_device_paths():
7961 -            br = self.conn.get_net_device(name)
7962 +        for br in self.conn.list_netdevs():
7963 +            name = br.name
7964              bridge_name = br.get_bridge()
7965              nettype = virtinst.VirtualNetworkInterface.TYPE_BRIDGE
7966  
7967 @@ -284,15 +287,13 @@
7968      ###############
7969  
7970      def get_network_row(self):
7971 -        return uiutil.get_list_selection(self.widget("net-source"))
7972 +        return uiutil.get_list_selection(self.widget("net-source"), None)
7973  
7974      def get_network_selection(self):
7975 -        net_list = self.widget("net-source")
7976          bridge_entry = self.widget("net-bridge-name")
7977 -
7978 -        row = uiutil.get_list_selection(net_list)
7979 +        row = self.get_network_row()
7980          if not row:
7981 -            return None, None, None
7982 +            return None, None, None, None
7983  
7984          net_type = row[0]
7985          net_src = row[1]
7986 @@ -304,9 +305,13 @@
7987  
7988          mode = None
7989          if self.widget("net-source-mode").is_visible():
7990 -            mode = uiutil.get_list_selection(self.widget("net-source-mode"), 0)
7991 +            mode = uiutil.get_combo_entry(self.widget("net-source-mode"), 0)
7992  
7993 -        return net_type, net_src, mode
7994 +        portgroup = None
7995 +        if self.widget("net-portgroup").is_visible():
7996 +            portgroup = uiutil.get_combo_entry(self.widget("net-portgroup"), 0)
7997 +
7998 +        return net_type, net_src, mode, portgroup
7999  
8000      def get_vport(self):
8001          vport_type = self.widget("vport-type").get_text()
8002 @@ -319,7 +324,7 @@
8003           vport_idver, vport_instid)
8004  
8005      def validate_network(self, macaddr, model=None):
8006 -        nettype, devname, mode = self.get_network_selection()
8007 +        nettype, devname, mode, portgroup = self.get_network_selection()
8008          if nettype is None:
8009              return None
8010  
8011 @@ -328,7 +333,7 @@
8012          # Make sure VirtualNetwork is running
8013          netobj = None
8014          if nettype == virtinst.VirtualNetworkInterface.TYPE_VIRTUAL:
8015 -            for net in self.conn.nets.values():
8016 +            for net in self.conn.list_nets():
8017                  if net.get_name() == devname:
8018                      netobj = net
8019                      break
8020 @@ -358,6 +363,7 @@
8021              net.macaddr = macaddr
8022              net.model = model
8023              net.source_mode = mode
8024 +            net.portgroup = portgroup
8025              if net.model == "spapr-vlan":
8026                  net.address.set_addrstr("spapr-vio")
8027  
8028 @@ -395,6 +401,7 @@
8029  
8030          self.widget("net-bridge-name").set_text("")
8031          self.widget("net-source-mode").set_active(0)
8032 +        self.widget("net-portgroup").get_child().set_text("")
8033  
8034          self.widget("vport-type").set_text("")
8035          self.widget("vport-managerid").set_text("")
8036 @@ -443,6 +450,9 @@
8037          combo.set_active_iter(rowiter)
8038          combo.emit("changed")
8039  
8040 +        if net.portgroup:
8041 +            uiutil.set_combo_entry(self.widget("net-portgroup"), net.portgroup)
8042 +
8043  
8044      #############
8045      # Listeners #
8046 @@ -471,15 +481,27 @@
8047                  netlist.set_active_iter(row.iter)
8048                  return
8049  
8050 +    def _populate_portgroups(self, portgroups):
8051 +        combo = self.widget("net-portgroup")
8052 +        model = combo.get_model()
8053 +        model.clear()
8054 +
8055 +        default = None
8056 +        for p in portgroups:
8057 +            model.append([p.name, p.name])
8058 +            if p.default:
8059 +                default = p.name
8060 +
8061 +        uiutil.set_combo_entry(combo, default)
8062 +
8063      def _on_net_source_changed(self, src):
8064 +        ignore = src
8065          self._emit_changed()
8066 -
8067 -        row = uiutil.get_list_selection(src)
8068 +        row = self.get_network_row()
8069          if not row:
8070              return
8071  
8072          is_direct = (row[0] == virtinst.VirtualNetworkInterface.TYPE_DIRECT)
8073 -
8074          self.widget("vport-expander").set_visible(is_direct)
8075          uiutil.set_grid_row_visible(self.widget("net-source-mode"), is_direct)
8076          uiutil.set_grid_row_visible(
8077 @@ -490,3 +512,12 @@
8078          show_bridge = row[5]
8079          uiutil.set_grid_row_visible(
8080              self.widget("net-bridge-name"), show_bridge)
8081 +
8082 +        portgroups = []
8083 +        connkey = row[6]
8084 +        if connkey and row[0] == virtinst.VirtualNetworkInterface.TYPE_VIRTUAL:
8085 +            portgroups = self.conn.get_net(connkey).get_xmlobj().portgroups
8086 +
8087 +        uiutil.set_grid_row_visible(
8088 +            self.widget("net-portgroup"), bool(portgroups))
8089 +        self._populate_portgroups(portgroups)
8090 diff -urN virt-manager-1.0.1/virtManager/network.py virt-manager/virtManager/network.py
8091 --- virt-manager-1.0.1/virtManager/network.py   2014-02-17 17:37:52.000000000 +0000
8092 +++ virt-manager/virtManager/network.py 2014-06-12 11:22:21.167891895 +0000
8093 @@ -54,8 +54,6 @@
8094      # Required class methods #
8095      ##########################
8096  
8097 -    def get_name(self):
8098 -        return self._backend.name()
8099      def _XMLDesc(self, flags):
8100          return self._backend.XMLDesc(flags)
8101      def _define(self, xml):
8102 @@ -83,7 +81,8 @@
8103          self.idle_emit(state and "started" or "stopped")
8104          self._active = state
8105  
8106 -    def force_update_status(self, from_event=False):
8107 +    def force_update_status(self, from_event=False, log=True):
8108 +        ignore = log
8109          if self._using_events() and not from_event:
8110              return
8111  
8112 diff -urN virt-manager-1.0.1/virtManager/nodedev.py virt-manager/virtManager/nodedev.py
8113 --- virt-manager-1.0.1/virtManager/nodedev.py   2014-02-17 17:37:52.000000000 +0000
8114 +++ virt-manager/virtManager/nodedev.py 2014-06-12 11:22:21.167891895 +0000
8115 @@ -34,8 +34,6 @@
8116  
8117      def _XMLDesc(self, flags):
8118          return self._backend.XMLDesc(flags)
8119 -    def get_name(self):
8120 -        return self._name
8121      def is_active(self):
8122          return True
8123  
8124 diff -urN virt-manager-1.0.1/virtManager/packageutils.py virt-manager/virtManager/packageutils.py
8125 --- virt-manager-1.0.1/virtManager/packageutils.py      2014-02-17 17:37:52.000000000 +0000
8126 +++ virt-manager/virtManager/packageutils.py    2014-06-12 11:22:21.167891895 +0000
8127 @@ -18,9 +18,7 @@
8128  # MA 02110-1301 USA.
8129  #
8130  
8131 -# pylint: disable=E0611
8132  from gi.repository import Gio
8133 -# pylint: enable=E0611
8134  
8135  import logging
8136  import time
8137 @@ -53,7 +51,12 @@
8138          return
8139  
8140      try:
8141 -        packagekit_install(parent, packages)
8142 +        for package in packages[:]:
8143 +            if packagekit_isinstalled(package):
8144 +                packages.remove(package)
8145 +
8146 +        if packages:
8147 +            packagekit_install(parent, packages)
8148      except Exception, e:
8149          # PackageKit frontend should report an error for us, so just log
8150          # the actual error
8151 @@ -63,6 +66,16 @@
8152      return True
8153  
8154  
8155 +def packagekit_isinstalled(package):
8156 +    bus = Gio.bus_get_sync(Gio.BusType.SESSION, None)
8157 +    pk_control = Gio.DBusProxy.new_sync(bus, 0, None,
8158 +                            "org.freedesktop.PackageKit",
8159 +                            "/org/freedesktop/PackageKit",
8160 +                            "org.freedesktop.PackageKit.Query", None)
8161 +
8162 +    return pk_control.IsInstalled("(ss)", package, "")
8163 +
8164 +
8165  def packagekit_install(parent, package_list):
8166      bus = Gio.bus_get_sync(Gio.BusType.SESSION, None)
8167      pk_control = Gio.DBusProxy.new_sync(bus, 0, None,
8168 @@ -74,7 +87,7 @@
8169      try:
8170          # Need to import GdkX11 just to get access to get_xid function
8171          # This will likely fail on wayland in the future, so ignore errors
8172 -        from gi.repository import GdkX11  # pylint: disable=E0611
8173 +        from gi.repository import GdkX11  # pylint: disable=no-name-in-module
8174          ignore = GdkX11
8175  
8176          if parent and parent.topwin.get_window():
8177 diff -urN virt-manager-1.0.1/virtManager/preferences.py virt-manager/virtManager/preferences.py
8178 --- virt-manager-1.0.1/virtManager/preferences.py       2014-02-17 17:37:52.000000000 +0000
8179 +++ virt-manager/virtManager/preferences.py     2014-06-12 11:22:21.167891895 +0000
8180 @@ -20,10 +20,8 @@
8181  
8182  import logging
8183  
8184 -# pylint: disable=E0611
8185  from gi.repository import Gtk
8186  from gi.repository import Gdk
8187 -# pylint: enable=E0611
8188  
8189  from virtManager import uiutil
8190  from virtManager.baseclass import vmmGObjectUI
8191 @@ -303,10 +301,10 @@
8192          dialog.set_default_size(325, 160)
8193          dialog.set_border_width(6)
8194  
8195 -        infolabel = Gtk.Label(label=
8196 -                    _("You can now define grab keys by pressing them.\n"
8197 -                      "To confirm your selection please click OK button\n"
8198 -                      "while you have desired keys pressed."))
8199 +        infolabel = Gtk.Label(
8200 +            label=_("You can now define grab keys by pressing them.\n"
8201 +                    "To confirm your selection please click OK button\n"
8202 +                    "while you have desired keys pressed."))
8203          keylabel = Gtk.Label(label=_("Please press desired grab key combination"))
8204  
8205          vbox = Gtk.VBox()
8206 diff -urN virt-manager-1.0.1/virtManager/serialcon.py virt-manager/virtManager/serialcon.py
8207 --- virt-manager-1.0.1/virtManager/serialcon.py 2014-02-17 17:37:52.000000000 +0000
8208 +++ virt-manager/virtManager/serialcon.py       2014-06-12 11:22:21.167891895 +0000
8209 @@ -25,12 +25,10 @@
8210  import fcntl
8211  import logging
8212  
8213 -# pylint: disable=E0611
8214  from gi.repository import Gdk
8215  from gi.repository import GLib
8216  from gi.repository import Gtk
8217  from gi.repository import Vte
8218 -# pylint: enable=E0611
8219  
8220  import libvirt
8221  
8222 @@ -284,7 +282,7 @@
8223                          "connection")
8224          elif not vm.is_active():
8225              err = _("Serial console not available for inactive guest")
8226 -        elif not ctype in usable_types:
8227 +        elif ctype not in usable_types:
8228              err = (_("Console for device type '%s' not yet supported") %
8229                       ctype)
8230          elif (not is_remote and
8231 @@ -378,6 +376,14 @@
8232          self.box.append_page(self.error_label, Gtk.Label(""))
8233          self.box.show_all()
8234  
8235 +        scrollbar.hide()
8236 +        scrollbar.get_adjustment().connect(
8237 +            "changed", self._scrollbar_adjustment_changed, scrollbar)
8238 +
8239 +    def _scrollbar_adjustment_changed(self, adjustment, scrollbar):
8240 +        scrollbar.set_visible(
8241 +            adjustment.get_upper() > adjustment.get_page_size())
8242 +
8243      def _cleanup(self):
8244          self.console.cleanup()
8245          self.console = None
8246 diff -urN virt-manager-1.0.1/virtManager/snapshots.py virt-manager/virtManager/snapshots.py
8247 --- virt-manager-1.0.1/virtManager/snapshots.py 2014-03-10 15:17:52.000000000 +0000
8248 +++ virt-manager/virtManager/snapshots.py       2014-06-12 11:22:21.167891895 +0000
8249 @@ -24,12 +24,10 @@
8250  import os
8251  import StringIO
8252  
8253 -# pylint: disable=E0611
8254  from gi.repository import Gdk
8255  from gi.repository import GdkPixbuf
8256  from gi.repository import Gtk
8257  from gi.repository import Pango
8258 -# pylint: enable=E0611
8259  
8260  from virtinst import DomainSnapshot
8261  from virtinst import util
8262 @@ -379,6 +377,11 @@
8263              return
8264  
8265          try:
8266 +            # Perform two screenshots, because qemu + qxl has a bug where
8267 +            # screenshot generally only shows the data from the previous
8268 +            # screenshot request:
8269 +            # https://bugs.launchpad.net/qemu/+bug/1314293
8270 +            self._take_screenshot()
8271              mime, sdata = self._take_screenshot()
8272          except:
8273              logging.exception("Error taking screenshot")
8274 @@ -553,10 +556,15 @@
8275  
8276      def _on_start_clicked(self, ignore):
8277          snap = self._get_selected_snapshot()
8278 -        result = self.err.yes_no(_("Are you sure you want to run "
8279 -                                   "snapshot '%s'? All disk changes since "
8280 -                                   "the last snapshot was created will be "
8281 -                                   "discarded.") % snap.get_name())
8282 +        msg = _("Are you sure you want to run snapshot '%s'? "
8283 +            "All %s changes since the last snapshot was created will be "
8284 +            "discarded.")
8285 +        if self.vm.is_active():
8286 +            msg = msg % (snap.get_name(), _("disk"))
8287 +        else:
8288 +            msg = msg % (snap.get_name(), _("disk and configuration"))
8289 +
8290 +        result = self.err.yes_no(msg)
8291          if not result:
8292              return
8293  
8294 diff -urN virt-manager-1.0.1/virtManager/storagebrowse.py virt-manager/virtManager/storagebrowse.py
8295 --- virt-manager-1.0.1/virtManager/storagebrowse.py     2014-03-10 15:17:52.000000000 +0000
8296 +++ virt-manager/virtManager/storagebrowse.py   2014-06-12 11:22:21.167891895 +0000
8297 @@ -20,10 +20,8 @@
8298  
8299  import logging
8300  
8301 -# pylint: disable=E0611
8302  from gi.repository import GObject
8303  from gi.repository import Gtk
8304 -# pylint: enable=E0611
8305  
8306  from virtManager import host
8307  from virtManager.asyncjob import vmmAsyncJob
8308 @@ -184,8 +182,9 @@
8309          if not self._first_run:
8310              self._first_run = True
8311              pool = self.conn.get_default_pool()
8312 -            uiutil.set_row_selection(
8313 -                self.widget("pool-list"), pool and pool.get_uuid() or None)
8314 +            uiutil.set_row_selection(self.widget("pool-list"),
8315 +                pool and pool.get_connkey() or None)
8316 +
8317          # Manually trigger vol_selected, so buttons are in the correct state
8318          self.vol_selected()
8319          self.pool_selected()
8320 @@ -221,18 +220,20 @@
8321          return data["enable_create"]
8322  
8323      def current_pool(self):
8324 -        row = uiutil.get_list_selection(self.widget("pool-list"))
8325 +        row = uiutil.get_list_selection(self.widget("pool-list"), None)
8326          if not row:
8327              return
8328 +
8329 +        connkey = row[0]
8330          try:
8331 -            return self.conn.get_pool(row[0])
8332 +            return self.conn.get_pool(connkey)
8333          except KeyError:
8334              return None
8335  
8336      def current_vol_row(self):
8337          if not self.current_pool():
8338              return
8339 -        return uiutil.get_list_selection(self.widget("vol-list"))
8340 +        return uiutil.get_list_selection(self.widget("vol-list"), None)
8341  
8342      def current_vol(self):
8343          pool = self.current_pool()
8344 @@ -241,18 +242,22 @@
8345              return
8346          return pool.get_volume(row[0])
8347  
8348 -    def refresh_storage_pool(self, src_ignore, uuid):
8349 +    def refresh_storage_pool(self, src, connkey):
8350 +        ignore = src
8351 +
8352          pool_list = self.widget("pool-list")
8353 -        host.refresh_pool_in_list(pool_list, self.conn, uuid)
8354 +        host.refresh_pool_in_list(pool_list, self.conn, connkey)
8355          curpool = self.current_pool()
8356 -        if curpool.get_uuid() != uuid:
8357 +        if curpool.get_connkey() != connkey:
8358              return
8359  
8360          # Currently selected pool changed state: force a 'pool_selected' to
8361          # update vol list
8362          self.pool_selected(self.widget("pool-list").get_selection())
8363  
8364 -    def repopulate_storage_pools(self, src_ignore=None, uuid_ignore=None):
8365 +    def repopulate_storage_pools(self, src=None, connkey=None):
8366 +        ignore = src
8367 +        ignore = connkey
8368          pool_list = self.widget("pool-list")
8369          host.populate_storage_pools(pool_list, self.conn, self.current_pool())
8370  
8371 @@ -329,7 +334,7 @@
8372              return
8373          cp.refresh()
8374  
8375 -        self.refresh_storage_pool(None, cp.get_uuid())
8376 +        self.refresh_storage_pool(None, cp.get_connkey())
8377          name = createvol and createvol.vol.name or None
8378  
8379          vol_list = self.widget("vol-list")
8380 diff -urN virt-manager-1.0.1/virtManager/storagepool.py virt-manager/virtManager/storagepool.py
8381 --- virt-manager-1.0.1/virtManager/storagepool.py       2014-02-17 17:37:52.000000000 +0000
8382 +++ virt-manager/virtManager/storagepool.py     2014-06-12 11:22:21.167891895 +0000
8383 @@ -18,9 +18,9 @@
8384  # MA 02110-1301 USA.
8385  #
8386  
8387 -# pylint: disable=E0611
8388 +import logging
8389 +
8390  from gi.repository import GObject
8391 -# pylint: enable=E0611
8392  
8393  from virtinst import pollhelpers
8394  from virtinst import StoragePool, StorageVolume
8395 @@ -38,10 +38,13 @@
8396      # Required class methods #
8397      ##########################
8398  
8399 -    def get_name(self):
8400 -        return self.get_xmlobj().name
8401      def _XMLDesc(self, flags):
8402 -        return self._backend.XMLDesc(flags)
8403 +        try:
8404 +            return self._backend.XMLDesc(flags)
8405 +        except Exception, e:
8406 +            logging.debug("XMLDesc for vol=%s failed: %s",
8407 +                self._backend.key(), e)
8408 +            raise
8409  
8410  
8411      ###########
8412 @@ -49,8 +52,10 @@
8413      ###########
8414  
8415      def get_parent_pool(self):
8416 -        pobj = self._backend.storagePoolLookupByVolume()
8417 -        return self.conn.get_pool_by_name(pobj.name())
8418 +        name = self._backend.storagePoolLookupByVolume().name()
8419 +        for pool in self.conn.list_pools():
8420 +            if pool.get_name() == name:
8421 +                return pool
8422  
8423      def delete(self, force=True):
8424          ignore = force
8425 @@ -110,8 +115,6 @@
8426      # Required class methods #
8427      ##########################
8428  
8429 -    def get_name(self):
8430 -        return self.get_xmlobj().name
8431      def _XMLDesc(self, flags):
8432          return self._backend.XMLDesc(flags)
8433      def _define(self, xml):
8434 @@ -198,8 +201,8 @@
8435              self.update_volumes()
8436          return self._volumes
8437  
8438 -    def get_volume(self, uuid):
8439 -        return self._volumes[uuid]
8440 +    def get_volume(self, key):
8441 +        return self._volumes[key]
8442  
8443      def update_volumes(self, refresh=False):
8444          if not self.is_active():
8445 diff -urN virt-manager-1.0.1/virtManager/systray.py virt-manager/virtManager/systray.py
8446 --- virt-manager-1.0.1/virtManager/systray.py   2014-03-22 15:00:01.000000000 +0000
8447 +++ virt-manager/virtManager/systray.py 2014-06-12 11:22:21.167891895 +0000
8448 @@ -20,17 +20,15 @@
8449  
8450  import logging
8451  
8452 -# pylint: disable=E0611
8453  from gi.repository import GObject
8454  from gi.repository import Gtk
8455 -# pylint: enable=E0611
8456  
8457  from virtManager import vmmenu
8458  from virtManager.baseclass import vmmGObject
8459  from virtManager.error import vmmErrorDialog
8460  
8461  try:
8462 -    from gi.repository import AppIndicator3  # pylint: disable=E0611
8463 +    from gi.repository import AppIndicator3  # pylint: disable=no-name-in-module
8464  except:
8465      AppIndicator3 = None
8466  
8467 @@ -166,12 +164,12 @@
8468  
8469      # Helper functions
8470      def _get_vm_menu_item(self, vm):
8471 -        uuid = vm.get_uuid()
8472 +        connkey = vm.get_connkey()
8473          uri = vm.conn.get_uri()
8474  
8475          if uri in self.conn_vm_menuitems:
8476 -            if uuid in self.conn_vm_menuitems[uri]:
8477 -                return self.conn_vm_menuitems[uri][uuid]
8478 +            if connkey in self.conn_vm_menuitems[uri]:
8479 +                return self.conn_vm_menuitems[uri][connkey]
8480          return None
8481  
8482      def _set_vm_status_icon(self, vm, menu_item):
8483 @@ -232,7 +230,7 @@
8484          self.populate_vm_list(conn)
8485  
8486      def conn_removed(self, engine_ignore, uri):
8487 -        if not uri in self.conn_menuitems:
8488 +        if uri not in self.conn_menuitems:
8489              return
8490  
8491          menu_item = self.conn_menuitems[uri]
8492 @@ -258,8 +256,8 @@
8493              vm_submenu.remove(c)
8494  
8495          vm_mappings = {}
8496 -        for vm in conn.vms.values():
8497 -            vm_mappings[vm.get_name()] = vm.get_uuid()
8498 +        for vm in conn.list_vms():
8499 +            vm_mappings[vm.get_name()] = vm.get_connkey()
8500  
8501          vm_names = vm_mappings.keys()
8502          vm_names.sort()
8503 @@ -272,30 +270,30 @@
8504  
8505          for i in range(0, len(vm_names)):
8506              name = vm_names[i]
8507 -            uuid = vm_mappings[name]
8508 -            if uuid in self.conn_vm_menuitems[uri]:
8509 -                vm_item = self.conn_vm_menuitems[uri][uuid]
8510 +            connkey = vm_mappings[name]
8511 +            if connkey in self.conn_vm_menuitems[uri]:
8512 +                vm_item = self.conn_vm_menuitems[uri][connkey]
8513                  vm_submenu.insert(vm_item, i)
8514  
8515 -    def vm_added(self, conn, uuid):
8516 +    def vm_added(self, conn, connkey):
8517          uri = conn.get_uri()
8518 -        vm = conn.get_vm(uuid)
8519 +        vm = conn.get_vm(connkey)
8520          if not vm:
8521              return
8522          vm.connect("status-changed", self.vm_state_changed)
8523  
8524          vm_mappings = self.conn_vm_menuitems[uri]
8525 -        if uuid in vm_mappings:
8526 +        if connkey in vm_mappings:
8527              return
8528  
8529          # Build VM list entry
8530          menu_item = Gtk.ImageMenuItem.new_with_label(vm.get_name())
8531          menu_item.set_use_underline(False)
8532  
8533 -        vm_mappings[uuid] = menu_item
8534 +        vm_mappings[connkey] = menu_item
8535          vm_action_menu = vmmenu.VMActionMenu(self, lambda: vm)
8536          menu_item.set_submenu(vm_action_menu)
8537 -        self.vm_action_dict[uuid] = vm_action_menu
8538 +        self.vm_action_dict[connkey] = vm_action_menu
8539  
8540          # Add VM to menu list
8541          self.populate_vm_list(conn)
8542 @@ -304,26 +302,28 @@
8543          self.vm_state_changed(vm)
8544          menu_item.show()
8545  
8546 -    def vm_removed(self, conn, uuid):
8547 +    def vm_removed(self, conn, connkey):
8548          uri = conn.get_uri()
8549          vm_mappings = self.conn_vm_menuitems[uri]
8550          if not vm_mappings:
8551              return
8552  
8553 -        if uuid in vm_mappings:
8554 -            conn_item = self.conn_menuitems[uri]
8555 -            vm_menu_item = vm_mappings[uuid]
8556 -            vm_menu = conn_item.get_submenu()
8557 -            vm_menu.remove(vm_menu_item)
8558 -            vm_menu_item.destroy()
8559 -            del(vm_mappings[uuid])
8560 -
8561 -            if len(vm_menu.get_children()) == 0:
8562 -                placeholder = Gtk.MenuItem.new_with_label(
8563 -                    _("No virtual machines"))
8564 -                placeholder.show()
8565 -                placeholder.set_sensitive(False)
8566 -                vm_menu.add(placeholder)
8567 +        if connkey not in vm_mappings:
8568 +            return
8569 +
8570 +        conn_item = self.conn_menuitems[uri]
8571 +        vm_menu_item = vm_mappings[connkey]
8572 +        vm_menu = conn_item.get_submenu()
8573 +        vm_menu.remove(vm_menu_item)
8574 +        vm_menu_item.destroy()
8575 +        del(vm_mappings[connkey])
8576 +
8577 +        if len(vm_menu.get_children()) == 0:
8578 +            placeholder = Gtk.MenuItem.new_with_label(
8579 +                _("No virtual machines"))
8580 +            placeholder.show()
8581 +            placeholder.set_sensitive(False)
8582 +            vm_menu.add(placeholder)
8583  
8584      def vm_state_changed(self, vm, ignore=None, ignore2=None):
8585          menu_item = self._get_vm_menu_item(vm)
8586 @@ -333,7 +333,7 @@
8587          self._set_vm_status_icon(vm, menu_item)
8588  
8589          # Update action widget states
8590 -        menu = self.vm_action_dict[vm.get_uuid()]
8591 +        menu = self.vm_action_dict[vm.get_connkey()]
8592          menu.update_widget_states(vm)
8593  
8594      def exit_app(self, ignore):
8595 diff -urN virt-manager-1.0.1/virtManager/uiutil.py virt-manager/virtManager/uiutil.py
8596 --- virt-manager-1.0.1/virtManager/uiutil.py    2014-03-22 22:00:07.000000000 +0000
8597 +++ virt-manager/virtManager/uiutil.py  2014-06-12 11:22:21.168891895 +0000
8598 @@ -18,10 +18,8 @@
8599  # MA 02110-1301 USA.
8600  #
8601  
8602 -# pylint: disable=E0611
8603  from gi.repository import GObject
8604  from gi.repository import Gtk
8605 -# pylint: enable=E0611
8606  
8607  try:
8608      import gi
8609 @@ -58,9 +56,11 @@
8610          return adj.get_value()
8611  
8612  
8613 -def get_list_selection(widget, rowindex=None, check_visible=False):
8614 +def get_list_selection(widget, rowindex, check_visible=False):
8615      """
8616 -    Helper to simplify getting the selected row in a list/tree/combo
8617 +    Helper to simplify getting the selected row and value in a list/tree/combo
8618 +
8619 +    If rowindex is None, return the whole row.
8620      """
8621      if check_visible and not widget.get_visible():
8622          return None
8623 @@ -145,7 +145,7 @@
8624      Helper to get the value specified in a combo box, with or
8625      without and entry
8626      """
8627 -    row = get_list_selection(combo)
8628 +    row = get_list_selection(combo, None)
8629      if row:
8630          return row[rowidx]
8631      if not combo.get_has_entry():
8632 diff -urN virt-manager-1.0.1/virtManager/vmmenu.py virt-manager/virtManager/vmmenu.py
8633 --- virt-manager-1.0.1/virtManager/vmmenu.py    2014-02-17 17:37:52.000000000 +0000
8634 +++ virt-manager/virtManager/vmmenu.py  2014-06-12 11:22:21.168891895 +0000
8635 @@ -18,9 +18,7 @@
8636  # MA 02110-1301 USA.
8637  #
8638  
8639 -# pylint: disable=E0611
8640  from gi.repository import Gtk
8641 -# pylint: enable=E0611
8642  
8643  
8644  ####################################################################
8645 @@ -28,9 +26,6 @@
8646  ####################################################################
8647  
8648  class _VMMenu(Gtk.Menu):
8649 -    # pylint: disable=E1101
8650 -    # pylint can't detect functions we inheirit from Gtk, ex self.add
8651 -
8652      def __init__(self, src, current_vm_cb, show_open=True):
8653          Gtk.Menu.__init__(self)
8654          self._parent = src
8655 @@ -65,7 +60,7 @@
8656          if not vm:
8657              return
8658          self._parent.emit("action-%s-domain" % src.vmm_widget_name,
8659 -                          vm.conn.get_uri(), vm.get_uuid())
8660 +                          vm.conn.get_uri(), vm.get_connkey())
8661  
8662      def _init_state(self):
8663          raise NotImplementedError()
8664 @@ -74,9 +69,6 @@
8665  
8666  
8667  class VMShutdownMenu(_VMMenu):
8668 -    # pylint: disable=E1101
8669 -    # pylint can't detect functions we inheirit from Gtk, ex self.add
8670 -
8671      def _init_state(self):
8672          self._add_action(_("_Reboot"), "reboot")
8673          self._add_action(_("_Shut Down"), "shutdown")
8674 @@ -103,9 +95,6 @@
8675  
8676  
8677  class VMActionMenu(_VMMenu):
8678 -    # pylint: disable=E1101
8679 -    # pylint can't detect functions we inheirit from Gtk, ex self.add
8680 -
8681      def _init_state(self):
8682          self._add_action(_("_Run"), "run", Gtk.STOCK_MEDIA_PLAY)
8683          self._add_action(_("_Pause"), "suspend", Gtk.STOCK_MEDIA_PAUSE)
This page took 0.728689 seconds and 3 git commands to generate.